This commit is contained in:
@@ -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");
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user