This commit is contained in:
2021-11-04 17:12:29 +00:00
parent 1cb4a881af
commit b8c0232ff8

View File

@@ -21,25 +21,31 @@ import "./commands";
//unique test run ID for all tests //unique test run ID for all tests
Cypress.config("cyid", `cy${new Date().getTime()}`); Cypress.config("cyid", `cy${new Date().getTime()}`);
///////////////////////////////////////////////////////////////
//Generate fresh data //Generate fresh data
//
//via UI
// before(() => {
// 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}`);
// cy.url().should("include", "/ay-evaluate");
// cy.get("[data-cy=btnSeed]").click();
// cy.get("[data-cy=btnStart]").click();
// cy.get('[data-cy="gzconfirm:yesbutton"]').click();
// //cy.contains("permanently erase");
// cy.get('[data-cy="gzconfirm:yesbutton"]').click();
// //long delay here while data is being generated
// cy.url({ timeout: 300000 }).should("include", "/login");
// });
//via API
before(() => { before(() => {
cy.visit("/login"); cy.request(method, `${Cypress.env("apiBaseUrl")}auth`, `{"login":"${Cypress.env('adminusername')}"},"password":"${Cypress.env('adminpassword')}"`);//{"login":"superuser","password":"l3tm3in"}
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}`);
cy.url().should("include", "/ay-evaluate");
cy.get("[data-cy=btnSeed]").click();
cy.get("[data-cy=btnStart]").click();
cy.get('[data-cy="gzconfirm:yesbutton"]').click();
//cy.contains("permanently erase");
cy.get('[data-cy="gzconfirm:yesbutton"]').click();
//long delay here while data is being generated
cy.url({timeout:300000}).should("include", "/login");
});