115 lines
4.2 KiB
JavaScript
115 lines
4.2 KiB
JavaScript
// Basic smoke test, visit every form to ensure they load
|
|
|
|
describe("SMOKE HOME SECTION", () => {
|
|
it("Home forms opens without error", () => {
|
|
cy.visit("/login");
|
|
|
|
cy.get("input[name=username]").clear().type(Cypress.env("adminusername"));
|
|
|
|
// {enter} causes the form to submit
|
|
cy.get("input[name=password]")
|
|
.clear()
|
|
.type(`${Cypress.env("adminpassword")}{enter}`);
|
|
|
|
//################# HOME
|
|
cy.visit("/home-dashboard");
|
|
cy.url().should("include", "/home-dashboard");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
|
|
cy.visit("/home-search");
|
|
cy.url().should("include", "/home-search");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=phrase]");
|
|
|
|
cy.visit("/home-schedule");
|
|
cy.url().should("include", "/home-schedule");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=calendar]");
|
|
|
|
cy.visit("/home-memos");
|
|
cy.url().should("include", "/home-memos");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=memosTable]");
|
|
|
|
cy.visit("/home-memos/0"); //no reliable single id would work for existing
|
|
cy.url().should("include", "/home-memos/0");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=pickListSelectedUserId]");
|
|
|
|
cy.visit("/home-reminders");
|
|
cy.url().should("include", "/home-reminders");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=remindersTable]");
|
|
|
|
cy.visit("/home-reminders/0");
|
|
cy.url().should("include", "/home-reminders/0");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=name]");
|
|
|
|
cy.visit("/home-reviews");
|
|
cy.url().should("include", "/home-reviews");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=reviewsTable]");
|
|
|
|
cy.visit("/home-reviews/8/1");
|
|
cy.url().should("include", "/home-reviews/8/1");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=clickThru]");
|
|
|
|
cy.visit("/home-user-settings");
|
|
cy.url().should("include", "/home-user-settings");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=emailAddress]");
|
|
|
|
cy.visit("/home-password");
|
|
cy.url().should("include", "/home-password");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=loginName]");
|
|
|
|
cy.visit("/home-security");
|
|
cy.url().should("include", "/home-security");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=tfa]");
|
|
//confirm a qrCode is actually being displayed
|
|
cy.get("[data-cy=qrCodeImage]", { timeout: 15000 }) //this can be slow at times
|
|
.should("be.visible")
|
|
.and(($img) => {
|
|
// "naturalWidth" and "naturalHeight" are set when the image loads
|
|
expect($img[0].naturalWidth).to.be.greaterThan(0);
|
|
});
|
|
|
|
//can't do this without reset code etc, just logs out
|
|
// cy.visit("/home-reset");
|
|
// cy.url().should("include", "/home-reset");
|
|
// cy.get("[data-cy=loginName]");
|
|
|
|
cy.visit("/home-notify-subscriptions");
|
|
cy.url().should("include", "/home-notify-subscriptions");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=subsTable]");
|
|
|
|
cy.visit("/home-notify-subscriptions/0");
|
|
cy.url().should("include", "/home-notify-subscriptions/0");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=eventType]");
|
|
|
|
cy.visit("/home-notifications");
|
|
cy.url().should("include", "/home-notifications");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=notifications]");
|
|
|
|
cy.visit("/home-notify-direct");
|
|
cy.url().should("include", "/home-notify-direct");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
cy.get("[data-cy=pickListSelectedUserId]");
|
|
|
|
//LOGOUT
|
|
cy.get("[data-cy=navicon]").click();
|
|
cy.get("[data-cy=logout]").click();
|
|
cy.url().should("include", "/login");
|
|
cy.get("[data-cy=generalerror]").should("not.exist");
|
|
|
|
//-----------------------------------------------------
|
|
});
|
|
});
|