This commit is contained in:
2021-10-29 19:34:12 +00:00
parent d700e9137e
commit 9544547019
4 changed files with 83 additions and 22 deletions

View File

@@ -0,0 +1,22 @@
/// <reference types="cypress" />
describe("When authenticating with bad credentials", () => {
it("does not allow a login returns error", () => {
cy.visit("/login");
cy.get("input[name=username]").clear().type('notauser');
// {enter} causes the form to submit
cy.get("input[name=password]")
.clear()
.type(`notapassword{enter}`);
// //LOGOUT
// cy.get("[data-cy=navicon]").click();
// cy.contains("AyaNova SuperUser");
cy.get("[data-cy=loginbutton_failedcreds]");
cy.url().should("include", "/login");
//-----------------------------------------------------
});
});

View File

@@ -1,21 +0,0 @@
/// <reference types="cypress" />
describe("When authenticating", () => {
it("logs in and logs out superuser 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}`);
//LOGOUT
cy.get("[data-cy=navicon]").click();
cy.contains("AyaNova SuperUser");
cy.get("[data-cy=logout]").click({force:true});
cy.url().should("include", "/login");
//-----------------------------------------------------
});
});