mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-04 18:58:37 +00:00
df82cecfd7
Assertions from Expect library are more readable that assertions from Assert library. Bug: T325740 Change-Id: I3255483d99e096deea12aaccbebeabcdcc2e1b21
53 lines
1.5 KiB
JavaScript
53 lines
1.5 KiB
JavaScript
'use strict';
|
|
const EditPage = require( '../pageobjects/edit.page' );
|
|
const LoginPage = require( 'wdio-mediawiki/LoginPage' );
|
|
const Util = require( 'wdio-mediawiki/Util' );
|
|
|
|
describe( 'Content Editable', () => {
|
|
|
|
let name, content;
|
|
|
|
beforeEach( async () => {
|
|
content = Util.getTestString();
|
|
name = Util.getTestString();
|
|
await LoginPage.loginAdmin();
|
|
|
|
await EditPage.openForEditing( name );
|
|
await EditPage.toolbar.waitForDisplayed( { timeout: 20000 } );
|
|
} );
|
|
|
|
afterEach( async () => {
|
|
// T269566: Popup with text
|
|
// 'Leave site? Changes that you made may not be saved. Cancel/Leave'
|
|
// appears after the browser tries to leave the page with the preview.
|
|
await browser.reloadSession();
|
|
} );
|
|
|
|
it( 'should load when an url is opened @daily', async () => {
|
|
await expect( await EditPage.toolbar ).toBeDisplayed();
|
|
} );
|
|
|
|
it( 'should be editable', async () => {
|
|
await EditPage.veRootNode.setValue( content );
|
|
|
|
await expect( await EditPage.veRootNode ).toHaveText( content );
|
|
} );
|
|
|
|
it( 'should save an edit', async () => {
|
|
await EditPage.veRootNode.setValue( content );
|
|
await EditPage.savePageDots.click();
|
|
await EditPage.savePage.waitForClickable();
|
|
await EditPage.savePage.click();
|
|
|
|
await EditPage.saveComplete();
|
|
await expect( await EditPage.notification ).toHaveText( 'The page has been created.' );
|
|
} );
|
|
|
|
it( 'should insert a table', async () => {
|
|
await EditPage.insertTable();
|
|
|
|
await expect( await EditPage.insertedTable ).toBeDisplayed();
|
|
} );
|
|
|
|
} );
|