-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
38 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { LoginPage } from '@support/pages/login.page' | ||
|
||
describe('Login links', () => { | ||
// 🚨 INCORRECT | ||
// can you explain why the following test fails? | ||
// Tip: the first click works, but the second fails | ||
it('all lead back to the login page', () => { | ||
cy.visit('/') | ||
cy.get('a').click({ multiple: true }) | ||
LoginPage.showsError('Epic sadface') | ||
cy.location('pathname').should('equal', '/') | ||
}) | ||
|
||
it('all lead back to the login page (fixed)', () => { | ||
cy.visit('/') | ||
// get text for each link | ||
// iterate over text for each "a" element | ||
// find the link again using cy.contains command | ||
// and click on it | ||
// confirm the page shows an error | ||
// and the page loads the "/" again | ||
}) | ||
}) |
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
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