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' );
|
|
|
|
|
2023-04-06 22:25:40 +00:00
|
|
|
const iSeeALinkToAboutPage = async () => {
|
|
|
|
assert.strictEqual( await ArticlePage.menu_element.$( '*=About' ).isDisplayed(), true );
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
2023-04-06 22:25:40 +00:00
|
|
|
const iClickOnTheMainNavigationButton = async () => {
|
|
|
|
await ArticlePage.menu_button_element.waitForDisplayed();
|
|
|
|
await ArticlePage.menu_button_element.click();
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
2023-04-06 22:25:40 +00:00
|
|
|
const iShouldSeeAUserPageLinkInMenu = async () => {
|
|
|
|
await ArticlePage.menu_element.$( '.menu__item--user' );
|
2019-08-30 17:23:55 +00:00
|
|
|
};
|
|
|
|
|
2023-04-06 22:25:40 +00:00
|
|
|
const iShouldSeeLogoutLinkInMenu = async () => {
|
|
|
|
await ArticlePage.menu_element.$( '.menu__item--logout' );
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
2023-04-06 22:25:40 +00:00
|
|
|
const iShouldSeeALinkInMenu = async ( text ) => {
|
2024-01-24 22:02:12 +00:00
|
|
|
assert.strictEqual( await ArticlePage.menu_element.$( `span=${ text }` ).isDisplayed(),
|
|
|
|
true, `Link to ${ text } is visible.` );
|
2019-04-08 23:45:11 +00:00
|
|
|
};
|
|
|
|
|
2023-04-06 22:25:40 +00:00
|
|
|
const iShouldSeeALinkToDisclaimer = async () => {
|
|
|
|
await ArticlePage.menu_element.$( 'span=Disclaimers' ).waitForDisplayed();
|
|
|
|
assert.strictEqual( await 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
|
|
|
|
};
|