Debian Codegraph @

extensions/VisualEditor/tests/selenium/specs/content_editable.js

raw symbols SCIP
1 'use strict';
2 const assert = require( 'assert' );
3 const EditPage = require( '../pageobjects/edit.page' );
4 const LoginPage = require( 'wdio-mediawiki/LoginPage' );
5 const Util = require( 'wdio-mediawiki/Util' );
6
7 describe( 'Content Editable', () => {
8
9 let name, content;
10
11 beforeEach( async () => {
12 content = Util.getTestString();
13 name = Util.getTestString();
14 await LoginPage.loginAdmin();
15
16 await EditPage.openForEditing( name );
17 await EditPage.toolbar.waitForDisplayed( { timeout: 20000 } );
18 } );
19
20 afterEach( async () => {
21 // T269566: Popup with text
22 // 'Leave site? Changes that you made may not be saved. Cancel/Leave'
23 // appears after the browser tries to leave the page with the preview.
24 await browser.reloadSession();
25 } );
26
27 it( 'should load when an url is opened @daily', async () => {
28 assert( await EditPage.toolbar.isDisplayed() );
29 } );
30
31 it( 'should be editable', async () => {
32 await EditPage.veRootNode.setValue( content );
33
34 assert.equal( await EditPage.veRootNode.getText(), content );
35 } );
36
37 it( 'should save an edit', async () => {
38 await EditPage.veRootNode.setValue( content );
39 await EditPage.savePageDots.click();
40 await EditPage.savePage.waitForClickable();
41 await EditPage.savePage.click();
42
43 await EditPage.saveComplete();
44 assert.strictEqual( await EditPage.notification.getText(), 'The page has been created.' );
45 } );
46
47 it( 'should insert a table', async () => {
48 await EditPage.insertTable();
49
50 assert( await EditPage.insertedTable.isDisplayed() );
51 } );
52
53 } );