mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-17 11:13:34 +00:00
1903d1adae
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
37 lines
943 B
JavaScript
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
|
|
};
|