Skip to content

Instantly share code, notes, and snippets.

@giltayar
Last active October 11, 2018 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giltayar/846ba1bc906285b22f042ece7595dcbe to your computer and use it in GitHub Desktop.
Save giltayar/846ba1bc906285b22f042ece7595dcbe to your computer and use it in GitHub Desktop.
describe(`TodoMVC using Cypress`, function () {
it('can add todos and then delete them', () => {
// visit the todomvc application
cy.visit('http://todomvc.com/examples/react/#/')
// type a new todo into the "new todo" input field.
cy.get('.new-todo').type('Cook dinner{enter}')
// ensure that a new todo was created correctly
cy.get('.view > label').should('have.text', 'Cook dinner')
// Add another todo and asser that it was added to.
cy.get('.new-todo').type('Clean house{enter}').then(() => {debugger})
cy.get('.view > label').eq(1).should('have.text', 'Clean house')
// now check the toggle, to make it "done".
cy.get('.toggle').eq(1).click()
cy.contains('1 item left').should('exist')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment