mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-24 00:05:50 +00:00
Use wdio-mediawiki in selenium tests
Change-Id: If48e0a885acdf4bca73ec2a9d613fe2f0403dd61
This commit is contained in:
parent
eacbd18d3a
commit
993c4e227e
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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' );
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
} );
|
||||
} );
|
||||
|
||||
|
|
Loading…
Reference in a new issue