Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Dependencies
- const { Given, When, Then } = require('cucumber');
- const {
- visitHomepage,
- assertUserHasPassword,
- assertUserHasEmail,
- userExists,
- closeAccount,
- pending,
- clickOnItem,
- takenToPage,
- fillInFormField,
- pressButton,
- shouldBeOnPage,
- acceptTerms,
- shouldSeeText,
- shouldNotSeeText,
- checkEmailInbox,
- checkEmailSubject,
- clickOnLinkInEmail,
- onPageForUser,
- hoverOverItem,
- checkCookiesAreCleared,
- reloadPage,
- wait
- } = require('../support/actions');
- Given('I am on the homepage', visitHomepage);
- Given('I click on {string}', clickOnItem);
- When('I am taken to the {string} page', takenToPage);
- When('I fill in {string} with {string}', fillInFormField);
- When('I accept the terms', acceptTerms);
- Given('the user {string} then closes their account', closeAccount);
- When('I press {string}', pressButton);
- Then('I should be on the {string} page', shouldBeOnPage);
- Given('pending', pending);
- Given('a valid user {string} already exists', userExists);
- Then('I should see {string}', shouldSeeText);
- Then('I should not see {string}', shouldNotSeeText);
- When('I check my email inbox', checkEmailInbox);
- Then('I should see an email saying {string}', checkEmailSubject);
- When('I click on the link inside the email', clickOnLinkInEmail);
- Then('I am on the {string} page for user {string}', onPageForUser);
- When('I hover over {string}', hoverOverItem);
- Then('user {string} should have the email {string}', assertUserHasEmail);
- Then(
- 'user {string} should have the password {string}',
- assertUserHasPassword
- );
- Then(
- 'my token and session cookies should be cleared',
- checkCookiesAreCleared
- );
- Then('I reload the page', reloadPage);
- Then('I wait for {int} seconds', { timeout: 60 * 1000 }, wait);
Add Comment
Please, Sign In to add comment