Created
December 7, 2018 18:49
-
-
Save jessesanders/fbc341c26f124c0c4b010c5de5153a31 to your computer and use it in GitHub Desktop.
Simple cypress test example
This file contains hidden or 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
beforeEach(() => { | |
cy.visit('https://example.cypress.io/commands/actions') | |
}); | |
it('.within() - query DOM elements within a specific element', () => { | |
// https://on.cypress.io/within | |
cy.get('.query-form').within(() => { | |
cy.get('input:first').should('have.attr', 'placeholder', 'Email') | |
cy.get('input:last').should('have.attr', 'placeholder', 'Password') | |
}) | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment