Guest User

Untitled

a guest
Jun 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. // Dependencies
  2. const { Given, When, Then } = require('cucumber');
  3. const {
  4. visitHomepage,
  5. assertUserHasPassword,
  6. assertUserHasEmail,
  7. userExists,
  8. closeAccount,
  9. pending,
  10. clickOnItem,
  11. takenToPage,
  12. fillInFormField,
  13. pressButton,
  14. shouldBeOnPage,
  15. acceptTerms,
  16. shouldSeeText,
  17. shouldNotSeeText,
  18. checkEmailInbox,
  19. checkEmailSubject,
  20. clickOnLinkInEmail,
  21. onPageForUser,
  22. hoverOverItem,
  23. checkCookiesAreCleared,
  24. reloadPage,
  25. wait
  26. } = require('../support/actions');
  27.  
  28. Given('I am on the homepage', visitHomepage);
  29.  
  30. Given('I click on {string}', clickOnItem);
  31.  
  32. When('I am taken to the {string} page', takenToPage);
  33.  
  34. When('I fill in {string} with {string}', fillInFormField);
  35.  
  36. When('I accept the terms', acceptTerms);
  37.  
  38. Given('the user {string} then closes their account', closeAccount);
  39.  
  40. When('I press {string}', pressButton);
  41.  
  42. Then('I should be on the {string} page', shouldBeOnPage);
  43.  
  44. Given('pending', pending);
  45.  
  46. Given('a valid user {string} already exists', userExists);
  47.  
  48. Then('I should see {string}', shouldSeeText);
  49.  
  50. Then('I should not see {string}', shouldNotSeeText);
  51.  
  52. When('I check my email inbox', checkEmailInbox);
  53.  
  54. Then('I should see an email saying {string}', checkEmailSubject);
  55.  
  56. When('I click on the link inside the email', clickOnLinkInEmail);
  57.  
  58. Then('I am on the {string} page for user {string}', onPageForUser);
  59.  
  60. When('I hover over {string}', hoverOverItem);
  61.  
  62. Then('user {string} should have the email {string}', assertUserHasEmail);
  63.  
  64. Then(
  65. 'user {string} should have the password {string}',
  66. assertUserHasPassword
  67. );
  68.  
  69. Then(
  70. 'my token and session cookies should be cleared',
  71. checkCookiesAreCleared
  72. );
  73.  
  74. Then('I reload the page', reloadPage);
  75.  
  76. Then('I wait for {int} seconds', { timeout: 60 * 1000 }, wait);
Add Comment
Please, Sign In to add comment