2020-06-02 21:21:44 +00:00
|
|
|
'use strict';
|
|
|
|
|
2019-04-08 23:45:11 +00:00
|
|
|
const assert = require( 'assert' );
|
|
|
|
const { ArticlePage } = require( '../support/world.js' );
|
|
|
|
|
|
|
|
const iSeeALinkToAboutPage = () => {
|
2020-06-15 14:54:05 +00:00
|
|
|
assert.strictEqual( ArticlePage.menu_element.$( '*=About' ).isDisplayed(), true );
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const iClickOnTheMainNavigationButton = () => {
|
2022-02-03 20:18:02 +00:00
|
|
|
ArticlePage.menu_button_element.waitForDisplayed();
|
2019-04-08 23:45:11 +00:00
|
|
|
ArticlePage.menu_button_element.click();
|
|
|
|
};
|
|
|
|
|
|
|
|
const iShouldSeeAUserPageLinkInMenu = () => {
|
2021-11-03 17:09:33 +00:00
|
|
|
ArticlePage.menu_element.$( '.menu__item--user' );
|
2019-08-30 17:23:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const iShouldSeeLogoutLinkInMenu = () => {
|
2021-11-03 17:09:33 +00:00
|
|
|
ArticlePage.menu_element.$( '.menu__item--logout' );
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const iShouldSeeALinkInMenu = ( text ) => {
|
2020-06-15 14:54:05 +00:00
|
|
|
assert.strictEqual( ArticlePage.menu_element.$( `span=${text}` ).isDisplayed(),
|
2019-04-08 23:45:11 +00:00
|
|
|
true, `Link to ${text} is visible.` );
|
|
|
|
};
|
|
|
|
|
|
|
|
const iShouldSeeALinkToDisclaimer = () => {
|
2021-09-09 15:56:42 +00:00
|
|
|
ArticlePage.menu_element.$( 'span=Disclaimers' ).waitForDisplayed();
|
|
|
|
assert.strictEqual( ArticlePage.menu_element.$( 'span=Disclaimers' ).isDisplayed(), true );
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
iClickOnTheMainNavigationButton,
|
|
|
|
iSeeALinkToAboutPage, iShouldSeeAUserPageLinkInMenu,
|
2019-08-30 17:23:55 +00:00
|
|
|
iShouldSeeLogoutLinkInMenu,
|
2019-04-08 23:45:11 +00:00
|
|
|
iShouldSeeALinkInMenu, iShouldSeeALinkToDisclaimer
|
|
|
|
};
|