selenium: Run tests from desktop site

Bug: T282058
Change-Id: I342a1ba510ea5da85da904c1bec4f26adfc60d33
This commit is contained in:
Željko Filipin 2021-05-07 17:34:58 +02:00 committed by Zfilipin
parent 482df741d6
commit 20bb2bf09c
4 changed files with 3 additions and 22 deletions

View file

@ -14,7 +14,7 @@
"doc": "jsdoc -c jsdoc.json && npm run build-storybook", "doc": "jsdoc -c jsdoc.json && npm run build-storybook",
"test:size": "node ./tests/resource-loader-bundlesize.js", "test:size": "node ./tests/resource-loader-bundlesize.js",
"selenium-test-cucumber": "wdio tests/selenium/wdio.conf.cucumber.js", "selenium-test-cucumber": "wdio tests/selenium/wdio.conf.cucumber.js",
"selenium-daily": "MW_SERVER=https://en.m.wikipedia.beta.wmflabs.org npm run selenium-test", "selenium-daily": "npm run selenium-test",
"selenium-test": "npm -s run test:size && wdio tests/selenium/wdio.conf.js" "selenium-test": "npm -s run test:size && wdio tests/selenium/wdio.conf.js"
}, },
"devDependencies": { "devDependencies": {

View file

@ -1,13 +0,0 @@
'use strict';
const Page = require( 'wdio-mediawiki/Page' );
class BlankPage extends Page {
get mobileView() { return $( '#footer-places-mobileview' ); }
open() {
super.openTitle( 'Special:BlankPage', { uselang: 'en' } );
}
}
module.exports = new BlankPage();

View file

@ -10,7 +10,7 @@ class EditPage extends Page {
get save() { return $( 'button.mw-ui-button' ); } get save() { return $( 'button.mw-ui-button' ); }
openForEditing( title ) { openForEditing( title ) {
super.openTitle( title, { action: 'edit' } ); super.openTitle( title, { action: 'edit', mobileaction: 'toggle_view_mobile' } );
} }
edit( name, content ) { edit( name, content ) {

View file

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