Skip to content

Instantly share code, notes, and snippets.

@LeonardoFassini
Created September 22, 2020 14:38
Show Gist options
  • Save LeonardoFassini/f34195e1fcbc58f367633d10bc8a7641 to your computer and use it in GitHub Desktop.
Save LeonardoFassini/f34195e1fcbc58f367633d10bc8a7641 to your computer and use it in GitHub Desktop.
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
Given('I am at the login page', () => {
cy.visit('/');
});
When('I type the correct username', () => {
cy.get('[data-test=loginInput]').type('admin');
});
When('I type the correct password', () => {
cy.get('[data-test=passwordInput]').type('timmy');
});
When('I click to log in', () => {
cy.get('[data-test=submitButton]').click();
});
Then('I should be on the todo page', () => {
cy.url().should('eq', Cypress.env('baseUrl') + '/todo');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment