Created
October 8, 2019 20:46
-
-
Save batmi02/1562596e4e7e45b77957a9881413e1b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <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