Skip to content

Commit 327bdad

Browse files
author
Alvaro Vargas
committed
test
1 parent d403ef1 commit 327bdad

9 files changed

+21029
-310
lines changed

cypress/integration/home.test.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
describe("Home Page", () => {
2+
3+
beforeEach(() => {
4+
cy.fixture('courses.json').as("coursesJSON")
5+
6+
cy.server()
7+
8+
cy.route('/api/courses', '@coursesJSON').as("courses")
9+
10+
cy.visit('/')
11+
})
12+
13+
it('should display a list of courses', () => {
14+
15+
cy.contains("All Courses")
16+
17+
cy.wait('@courses')
18+
19+
cy.get("mat-card").should("have.length", 9)
20+
21+
})
22+
23+
it("should display the advanced courses", () => {
24+
25+
cy.get(".mat-tab-label").should("have.length", 2)
26+
27+
cy.get(".mat-tab-label").last().click()
28+
29+
cy.get(".mat-tab-body-active .mat-card-title").its('length').should('be.gt', 1)
30+
31+
cy.get(".mat-tab-body-active .mat-card-title").first().should('contain', "Angular Security Course")
32+
33+
})
34+
})

0 commit comments

Comments
 (0)