2018-04-10 21:19:08 +00:00
|
|
|
const assert = require( 'assert' ),
|
|
|
|
{ ArticlePage, UserLoginPage } = require( '../support/world' );
|
|
|
|
|
|
|
|
const iAmUsingTheMobileSite = () => {
|
|
|
|
ArticlePage.setMobileMode();
|
|
|
|
};
|
|
|
|
|
|
|
|
const iAmInBetaMode = () => {
|
2019-04-10 15:55:09 +00:00
|
|
|
// 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
|
2018-04-10 21:19:08 +00:00
|
|
|
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
|
|
|
|
};
|