- Issue created by @thejimbirch
Iff you need to check whether a route/url is accessible in Cypress here's how you can do it:
describe("Test path access", () => {
it("Anon user is not able to access route", () => {
cy.request({
url: '/example-url',
followRedirect: false,
failOnStatusCode: false
}).then((resp) => {
expect(resp.status).to.eq(403)
})
});
it("admin role can access page", () => {
cy.login('cypress', 'cypress')
cy.visit('/example-url')
});
});
Active
Documentation