Skip to content

Commit 2717d7e

Browse files
committed
complete e2e
1 parent 26ca12c commit 2717d7e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

cypress/integration/home.test.js

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

0 commit comments

Comments
 (0)