Skip to content

Instantly share code, notes, and snippets.

@dannyshain
Last active May 25, 2021 21:03
Show Gist options
  • Save dannyshain/937618cf7b2a2ce09b163c6616e1ba7f to your computer and use it in GitHub Desktop.
Save dannyshain/937618cf7b2a2ce09b163c6616e1ba7f to your computer and use it in GitHub Desktop.
it('should trigger an alert with a message', () => {
cy.get('#alert-button').click();
cy.on('window:alert', (text) => {
expect(text).to.contains('This is an alert!');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment