2021-04-21 17:47:08 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const assert = require( 'assert' );
|
|
|
|
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 () {
|
2021-07-01 14:42:58 +00:00
|
|
|
content = Util.getTestString( 'BeforeEach-content-' );
|
2021-04-21 17:47:08 +00:00
|
|
|
name = Util.getTestString( 'BeforeEach-name-' );
|
|
|
|
} );
|
|
|
|
|
|
|
|
it( 'should be creatable', function () {
|
2021-05-05 14:20:14 +00:00
|
|
|
UserLoginPage.loginAdmin();
|
2021-05-07 15:34:58 +00:00
|
|
|
|
2021-04-21 17:47:08 +00:00
|
|
|
EditPage.edit( name, content );
|
|
|
|
|
|
|
|
browser.waitUntil(
|
2021-07-01 14:42:58 +00:00
|
|
|
() => EditPage.heading.getText() === name,
|
|
|
|
{
|
|
|
|
timeout: 10000
|
|
|
|
}
|
2021-04-21 17:47:08 +00:00
|
|
|
);
|
|
|
|
assert.strictEqual( EditPage.heading.getText(), name );
|
|
|
|
assert.strictEqual( EditPage.displayedContent.getText(), content );
|
|
|
|
} );
|
|
|
|
} );
|