Last active
June 2, 2022 23:56
-
-
Save bobbyg603/e66206a1287277f80ef2f6b314e9772c to your computer and use it in GitHub Desktop.
3 and 1/2 Reasons Your Tests Should Be Stateless
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
describe('Users Table', () => { | |
const user1 = 'bobby@bugsplat.com'; | |
const user2 = 'bobbyg603@pm.me'; | |
beforeEach(() => { | |
cy.visit('/users'); | |
}); | |
it('should add a user to the table', () => { | |
cy.addUser(user1); | |
cy.get('[data-cy=users-table]').should('contain.text', user1); | |
}); | |
it('should display filtered table containing user1 and not user2', () => { | |
cy.addUser(user2); | |
cy.filterByUser(user1); | |
cy.get('[data-cy=users-table]') | |
.should('contain.text', user1) | |
.should('not.contain.text', user2); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment