Merge "selenium: Fix 'Page should be creatable' test"

This commit is contained in:
jenkins-bot 2021-05-05 21:42:07 +00:00 committed by Gerrit Code Review
commit e28a177dca
2 changed files with 6 additions and 3 deletions

View file

@ -5,7 +5,6 @@ const Page = require( 'wdio-mediawiki/Page' );
class EditPage extends Page {
get content() { return $( '#wikitext-editor' ); }
get displayedContent() { return $( '#mw-content-text .mw-parser-output' ); }
get editWithoutLoggingIn() { return $( '.anonymous' ); }
get heading() { return $( '#section_0' ); }
get next() { return $( '.mw-ui-icon-mf-next-invert' ); }
get save() { return $( 'button.mw-ui-button' ); }
@ -16,7 +15,6 @@ class EditPage extends Page {
edit( name, content ) {
this.openForEditing( name );
this.editWithoutLoggingIn.click();
this.content.setValue( content );
this.next.click();
this.save.click();

View file

@ -3,6 +3,7 @@
const assert = require( 'assert' );
const BlankPage = require( '../pageobjects/blank.page' );
const EditPage = require( '../pageobjects/edit.page' );
const UserLoginPage = require( 'wdio-mediawiki/LoginPage' );
const Util = require( 'wdio-mediawiki/Util' );
describe( 'Page', function () {
@ -15,8 +16,12 @@ describe( 'Page', function () {
it( 'should be creatable', function () {
BlankPage.open();
BlankPage.mobileView.click();
// FIXME: This check should be redundant when T282058 is resolved.
if ( BlankPage.mobileView.isDisplayed() ) {
BlankPage.mobileView.click();
}
UserLoginPage.loginAdmin();
EditPage.edit( name, content );
browser.waitUntil(