2021-04-21 17:47:08 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const assert = require( 'assert' );
|
|
|
|
const BlankPage = require( '../pageobjects/blank.page' );
|
|
|
|
const EditPage = require( '../pageobjects/edit.page' );
|
2021-05-05 14:20:14 +00:00
|
|
|
const UserLoginPage = require( 'wdio-mediawiki/LoginPage' );
|
2021-04-21 17:47:08 +00:00
|
|
|
const Util = require( 'wdio-mediawiki/Util' );
|
|
|
|
|
|
|
|
describe( 'Page', function () {
|
|
|
|
let content, name;
|
|
|
|
|
|
|
|
beforeEach( function () {
|
|
|
|
content = Util.getTestString( 'beforeEach-content-' );
|
|
|
|
name = Util.getTestString( 'BeforeEach-name-' );
|
|
|
|
} );
|
|
|
|
|
|
|
|
it( 'should be creatable', function () {
|
|
|
|
BlankPage.open();
|
2021-05-05 14:20:14 +00:00
|
|
|
// FIXME: This check should be redundant when T282058 is resolved.
|
|
|
|
if ( BlankPage.mobileView.isDisplayed() ) {
|
|
|
|
BlankPage.mobileView.click();
|
|
|
|
}
|
2021-04-21 17:47:08 +00:00
|
|
|
|
2021-05-05 14:20:14 +00:00
|
|
|
UserLoginPage.loginAdmin();
|
2021-04-21 17:47:08 +00:00
|
|
|
EditPage.edit( name, content );
|
|
|
|
|
|
|
|
browser.waitUntil(
|
|
|
|
() => EditPage.heading.getText() === name
|
|
|
|
);
|
|
|
|
assert.strictEqual( EditPage.heading.getText(), name );
|
|
|
|
assert.strictEqual( EditPage.displayedContent.getText(), content );
|
|
|
|
} );
|
|
|
|
} );
|