Skip to content

Instantly share code, notes, and snippets.

@batmi02
Created October 8, 2019 20:46
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 batmi02/1562596e4e7e45b77957a9881413e1b7 to your computer and use it in GitHub Desktop.
Save batmi02/1562596e4e7e45b77957a9881413e1b7 to your computer and use it in GitHub Desktop.
// <reference types="cypress" />
describe('todo actions', () => {
beforeEach(() => {
cy.visit('http://todomvc-app-for-testing.surge.sh/')
cy.get('.new-todo', {timeout: 6000}).type('Clean room{enter}')
})
it('should add a new todo to the list', () => {
cy.get('label').should('have.text', 'Clean room')
cy.get('.toggle').should('not.be.checked')
})
describe('toggling todos', () => {
it('should toggle test correctly', () => {
cy.get('.toggle').click()
cy.get('label').should('have.css', 'text-decoration-line', 'line-through')
})
it('should clear completed', () => {
cy.get('.toggle').click()
cy.contains('Clear completed').click()
cy.get('.todo-list').should('not.have.descendants', 'li')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment