Skip to content

Instantly share code, notes, and snippets.

@aniketchanana
Last active March 27, 2023 08:45
Show Gist options
  • Save aniketchanana/450ee523ef2796c7b736cf619941d506 to your computer and use it in GitHub Desktop.
Save aniketchanana/450ee523ef2796c7b736cf619941d506 to your computer and use it in GitHub Desktop.
describe('testing actions for todo application ', () => {
before(() => {
cy.visit('http://localhost:3000/');
})
it('test for typing todo in input box', () => {
const SAMPLE_TEXT = 'write article on medium.com';
// enters text in input box of app
cy.get('input[name=task]')
.focus()
.clear()
.type(SAMPLE_TEXT)
.blur()
// click on add todo button in app
cy.get('button')
.click();
// checking whether after adding todo it appears in DOM or not
cy.get('ul')
.contains('li', SAMPLE_TEXT)
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment