mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 14:33:59 +00:00
e9ee23aace
Bug: T296187 Change-Id: I5a48662bb271fd49b6cfa0365e4775c8865dc5c7
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
'use strict';
|
|
const assert = require( 'assert' );
|
|
const EditPage = require( '../pageobjects/edit.page' );
|
|
const LoginPage = require( 'wdio-mediawiki/LoginPage' );
|
|
const Util = require( 'wdio-mediawiki/Util' );
|
|
|
|
describe( 'Content Editable', function () {
|
|
|
|
let name, content;
|
|
|
|
beforeEach( async function () {
|
|
content = Util.getTestString();
|
|
name = Util.getTestString();
|
|
await browser.deleteAllCookies();
|
|
await LoginPage.loginAdmin();
|
|
|
|
await EditPage.openForEditing( name );
|
|
await EditPage.activationComplete();
|
|
} );
|
|
|
|
it( 'should load when an url is opened', async function () {
|
|
assert( await EditPage.toolbar.isDisplayed() );
|
|
} );
|
|
|
|
it( 'should be editable', async function () {
|
|
await EditPage.veRootNode.setValue( content );
|
|
|
|
assert.equal( await EditPage.veRootNode.getText(), content );
|
|
|
|
// 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 save an edit', async function () {
|
|
await EditPage.veRootNode.setValue( content );
|
|
await EditPage.savePageDots.click();
|
|
await EditPage.savePage.click();
|
|
|
|
assert( await EditPage.veBodyContent.isDisplayed() );
|
|
assert.equal( await EditPage.veBodyContent.getText(), content );
|
|
} );
|
|
|
|
} );
|