-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VKT(Frontend): PublicHomePage Cypress tests
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
frontend/packages/vkt/src/tests/cypress/integration/public_home_page.spec.ts
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,18 @@ | ||
import { AppRoutes } from 'enums/app'; | ||
import { onPublicHomePage } from 'tests/cypress/support/page-objects/publicHomePage'; | ||
|
||
describe('PublicHomePage', () => { | ||
beforeEach(() => { | ||
cy.openPublicHomePage(); | ||
}); | ||
|
||
it('should link to excellent level exams', () => { | ||
onPublicHomePage.continueToExcellentLevelExams(); | ||
cy.url().should('include', AppRoutes.PublicExcellentLevelLanding); | ||
}); | ||
|
||
it('should link to good and satisfactory level exams', () => { | ||
onPublicHomePage.continueToGoodAndSatisfactoryLevelExams(); | ||
cy.url().should('include', AppRoutes.PublicGoodAndSatisfactoryLevelLanding); | ||
}); | ||
}); |
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
21 changes: 20 additions & 1 deletion
21
frontend/packages/vkt/src/tests/cypress/support/page-objects/publicHomePage.ts
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 |
---|---|---|
@@ -1,5 +1,24 @@ | ||
class PublicHomePage { | ||
elements = { | ||
toExcellentLevelExams: () => | ||
cy.findByRole('button', { | ||
name: 'Ilmoittaudu erinomaisen taidon tutkintoon', | ||
}), | ||
toGoodAndSatisfactoryLevelExam: () => | ||
cy.findByRole('button', { | ||
name: 'Ota yhteyttä tutkinnon vastaanottajiin', | ||
}), | ||
}; | ||
|
||
continueToExcellentLevelExams() { | ||
this.elements.toExcellentLevelExams().scrollIntoView(); | ||
this.elements.toExcellentLevelExams().click(); | ||
} | ||
|
||
continueToGoodAndSatisfactoryLevelExams() { | ||
this.elements.toGoodAndSatisfactoryLevelExam().scrollIntoView(); | ||
this.elements.toGoodAndSatisfactoryLevelExam().click(); | ||
} | ||
} | ||
|
||
export const onPublicHomePage = new PublicHomePage(); | ||
export const onPublicHomePage = new PublicHomePage(); |