migration from cypress 9 to cypress 10

This commit is contained in:
2022-08-07 19:26:07 +00:00
parent 38572219bc
commit 8f37876a9d
31 changed files with 41 additions and 32 deletions

View File

@@ -0,0 +1,51 @@
// Basic smoke test, visit every form to ensure they load
describe("SMOKE SETUP", () => {
it("Generates test data without issue", () => {
cy.request({
url: `${Cypress.env("apiBaseUrl")}auth`,
method: "POST",
body: {
login: Cypress.env("admin").login,
password: Cypress.env("admin").password
}
})
.its("body")
.then((res) => {
cy.request({
method: "POST",
url: `${Cypress.env("apiBaseUrl")}trial/seed`,
auth: {
bearer: res.data.token
}, ///small/-7/true
body: {
seedLevel: "small",
timeZoneOffset: -7,
e2e: true
}
})
.its("body")
.then((resjob) => {
cy.log(`resjob is: ${JSON.stringify(resjob)}`);
// expect(resjob.body).to.have.property('jobId');
confirmJobDone(resjob.jobId, res.data.token);
});
});
//-----------------------------------------------------
});
});
function confirmJobDone(jobId, authToken) {
cy.request({
method: "GET",
url: `${Cypress.env("apiBaseUrl")}job-operations/status/${jobId}`,
auth: {
bearer: authToken
}
}).then((resp) => {
//3 means job done
if (resp.body.data == 3) return;
// else recurse
cy.wait(1000);
confirmJobDone(jobId, authToken);
});
}