This commit is contained in:
2021-12-20 17:38:02 +00:00
parent 0a300effec
commit 971efcf732
2 changed files with 57 additions and 26 deletions

View File

@@ -63,29 +63,29 @@ function confirmJobDone(jobId, authToken) {
}
before(() => {
cy.request({
url: `${Cypress.env("apiBaseUrl")}auth`,
method: "POST",
body: {
login: Cypress.env("adminusername"),
password: Cypress.env("adminpassword")
}
})
.its("body")
.then((res) => {
cy.request({
method: "POST",
url: `${Cypress.env("apiBaseUrl")}trial/seed/small/-7/true`,
auth: {
bearer: res.data.token
}
})
.its("body")
.then((resjob) => {
cy.log(`resjob is: ${JSON.stringify(resjob)}`);
// expect(resjob.body).to.have.property('jobId');
confirmJobDone(resjob.jobId, res.data.token);
});
});
});
// before(() => {
// cy.request({
// url: `${Cypress.env("apiBaseUrl")}auth`,
// method: "POST",
// body: {
// login: Cypress.env("adminusername"),
// password: Cypress.env("adminpassword")
// }
// })
// .its("body")
// .then((res) => {
// cy.request({
// method: "POST",
// url: `${Cypress.env("apiBaseUrl")}trial/seed/small/-7/true`,
// auth: {
// bearer: res.data.token
// }
// })
// .its("body")
// .then((resjob) => {
// cy.log(`resjob is: ${JSON.stringify(resjob)}`);
// // expect(resjob.body).to.have.property('jobId');
// confirmJobDone(resjob.jobId, res.data.token);
// });
// });
// });

View File

@@ -0,0 +1,31 @@
// 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("adminusername"),
password: Cypress.env("adminpassword")
}
})
.its("body")
.then((res) => {
cy.request({
method: "POST",
url: `${Cypress.env("apiBaseUrl")}trial/seed/small/-7/true`,
auth: {
bearer: res.data.token
}
})
.its("body")
.then((resjob) => {
cy.log(`resjob is: ${JSON.stringify(resjob)}`);
// expect(resjob.body).to.have.property('jobId');
confirmJobDone(resjob.jobId, res.data.token);
});
});
//-----------------------------------------------------
});
});