2018-04-10 21:19:08 +00:00
|
|
|
const { defineSupportCode } = require( 'cucumber' ),
|
|
|
|
{ iClickOnTheCategoryButton,
|
|
|
|
iShouldSeeTheCategoriesOverlay, iShouldSeeAListOfCategories
|
|
|
|
} = require( './category_steps' ),
|
2018-04-10 21:35:50 +00:00
|
|
|
{ iAmInAWikiThatHasCategories,
|
|
|
|
iAmOnAPageThatHasTheFollowingEdits } = require( './create_page_api_steps' ),
|
2018-04-10 21:19:08 +00:00
|
|
|
{
|
|
|
|
iAmUsingTheMobileSite,
|
|
|
|
iAmLoggedIntoTheMobileWebsite,
|
|
|
|
iAmOnPage, iAmInBetaMode
|
|
|
|
} = require( './common_steps' ),
|
|
|
|
{
|
2018-04-10 21:35:50 +00:00
|
|
|
iShouldSeeAddedContent, iShouldSeeRemovedContent
|
|
|
|
} = require( './diff_steps' ),
|
|
|
|
{
|
|
|
|
iOpenTheLatestDiff,
|
2018-04-10 21:19:08 +00:00
|
|
|
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' );
|
|
|
|
} );
|
2018-04-10 21:35:50 +00:00
|
|
|
Given( /^I am on a page that has the following edits:$/, iAmOnAPageThatHasTheFollowingEdits );
|
2018-04-10 21:19:08 +00:00
|
|
|
|
|
|
|
// history steps
|
2018-04-10 21:35:50 +00:00
|
|
|
When( /^I open the latest diff$/, iOpenTheLatestDiff );
|
2018-04-10 21:19:08 +00:00
|
|
|
When( /^I click on the history link in the last modified bar$/,
|
|
|
|
iClickOnTheHistoryLinkInTheLastModifiedBar );
|
|
|
|
|
2018-04-10 21:35:50 +00:00
|
|
|
// diff steps
|
|
|
|
Then( /^I should see "(.*?)" as added content$/, iShouldSeeAddedContent );
|
|
|
|
Then( /^I should see "(.*?)" as removed content$/, iShouldSeeRemovedContent );
|
|
|
|
|
2018-04-10 21:19:08 +00:00
|
|
|
// 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 );
|
|
|
|
} );
|