From 20bb2bf09ccd74a683b296092a8576ad02d8dfe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDeljko=20Filipin?= Date: Fri, 7 May 2021 17:34:58 +0200 Subject: [PATCH] selenium: Run tests from desktop site Bug: T282058 Change-Id: I342a1ba510ea5da85da904c1bec4f26adfc60d33 --- package.json | 2 +- tests/selenium/pageobjects/blank.page.js | 13 ------------- tests/selenium/pageobjects/edit.page.js | 2 +- tests/selenium/specs/page.js | 8 +------- 4 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 tests/selenium/pageobjects/blank.page.js diff --git a/package.json b/package.json index 224b882c0..7469a8118 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "doc": "jsdoc -c jsdoc.json && npm run build-storybook", "test:size": "node ./tests/resource-loader-bundlesize.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" }, "devDependencies": { diff --git a/tests/selenium/pageobjects/blank.page.js b/tests/selenium/pageobjects/blank.page.js deleted file mode 100644 index a85e8dbc4..000000000 --- a/tests/selenium/pageobjects/blank.page.js +++ /dev/null @@ -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(); diff --git a/tests/selenium/pageobjects/edit.page.js b/tests/selenium/pageobjects/edit.page.js index 5451db144..20e72085a 100644 --- a/tests/selenium/pageobjects/edit.page.js +++ b/tests/selenium/pageobjects/edit.page.js @@ -10,7 +10,7 @@ class EditPage extends Page { get save() { return $( 'button.mw-ui-button' ); } openForEditing( title ) { - super.openTitle( title, { action: 'edit' } ); + super.openTitle( title, { action: 'edit', mobileaction: 'toggle_view_mobile' } ); } edit( name, content ) { diff --git a/tests/selenium/specs/page.js b/tests/selenium/specs/page.js index 64bca0f62..6addbe629 100644 --- a/tests/selenium/specs/page.js +++ b/tests/selenium/specs/page.js @@ -1,7 +1,6 @@ 'use strict'; 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' ); @@ -15,13 +14,8 @@ describe( 'Page', 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(); + EditPage.edit( name, content ); browser.waitUntil(