This is just a technology testing project based on Create React App and TailwindCSS
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

78 lines
2.5KB

  1. const { Given, When, Then } = require("@cucumber/cucumber")
  2. const {
  3. wait,
  4. clearStorages,
  5. visitPage,
  6. visitPageIncognito,
  7. shouldSeeText,
  8. shouldSeeTextAt,
  9. shouldNotSeeText,
  10. shouldNotSeeTextAt,
  11. clickLink,
  12. clickLinkAt,
  13. pressButton,
  14. pressButtonAt,
  15. modalOpened,
  16. modalClosed,
  17. buttonShouldBeDisabled,
  18. buttonShouldBeEnabled,
  19. buttonShouldBeDisabledAt,
  20. buttonShouldBeEnabledAt,
  21. fillInputField,
  22. setCheckboxField,
  23. unsetCheckboxField,
  24. fillInputFieldAt,
  25. setCheckboxFieldAt,
  26. unsetCheckboxFieldAt,
  27. chooseRadioOptionAt,
  28. setCheckboxGroupOptionAt,
  29. unsetCheckboxGroupOptionAt,
  30. jsonViewContains,
  31. jsonViewContainsAt,
  32. } = require('../support/actions');
  33. Given('clear browser storages', clearStorages);
  34. Then('wait for {string} seconds', { timeout: 60 * 1000 }, wait);
  35. Given('visit {string} page', visitPage);
  36. Given('visit {string} page incognito', visitPageIncognito);
  37. When('see {string}', shouldSeeText);
  38. When('not see {string}', shouldNotSeeText);
  39. When('see {string} at {string}', shouldSeeTextAt);
  40. When('not see {string} at {string}', shouldNotSeeTextAt);
  41. When('press {string} button', pressButton);
  42. When('press {string} button at {string}', pressButtonAt);
  43. When('click {string} link', clickLink);
  44. When('click {string} link at {string}', clickLinkAt);
  45. Then('modal of {string} dialog opened', modalOpened);
  46. Then('modal of {string} dialog closed', modalClosed);
  47. Then('button {string} is disabled', buttonShouldBeDisabled);
  48. Then('button {string} is enabled', buttonShouldBeEnabled);
  49. Then('button {string} at {string} is disabled', buttonShouldBeDisabledAt);
  50. Then('button {string} at {string} is enabled', buttonShouldBeEnabledAt);
  51. Given('enter {string} in {string} input', fillInputField);
  52. Given('enter {string} in {string} textarea at {string}', fillInputFieldAt);
  53. When('set {string} checkbox', setCheckboxField);
  54. When('unset {string} checkbox', unsetCheckboxField);
  55. When('enter {string} in {string} input at {string}', fillInputFieldAt);
  56. When('set {string} checkbox at {string}', setCheckboxFieldAt);
  57. When('unset {string} checkbox at {string}', unsetCheckboxFieldAt);
  58. Given('choose {string} in {string} radio group at {string}', chooseRadioOptionAt);
  59. Given('set {string} in {string} checkbox group at {string}', setCheckboxGroupOptionAt);
  60. Given('unset {string} in {string} checkbox group at {string}', unsetCheckboxGroupOptionAt);
  61. Then('jsonView field {string} contains {string}', jsonViewContains);
  62. Then('jsonView field {string} contains row {string} => {string}', jsonViewContainsAt);