Created
December 7, 2018 19:08
-
-
Save jessesanders/bb791377270d84a1424324ceb47c87df to your computer and use it in GitHub Desktop.
Simple Cypress tests to check Angular CLI generated base page
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("The Home Page", function() { | |
beforeEach(() => { | |
cy.visit("/"); | |
}); | |
it("h2 should have proper text", () => { | |
// https://on.cypress.io/within | |
cy.get("h2:first").should( | |
"have.text", | |
"Here are some links to help you start: " | |
); | |
}); | |
it("links should have proper text", () => { | |
// https://on.cypress.io/within | |
cy.get("ul").within(() => { | |
cy.get("h2 a:first").should( | |
"have.attr", | |
"href", | |
"https://angular.io/tutorial" | |
); | |
cy.get("h2 a:last").should( | |
"have.attr", | |
"href", | |
"https://blog.angular.io/" | |
); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment