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
<label> | |
Search | |
<input type="search" value="bear" aria-busy aria-describedby="search-progress" /> | |
</label> | |
<div role="progressbar" class="spinner" aria-label="Searching for bear" /> | |
<ul aria-label="Search Results" aria-busy aria-describedby="search-progress"> | |
<li>Elephant</li> | |
</ul> |
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
cy.getInput('Add File').attach('elephant.pdf'); | |
cy.getInput('Add File') | |
.alerts() | |
.should('include', 'PDF files are not supported'); | |
cy.getList('File List') | |
.getListItem('elephant.pdf') | |
.alerts() | |
.should('include', 'PDF files are not supported'); |
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
<label> | |
Add File | |
<input type="file" | |
accepts="image/*" | |
aria-invalid | |
aria-describedby="file-input-help file-2-error" | |
aria-errormessage="file-2-error" | |
/> | |
</label> | |
<span id="file-input-help">Please add 1 or more image files</span> |
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
cy.getForm('Login').within(() => { | |
cy.getInput('Username').type('john.doe'); | |
cy.getInput('Password').type('secret'); | |
cy.getButton('Submit').press(); | |
}) |
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
cy.getForm('Add To-Do Item').within(() => { | |
cy.getInput('To-Do Item').type('Buy Milk'); | |
cy.getButton('Add').press(); | |
}) | |
cy.getList('To-Do List').within(() => { | |
cy.getListItem('Buy Milk').should('exist'); | |
cy.getInput('Buy Milk').check(); | |
}); |
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
<div id="list-id">To-Do List</div> | |
<ul aria-labelledby="list-id"> | |
<li aria-labelledby="item-1"> | |
<label> | |
<input type="checkbox" /> | |
<span id="item-1">Do Laundry</span> | |
</label> | |
</li> | |
<li aria-labelledby="item-2"> | |
<label> |
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
<form> | |
<label>Username<input /></label> | |
<label>Password<input/ ></label> | |
<button type="submit">Submit</button> | |
</form> |
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
* I see a "Login" form | |
* I enter "john.doe" in "Username" input | |
* I enter "secret" in "Password" input | |
* I press "Submit" button |
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
cy.getForm('Login'); | |
cy.getInput('Username').type('john.doe'); | |
cy.getInput('Password').type('secret'); | |
cy.getButton('Submit').press(); |
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
cy.findByRole('form', { name: 'Login' }).as('landmark'); | |
cy.get('@landmark').findByLabelText('Username').type('johh.doe'); | |
cy.get('@landmark').findByLabelTest('Password').type('secret'); | |
cy.get('@landmark').findByRole('button', { name: 'Submit' }).click(); |