Use wdio-mediawiki in selenium tests

Change-Id: If48e0a885acdf4bca73ec2a9d613fe2f0403dd61
This commit is contained in:
jdlrobson 2017-12-08 10:40:57 -08:00 committed by Stephen Niedzielski
parent eacbd18d3a
commit 993c4e227e
3 changed files with 7 additions and 6 deletions

View file

@ -11,6 +11,7 @@
"grunt-jsonlint": "1.1.0",
"grunt-stylelint": "0.9.0",
"stylelint": "8.2.0",
"stylelint-config-wikimedia": "0.4.2"
"stylelint-config-wikimedia": "0.4.2",
"wdio-mediawiki": "0.1.7"
}
}

View file

@ -1,6 +1,6 @@
'use strict';
const CARD_SELECTOR = '.ext-related-articles-card',
Page = require( '../../../../../tests/selenium/pageobjects/page' ),
Page = require( 'wdio-mediawiki/Page' ),
READ_MORE_MODULE_NAME = 'ext.relatedArticles.readMore';
class ReadMorePage extends Page {
@ -8,12 +8,12 @@ class ReadMorePage extends Page {
get mobileView() { return browser.element( '#footer-places-mobileview' ); }
openDesktop( name ) {
super.open( name );
super.openTitle( name );
this.resourceLoaderModuleStatus( READ_MORE_MODULE_NAME, 'registered' );
}
openMobile( name ) {
super.open( name );
super.openTitle( name );
this.mobileView.click();
this.resourceLoaderModuleStatus( READ_MORE_MODULE_NAME, 'ready' );
}

View file

@ -1,7 +1,7 @@
'use strict';
var assert = require( 'assert' ),
EditPage = require( '../../../../../tests/selenium/pageobjects/edit.page' ),
Api = require( 'wdio-mediawiki/Api' ),
ReadMorePage = require( '../pageobjects/readmore.page' );
describe( 'ReadMore', function () {
@ -12,7 +12,7 @@ describe( 'ReadMore', function () {
// Create page needed for the tests
browser.call( function () {
let content = '{{#related:related_articles_2}}';
return EditPage.apiEdit( name, content );
return Api.edit( name, content );
} );
} );