Created
June 18, 2018 10:21
-
-
Save paulbjensen/4001584211bedd4c31b35a578c99cdc9 to your computer and use it in GitHub Desktop.
Step definitions, for an article on Medium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment