update for cypress 12
parent
1e9161032a
commit
a1348fedbc
|
|
@ -1,15 +1,13 @@
|
|||
import { testAdmin } from "../../../test/_globals.js";
|
||||
import { logout, login, ajaxDelayMillis } from "../../support/index.js";
|
||||
describe("Admin - Cleanup Database", () => {
|
||||
before(() => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
});
|
||||
after(logout);
|
||||
beforeEach("Loads page", () => {
|
||||
cy.visit("/admin/cleanup");
|
||||
cy.location("pathname").should("equal", "/admin/cleanup");
|
||||
});
|
||||
afterEach(logout);
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
|
|
|
|||
|
|
@ -5,18 +5,16 @@ import { testAdmin } from "../../../test/_globals.js";
|
|||
import { logout, login, ajaxDelayMillis } from "../../support/index.js";
|
||||
|
||||
describe("Admin - Cleanup Database", () => {
|
||||
before(() => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
});
|
||||
|
||||
after(logout);
|
||||
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
cy.visit("/admin/cleanup");
|
||||
cy.location("pathname").should("equal", "/admin/cleanup");
|
||||
});
|
||||
|
||||
afterEach(logout);
|
||||
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
import { testAdmin } from "../../../test/_globals.js";
|
||||
import { logout, login } from "../../support/index.js";
|
||||
describe("Admin - Config Table Management", () => {
|
||||
before(() => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
});
|
||||
after(logout);
|
||||
beforeEach("Loads page", () => {
|
||||
cy.visit("/admin/tables");
|
||||
cy.location("pathname").should("equal", "/admin/tables");
|
||||
});
|
||||
afterEach(logout);
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.get(".tabs a").each(($tab) => {
|
||||
cy.wrap($tab).click({ force: true });
|
||||
|
|
|
|||
|
|
@ -5,18 +5,16 @@ import { testAdmin } from "../../../test/_globals.js";
|
|||
import { logout, login } from "../../support/index.js";
|
||||
|
||||
describe("Admin - Config Table Management", () => {
|
||||
before(() => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
});
|
||||
|
||||
after(logout);
|
||||
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
cy.visit("/admin/tables");
|
||||
cy.location("pathname").should("equal", "/admin/tables");
|
||||
});
|
||||
|
||||
afterEach(logout);
|
||||
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.get(".tabs a").each(($tab) => {
|
||||
cy.wrap($tab).click({ force: true });
|
||||
|
|
|
|||
|
|
@ -2,15 +2,13 @@ import { testAdmin } from "../../../test/_globals.js";
|
|||
import { logout, login, ajaxDelayMillis } from "../../support/index.js";
|
||||
import * as configFunctions from "../../../helpers/functions.config.js";
|
||||
describe("Admin - Fee Management", () => {
|
||||
before(() => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
});
|
||||
after(logout);
|
||||
beforeEach("Loads page", () => {
|
||||
cy.visit("/admin/fees");
|
||||
cy.location("pathname").should("equal", "/admin/fees");
|
||||
});
|
||||
afterEach(logout);
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
|
|
|
|||
|
|
@ -9,18 +9,16 @@ import * as configFunctions from "../../../helpers/functions.config.js";
|
|||
import type * as recordTypes from "../../../types/recordTypes";
|
||||
|
||||
describe("Admin - Fee Management", () => {
|
||||
before(() => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
});
|
||||
|
||||
after(logout);
|
||||
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
cy.visit("/admin/fees");
|
||||
cy.location("pathname").should("equal", "/admin/fees");
|
||||
});
|
||||
|
||||
afterEach(logout);
|
||||
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
import { testAdmin } from "../../../test/_globals.js";
|
||||
import { logout, login } from "../../support/index.js";
|
||||
describe("Admin - Lot Type Management", () => {
|
||||
before(() => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
});
|
||||
after(logout);
|
||||
beforeEach("Loads page", () => {
|
||||
cy.visit("/admin/lotTypes");
|
||||
cy.location("pathname").should("equal", "/admin/lotTypes");
|
||||
});
|
||||
afterEach(logout);
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
|
|
|
|||
|
|
@ -5,18 +5,16 @@ import { testAdmin } from "../../../test/_globals.js";
|
|||
import { logout, login } from "../../support/index.js";
|
||||
|
||||
describe("Admin - Lot Type Management", () => {
|
||||
before(() => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
});
|
||||
|
||||
after(logout);
|
||||
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
cy.visit("/admin/lotTypes");
|
||||
cy.location("pathname").should("equal", "/admin/lotTypes");
|
||||
});
|
||||
|
||||
afterEach(logout);
|
||||
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
import { testAdmin } from "../../../test/_globals.js";
|
||||
import { logout, login } from "../../support/index.js";
|
||||
describe("Admin - Occupancy Type Management", () => {
|
||||
before(() => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
});
|
||||
after(logout);
|
||||
beforeEach("Loads page", () => {
|
||||
cy.visit("/admin/occupancyTypes");
|
||||
cy.location("pathname").should("equal", "/admin/occupancyTypes");
|
||||
});
|
||||
afterEach(logout);
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
|
|
|
|||
|
|
@ -5,18 +5,16 @@ import { testAdmin } from "../../../test/_globals.js";
|
|||
import { logout, login } from "../../support/index.js";
|
||||
|
||||
describe("Admin - Occupancy Type Management", () => {
|
||||
before(() => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
});
|
||||
|
||||
after(logout);
|
||||
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testAdmin);
|
||||
cy.visit("/admin/occupancyTypes");
|
||||
cy.location("pathname").should("equal", "/admin/occupancyTypes");
|
||||
});
|
||||
|
||||
afterEach(logout);
|
||||
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
import { testUpdate } from "../../../test/_globals.js";
|
||||
import { logout, login } from "../../support/index.js";
|
||||
describe("Update - Lot Occupancies", () => {
|
||||
before(() => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testUpdate);
|
||||
});
|
||||
afterEach(logout);
|
||||
it('Has a "Create" link on the Lot Occupancy Search', () => {
|
||||
cy.visit("/lotOccupancies");
|
||||
cy.location("pathname").should("equal", "/lotOccupancies");
|
||||
cy.get("a[href$='/lotOccupancies/new']").should("exist");
|
||||
});
|
||||
describe("Update a New Lot Occupancy", () => {
|
||||
before(() => {
|
||||
cy.visit("/lotOccupancies/new");
|
||||
});
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.visit("/lotOccupancies/new");
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,22 +3,24 @@ import { testUpdate } from "../../../test/_globals.js";
|
|||
import { logout, login } from "../../support/index.js";
|
||||
|
||||
describe("Update - Lot Occupancies", () => {
|
||||
before(() => {
|
||||
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testUpdate);
|
||||
});
|
||||
|
||||
afterEach(logout);
|
||||
|
||||
it('Has a "Create" link on the Lot Occupancy Search', () => {
|
||||
cy.visit("/lotOccupancies");
|
||||
cy.location("pathname").should("equal", "/lotOccupancies");
|
||||
cy.get("a[href$='/lotOccupancies/new']").should("exist");
|
||||
});
|
||||
|
||||
describe("Update a New Lot Occupancy", () => {
|
||||
before(() => {
|
||||
cy.visit("/lotOccupancies/new");
|
||||
});
|
||||
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.visit("/lotOccupancies/new");
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
import { testUpdate } from "../../../test/_globals.js";
|
||||
import { logout, login } from "../../support/index.js";
|
||||
describe("Update - Lots", () => {
|
||||
before(() => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testUpdate);
|
||||
});
|
||||
afterEach(logout);
|
||||
it('Has a "Create" link on the Lot Search', () => {
|
||||
cy.visit("/lots");
|
||||
cy.location("pathname").should("equal", "/lots");
|
||||
cy.get("a[href$='/lots/new']").should("exist");
|
||||
});
|
||||
describe("Update a New Lot", () => {
|
||||
before(() => {
|
||||
cy.visit("/lots/new");
|
||||
});
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.visit("/lots/new");
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,22 +3,22 @@ import { testUpdate } from "../../../test/_globals.js";
|
|||
import { logout, login } from "../../support/index.js";
|
||||
|
||||
describe("Update - Lots", () => {
|
||||
before(() => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testUpdate);
|
||||
});
|
||||
|
||||
afterEach(logout);
|
||||
|
||||
it('Has a "Create" link on the Lot Search', () => {
|
||||
cy.visit("/lots");
|
||||
cy.location("pathname").should("equal", "/lots");
|
||||
cy.get("a[href$='/lots/new']").should("exist");
|
||||
});
|
||||
|
||||
describe("Update a New Lot", () => {
|
||||
before(() => {
|
||||
cy.visit("/lots/new");
|
||||
});
|
||||
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.visit("/lots/new");
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,23 +2,22 @@ import { testUpdate } from "../../../test/_globals.js";
|
|||
import { logout, login } from "../../support/index.js";
|
||||
import * as configFunctions from "../../../helpers/functions.config.js";
|
||||
describe("Update - Maps", () => {
|
||||
before(() => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testUpdate);
|
||||
});
|
||||
afterEach(logout);
|
||||
it('Has a "Create" link on the Map Search', () => {
|
||||
cy.visit("/maps");
|
||||
cy.location("pathname").should("equal", "/maps");
|
||||
cy.get("a[href$='/maps/new']").should("exist");
|
||||
});
|
||||
describe("Update a New Map", () => {
|
||||
before(() => {
|
||||
it("Creates a new map", () => {
|
||||
cy.visit("/maps/new");
|
||||
});
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.log("Check the accessibility");
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
});
|
||||
it("Can populate basic details", () => {
|
||||
cy.log("Populate the fields");
|
||||
cy.fixture("map.json").then((mapJSON) => {
|
||||
cy.get("input[name='mapName']").clear().type(mapJSON.mapName);
|
||||
cy.get("textarea[name='mapDescription']").clear().type(mapJSON.mapDescription);
|
||||
|
|
@ -29,17 +28,13 @@ describe("Update - Maps", () => {
|
|||
cy.get("input[name='mapLatitude']").clear().type(mapJSON.mapLatitude.toString());
|
||||
cy.get("input[name='mapLongitude']").clear().type(mapJSON.mapLongitude.toString());
|
||||
});
|
||||
});
|
||||
it("Should use the default map city and province", () => {
|
||||
cy.log("Ensure the default city and province are used");
|
||||
cy.get("input[name='mapCity']").should("have.value", configFunctions.getProperty("settings.map.mapCityDefault"));
|
||||
cy.get("input[name='mapProvince']").should("have.value", configFunctions.getProperty("settings.map.mapProvinceDefault"));
|
||||
});
|
||||
it("Should submit form and create the map", () => {
|
||||
cy.log("Submit the form");
|
||||
cy.get("#form--map").submit();
|
||||
cy.wait(1000);
|
||||
cy.location("pathname").should("not.contain", "/new").should("contain", "/edit");
|
||||
});
|
||||
it("Should be populated as expected", () => {
|
||||
cy.fixture("map.json").then((mapJSON) => {
|
||||
cy.get("input[name='mapName']").should("have.value", mapJSON.mapName);
|
||||
cy.get("textarea[name='mapDescription']").should("have.value", mapJSON.mapDescription);
|
||||
|
|
@ -53,5 +48,4 @@ describe("Update - Maps", () => {
|
|||
cy.get("input[name='mapLongitude']").should("have.value", mapJSON.mapLongitude.toString());
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,27 +7,29 @@ import * as configFunctions from "../../../helpers/functions.config.js";
|
|||
import type * as recordTypes from "../../../types/recordTypes";
|
||||
|
||||
describe("Update - Maps", () => {
|
||||
before(() => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testUpdate);
|
||||
});
|
||||
|
||||
afterEach(logout);
|
||||
|
||||
it('Has a "Create" link on the Map Search', () => {
|
||||
cy.visit("/maps");
|
||||
cy.location("pathname").should("equal", "/maps");
|
||||
cy.get("a[href$='/maps/new']").should("exist");
|
||||
});
|
||||
|
||||
describe("Update a New Map", () => {
|
||||
before(() => {
|
||||
it("Creates a new map", () => {
|
||||
cy.visit("/maps/new");
|
||||
});
|
||||
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.log("Check the accessibility");
|
||||
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
});
|
||||
|
||||
it("Can populate basic details", () => {
|
||||
cy.log("Populate the fields");
|
||||
|
||||
// eslint-disable-next-line promise/catch-or-return, promise/always-return
|
||||
cy.fixture("map.json").then((mapJSON: recordTypes.Map) => {
|
||||
cy.get("input[name='mapName']").clear().type(mapJSON.mapName);
|
||||
|
|
@ -41,9 +43,9 @@ describe("Update - Maps", () => {
|
|||
cy.get("input[name='mapLatitude']").clear().type(mapJSON.mapLatitude.toString());
|
||||
cy.get("input[name='mapLongitude']").clear().type(mapJSON.mapLongitude.toString());
|
||||
});
|
||||
});
|
||||
|
||||
it("Should use the default map city and province", () => {
|
||||
cy.log("Ensure the default city and province are used");
|
||||
|
||||
cy.get("input[name='mapCity']").should(
|
||||
"have.value",
|
||||
configFunctions.getProperty("settings.map.mapCityDefault")
|
||||
|
|
@ -53,34 +55,43 @@ describe("Update - Maps", () => {
|
|||
"have.value",
|
||||
configFunctions.getProperty("settings.map.mapProvinceDefault")
|
||||
);
|
||||
});
|
||||
|
||||
it("Should submit form and create the map", () => {
|
||||
cy.log("Submit the form");
|
||||
|
||||
cy.get("#form--map").submit();
|
||||
|
||||
cy.wait(1000);
|
||||
|
||||
cy.location("pathname").should("not.contain", "/new").should("contain", "/edit");
|
||||
});
|
||||
|
||||
it("Should be populated as expected", () => {
|
||||
// eslint-disable-next-line promise/catch-or-return, promise/always-return
|
||||
cy.fixture("map.json").then((mapJSON: recordTypes.Map) => {
|
||||
cy.get("input[name='mapName']").should("have.value",mapJSON.mapName);
|
||||
cy.get("textarea[name='mapDescription']").should("have.value",mapJSON.mapDescription);
|
||||
cy.get("input[name='mapName']").should("have.value", mapJSON.mapName);
|
||||
cy.get("textarea[name='mapDescription']").should("have.value", mapJSON.mapDescription);
|
||||
|
||||
cy.get("input[name='mapAddress1']").should("have.value",mapJSON.mapAddress1);
|
||||
cy.get("input[name='mapAddress2']").should("have.value",mapJSON.mapAddress2);
|
||||
cy.get("input[name='mapAddress1']").should("have.value", mapJSON.mapAddress1);
|
||||
cy.get("input[name='mapAddress2']").should("have.value", mapJSON.mapAddress2);
|
||||
|
||||
cy.get("input[name='mapCity']").should("have.value", configFunctions.getProperty("settings.map.mapCityDefault"));
|
||||
cy.get("input[name='mapProvince']").should("have.value", configFunctions.getProperty("settings.map.mapProvinceDefault"));
|
||||
cy.get("input[name='mapCity']").should(
|
||||
"have.value",
|
||||
configFunctions.getProperty("settings.map.mapCityDefault")
|
||||
);
|
||||
cy.get("input[name='mapProvince']").should(
|
||||
"have.value",
|
||||
configFunctions.getProperty("settings.map.mapProvinceDefault")
|
||||
);
|
||||
|
||||
cy.get("input[name='mapPostalCode']").should("have.value",mapJSON.mapPostalCode);
|
||||
cy.get("input[name='mapPhoneNumber']").should("have.value",mapJSON.mapPhoneNumber);
|
||||
cy.get("input[name='mapPostalCode']").should("have.value", mapJSON.mapPostalCode);
|
||||
cy.get("input[name='mapPhoneNumber']").should("have.value", mapJSON.mapPhoneNumber);
|
||||
|
||||
cy.get("input[name='mapLatitude']").should("have.value",mapJSON.mapLatitude.toString());
|
||||
cy.get("input[name='mapLongitude']").should("have.value",mapJSON.mapLongitude.toString());
|
||||
});
|
||||
cy.get("input[name='mapLatitude']").should(
|
||||
"have.value",
|
||||
mapJSON.mapLatitude.toString()
|
||||
);
|
||||
cy.get("input[name='mapLongitude']").should(
|
||||
"have.value",
|
||||
mapJSON.mapLongitude.toString()
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,23 +1,19 @@
|
|||
import { testUpdate } from "../../../test/_globals.js";
|
||||
import { logout, login } from "../../support/index.js";
|
||||
describe("Update User", () => {
|
||||
before(logout);
|
||||
after(logout);
|
||||
it("Logs In Successfully", () => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testUpdate);
|
||||
});
|
||||
describe("Dashboard", () => {
|
||||
before(() => {
|
||||
afterEach(logout);
|
||||
it("Has an Update User dashboard", () => {
|
||||
cy.visit("/dashboard");
|
||||
});
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.log("Has no detectable accessibility issues");
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
});
|
||||
it("Has no links to admin areas", () => {
|
||||
cy.log("Has no links to admin areas");
|
||||
cy.get("a[href*='/admin']").should("not.exist");
|
||||
});
|
||||
});
|
||||
it("Redirects to Dashboard when attempting to access admin area", () => {
|
||||
cy.visit("/admin/cleanup");
|
||||
cy.wait(200);
|
||||
|
|
|
|||
|
|
@ -3,28 +3,25 @@ import { testUpdate } from "../../../test/_globals.js";
|
|||
import { logout, login } from "../../support/index.js";
|
||||
|
||||
describe("Update User", () => {
|
||||
before(logout);
|
||||
|
||||
after(logout);
|
||||
|
||||
it("Logs In Successfully", () => {
|
||||
beforeEach("Loads page", () => {
|
||||
logout();
|
||||
login(testUpdate);
|
||||
});
|
||||
|
||||
describe("Dashboard", () => {
|
||||
before(() => {
|
||||
cy.visit("/dashboard");
|
||||
});
|
||||
afterEach(logout);
|
||||
|
||||
it("Has an Update User dashboard", () => {
|
||||
cy.visit("/dashboard");
|
||||
|
||||
cy.log("Has no detectable accessibility issues");
|
||||
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
});
|
||||
|
||||
it("Has no links to admin areas", () => {
|
||||
cy.log("Has no links to admin areas");
|
||||
|
||||
cy.get("a[href*='/admin']").should("not.exist");
|
||||
});
|
||||
});
|
||||
|
||||
it("Redirects to Dashboard when attempting to access admin area", () => {
|
||||
cy.visit("/admin/cleanup");
|
||||
|
|
|
|||
|
|
@ -1,26 +1,21 @@
|
|||
import { testView } from "../../../test/_globals.js";
|
||||
import { logout, login } from "../../support/index.js";
|
||||
describe("Read Only User", () => {
|
||||
before(logout);
|
||||
after(logout);
|
||||
it("Logs In Successfully", () => {
|
||||
beforeEach(() => {
|
||||
logout();
|
||||
login(testView);
|
||||
});
|
||||
describe("Dashboard", () => {
|
||||
before(() => {
|
||||
afterEach(logout);
|
||||
it("Has a Read Only User dashboard", () => {
|
||||
cy.visit("/dashboard");
|
||||
});
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.log("Has no detectable accessibility issues");
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
});
|
||||
it("Has no links to new areas", () => {
|
||||
cy.log("Has no links to new areas");
|
||||
cy.get("a[href*='/new']").should("not.exist");
|
||||
});
|
||||
it("Has no links to admin areas", () => {
|
||||
cy.log("Has no links to admin areas");
|
||||
cy.get("a[href*='/admin']").should("not.exist");
|
||||
});
|
||||
});
|
||||
it("Has no link to create maps on Map Search", () => {
|
||||
cy.visit("/maps");
|
||||
cy.get("a[href*='/new']").should("not.exist");
|
||||
|
|
|
|||
|
|
@ -3,32 +3,30 @@ import { testView } from "../../../test/_globals.js";
|
|||
import { logout, login } from "../../support/index.js";
|
||||
|
||||
describe("Read Only User", () => {
|
||||
before(logout);
|
||||
|
||||
after(logout);
|
||||
|
||||
it("Logs In Successfully", () => {
|
||||
beforeEach(() => {
|
||||
logout();
|
||||
login(testView);
|
||||
});
|
||||
|
||||
describe("Dashboard", () => {
|
||||
before(() => {
|
||||
cy.visit("/dashboard");
|
||||
});
|
||||
afterEach(logout);
|
||||
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
it("Has a Read Only User dashboard", () => {
|
||||
cy.visit("/dashboard");
|
||||
|
||||
cy.log("Has no detectable accessibility issues");
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
});
|
||||
|
||||
it("Has no links to new areas", () => {
|
||||
|
||||
cy.log("Has no links to new areas");
|
||||
|
||||
cy.get("a[href*='/new']").should("not.exist");
|
||||
});
|
||||
|
||||
it("Has no links to admin areas", () => {
|
||||
cy.log("Has no links to admin areas");
|
||||
|
||||
cy.get("a[href*='/admin']").should("not.exist");
|
||||
});
|
||||
});
|
||||
|
||||
it("Has no link to create maps on Map Search", () => {
|
||||
cy.visit("/maps");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { logout } from "../../support/index.js";
|
||||
describe("Login Page", () => {
|
||||
before(logout);
|
||||
beforeEach(logout);
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.injectAxe();
|
||||
cy.checkA11y();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { logout } from "../../support/index.js";
|
||||
|
||||
describe("Login Page", () => {
|
||||
before(logout);
|
||||
beforeEach(logout);
|
||||
|
||||
it("Has no detectable accessibility issues", () => {
|
||||
cy.injectAxe();
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
import "cypress-axe";
|
||||
Cypress.Cookies.defaults({
|
||||
preserve: ["_csrf", "lot-occupancy-system-user-sid"]
|
||||
});
|
||||
export const logout = () => {
|
||||
cy.visit("/logout");
|
||||
};
|
||||
export const login = (userName) => {
|
||||
cy.visit("/login");
|
||||
cy.get(".message")
|
||||
.contains("Testing", {
|
||||
cy.get(".message").contains("Testing", {
|
||||
matchCase: false
|
||||
});
|
||||
cy.get("form [name='userName']").type(userName);
|
||||
|
|
|
|||
|
|
@ -2,22 +2,14 @@
|
|||
|
||||
import "cypress-axe";
|
||||
|
||||
|
||||
Cypress.Cookies.defaults({
|
||||
preserve: ["_csrf", "lot-occupancy-system-user-sid"]
|
||||
});
|
||||
|
||||
|
||||
export const logout = (): void => {
|
||||
cy.visit("/logout");
|
||||
};
|
||||
|
||||
|
||||
export const login = (userName: string): void => {
|
||||
cy.visit("/login");
|
||||
|
||||
cy.get(".message")
|
||||
.contains("Testing", {
|
||||
cy.get(".message").contains("Testing", {
|
||||
matchCase: false
|
||||
});
|
||||
|
||||
|
|
@ -32,5 +24,4 @@ export const login = (userName: string): void => {
|
|||
cy.get(".navbar").should("have.length", 1);
|
||||
};
|
||||
|
||||
|
||||
export const ajaxDelayMillis = 800;
|
||||
Loading…
Reference in New Issue