SHARE
TWEET

Untitled

a guest Feb 17th, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
  2.  
  3. const baseURL = 'http://localhost:3000/#';
  4.  
  5. Given('I visit {string}', page => {
  6.   cy.visit(`${baseURL}${page}`);
  7. });
  8.  
  9. When('I fill the {string} with {string}', (input, email) => {
  10.   cy.get(`#txt-${input}`).type(email);
  11. });
  12.  
  13. When('I choose the {string} {string}', (input, gender) => {
  14.   cy.get(`#ddl-${input}`).click();
  15.   cy.get(`#lst-${gender}`).click();
  16. });
  17.  
  18. When('I click {string}', button => {
  19.   cy.get(`#btn-${button}`).click();
  20. });
  21.  
  22. Then('I should be in {string}', word => {
  23.   cy.wait(3000);
  24.   cy.url().should('eq', `${baseURL}${word}`);
  25. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top