This commit is contained in:
2021-11-04 18:49:50 +00:00
parent b8c0232ff8
commit 112870fa6c
3 changed files with 42 additions and 5 deletions

View File

@@ -24,6 +24,7 @@ Cypress.config("cyid", `cy${new Date().getTime()}`);
///////////////////////////////////////////////////////////////
//Generate fresh data
//
//
//via UI
// before(() => {
// cy.visit("/login");
@@ -45,7 +46,43 @@ Cypress.config("cyid", `cy${new Date().getTime()}`);
// cy.url({ timeout: 300000 }).should("include", "/login");
// });
//via API
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
confirmJobDone(jobId, authToken);
});
}
before(() => {
cy.request(method, `${Cypress.env("apiBaseUrl")}auth`, `{"login":"${Cypress.env('adminusername')}"},"password":"${Cypress.env('adminpassword')}"`);//{"login":"superuser","password":"l3tm3in"}
});
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: ${resjob}`);
// expect(resjob.body).to.have.property('jobId');
confirmJobDone(resjob.jobId, res.data.token);
});
});
});

View File

@@ -1,6 +1,6 @@
/// <reference types="cypress" />
describe("When Accounting user logs in", () => {
it("should correctly run all functionality", () => {
it.skip("should correctly run all functionality", () => {
//format for typing input and setting value is always YYYY-MM-DD for date and HH:MM in 24 hour time for time
const dNow = new Date();
const dToday = `${dNow.getFullYear()}-${(dNow.getMonth() + 1)

View File

@@ -3,7 +3,7 @@
import dayjs from "../../../support/dayjs.min.js";
describe("When Service user logs in", () => {
it("should correctly run all functionality", () => {
it.skip("should correctly run all functionality", () => {
cy.visit("/login");
cy.get("input[name=username]").clear().type(Cypress.env("serviceuser"));
// {enter} causes the form to submit