mediawiki-skins-MinervaNeue/tests/selenium/features/step_definitions/menu_steps.js
Ed Sanders 8ef144f936 build: Update linters
Change-Id: I5aa3ab891890b52057a5fc855315e5b1b2203037
2024-01-24 22:02:12 +00:00

39 lines
1.2 KiB
JavaScript

'use strict';
const assert = require( 'assert' );
const { ArticlePage } = require( '../support/world.js' );
const iSeeALinkToAboutPage = async () => {
assert.strictEqual( await ArticlePage.menu_element.$( '*=About' ).isDisplayed(), true );
};
const iClickOnTheMainNavigationButton = async () => {
await ArticlePage.menu_button_element.waitForDisplayed();
await ArticlePage.menu_button_element.click();
};
const iShouldSeeAUserPageLinkInMenu = async () => {
await ArticlePage.menu_element.$( '.menu__item--user' );
};
const iShouldSeeLogoutLinkInMenu = async () => {
await ArticlePage.menu_element.$( '.menu__item--logout' );
};
const iShouldSeeALinkInMenu = async ( text ) => {
assert.strictEqual( await ArticlePage.menu_element.$( `span=${ text }` ).isDisplayed(),
true, `Link to ${ text } is visible.` );
};
const iShouldSeeALinkToDisclaimer = async () => {
await ArticlePage.menu_element.$( 'span=Disclaimers' ).waitForDisplayed();
assert.strictEqual( await ArticlePage.menu_element.$( 'span=Disclaimers' ).isDisplayed(), true );
};
module.exports = {
iClickOnTheMainNavigationButton,
iSeeALinkToAboutPage, iShouldSeeAUserPageLinkInMenu,
iShouldSeeLogoutLinkInMenu,
iShouldSeeALinkInMenu, iShouldSeeALinkToDisclaimer
};