-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
cb3f738
commit 9b5bb20
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
...E.FindInformationAcademiesTrusts.CypressTests/cypress/e2e/regression/no-access-page.cy.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,55 @@ | ||
import navigation from "../../pages/navigation"; | ||
|
||
describe("Testing the components of the no access page", () => { | ||
|
||
describe("As an unauthorised user", () => { | ||
|
||
beforeEach(() => { | ||
cy.login({ | ||
name: "Unauthorised User - name", | ||
email: "Unauthorised User - email", | ||
roles: [] | ||
}); | ||
}); | ||
|
||
['/', '/search', '/notfound', '/trusts/details?uid=5712', '/trusts/contacts?uid=5143', '/trusts/governance?5527'].forEach((url) => { | ||
it(`Should redirect to no access page when accessing ${url}`, () => { | ||
cy.visit(url); | ||
|
||
navigation | ||
.checkCurrentURLIsCorrect('no-access'); | ||
|
||
//todo: this test might get upset if the application redirects to microsoft login | ||
// ideally we want to check that it tries to go to MS login and then redirects to no access page | ||
// with the correct return url! | ||
//This may not be possible though | ||
}); | ||
}); | ||
|
||
['/cookies', '/accessibility', '/privacy'].forEach((url) => { | ||
it(`Should be able to go to ${url}`, () => { | ||
cy.visit(url); | ||
|
||
navigation | ||
.checkCurrentURLIsCorrect(url); | ||
}); | ||
}); | ||
}); | ||
|
||
describe("As an authorised user", () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
}); | ||
|
||
['/', '/search', '/notfound', '/trusts/details?uid=5712', '/trusts/contacts?uid=5143', '/trusts/governance?5527', '/cookies', '/accessibility', '/privacy'].forEach((url) => { | ||
it(`Should be able to go to ${url}`, () => { | ||
cy.visit(url); | ||
|
||
navigation | ||
.checkCurrentURLIsCorrect(url); | ||
}); | ||
}); | ||
}); | ||
|
||
//Todo: Other tests - when not authenticated - no breadcrumb or search box or feedback footer section | ||
}); |
Empty file.