mediawiki-skins-MinervaNeue/tests/selenium/features/step_definitions/index.js
Jan Drewniak 26e413e04d Adding initial webdriver.io test
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
2019-04-08 16:05:22 -07:00

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 );
} );