mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-17 11:13:34 +00:00
26e413e04d
Porting first selenium test from Ruby to Node.js using the mocha framework. Starting with `category.feature` test. Tests are placed in a new `tests/selenium` folder with their own eslint config. Bug: T190710 Change-Id: Iad954405a5ae0608fd5dc90dd5dfa434b3781037
42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
const { defineSupportCode } = require( 'cucumber' ),
|
|
{ iClickOnTheCategoryButton,
|
|
iShouldSeeTheCategoriesOverlay, iShouldSeeAListOfCategories
|
|
} = require( './category_steps' ),
|
|
{ iAmInAWikiThatHasCategories } = require( './create_page_api_steps' ),
|
|
{
|
|
iAmUsingTheMobileSite,
|
|
iAmLoggedIntoTheMobileWebsite,
|
|
iAmOnPage, iAmInBetaMode
|
|
} = require( './common_steps' ),
|
|
{
|
|
iClickOnTheHistoryLinkInTheLastModifiedBar
|
|
} = require( './history_steps' );
|
|
|
|
defineSupportCode( function ( { Then, When, Given } ) {
|
|
|
|
// common steps
|
|
Given( /^I am using the mobile site$/, iAmUsingTheMobileSite );
|
|
|
|
Given( /^I am in beta mode$/, iAmInBetaMode );
|
|
|
|
Given( /^I am on the "(.+)" page$/, iAmOnPage );
|
|
|
|
Given( /^I am logged into the mobile website$/, iAmLoggedIntoTheMobileWebsite );
|
|
|
|
// Page steps
|
|
Given( /^I am in a wiki that has categories$/, () => {
|
|
iAmInAWikiThatHasCategories( 'Selenium categories test page' );
|
|
} );
|
|
|
|
// history steps
|
|
When( /^I click on the history link in the last modified bar$/,
|
|
iClickOnTheHistoryLinkInTheLastModifiedBar );
|
|
|
|
// Category steps
|
|
When( /^I click on the category button$/, iClickOnTheCategoryButton );
|
|
|
|
Then( /^I should see the categories overlay$/, iShouldSeeTheCategoriesOverlay );
|
|
|
|
Then( /^I should see a list of categories$/, iShouldSeeAListOfCategories );
|
|
} );
|