mediawiki-skins-MinervaNeue/tests/selenium/features/step_definitions/common_steps.js
jdlrobson 1903d1adae Beta mode cookie must be set on mobile domain
On the Selenium daily job, there are 2 domains -
https://en.wikipedia.beta.wmflabs.org
and
https://en.m.wikipedia.beta.wmflabs.org

Currently the cookie gets set on the former, meaning it doesn't work
This should take care of this, while also accounting for running the
browser tests (as we do in the zuul runs) in a single domain

Bug: T219920
Change-Id: I54838fb8aba559c4d72c444968493dff2de9b4f9
2019-04-10 16:34:01 +00:00

37 lines
943 B
JavaScript

const assert = require( 'assert' ),
{ ArticlePage, UserLoginPage } = require( '../support/world' );
const iAmUsingTheMobileSite = () => {
ArticlePage.setMobileMode();
};
const iAmInBetaMode = () => {
// running beta mode requires being on the mobile domain
iAmUsingTheMobileSite();
// and making sure the browser URL is set to the mobile domain by triggering a page load
ArticlePage.open( 'Page on the mobile domain' );
// Cookie will now set on mobile domain
ArticlePage.setBetaMode();
};
const iAmOnPage = ( article ) => {
ArticlePage.open( article );
};
const iAmLoggedIn = () => {
UserLoginPage.open();
UserLoginPage.loginAdmin();
assert.strictEqual( ArticlePage.is_authenticated_element.isExisting(), true );
};
const iAmLoggedIntoTheMobileWebsite = () => {
iAmUsingTheMobileSite();
iAmLoggedIn();
};
module.exports = {
iAmLoggedIntoTheMobileWebsite,
iAmUsingTheMobileSite,
iAmLoggedIn, iAmOnPage, iAmInBetaMode
};