mediawiki-skins-MinervaNeue/tests/selenium/features/step_definitions/menu_steps.js
jdlrobson 5263b09397 Standardize use of buttons and icons in Minerva
* Adds button hover/focus states to all Minerva button icons
* Removes the deprecated mw-ui-icon-before selector

Depends-On: I4eb28eae4c4e23d58f1f85bc41c0caf77197d8a1
Bug: T288678
Change-Id: I490534f9f704a733191b459c8ee071848c436001
2021-09-17 15:36:54 +00:00

38 lines
1.1 KiB
JavaScript

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