IO-2327 parts ordering test case
This commit is contained in:
@@ -1,15 +1,14 @@
|
|||||||
import job from "../../fixtures/jobs/job-3.json";
|
import job from "../../fixtures/jobs/job-3.json";
|
||||||
|
import job2 from "../../fixtures/jobs/job-4.json";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
|
||||||
describe(
|
describe(
|
||||||
"Ordering parts for the job",
|
"Ordering parts for the job",
|
||||||
{
|
{
|
||||||
defaultCommandTimeout: 5000,
|
defaultCommandTimeout: 10000,
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
it("order parts for the job", () => {
|
beforeEach(() => {
|
||||||
const today = moment(new Date()).format("YYYY-MM-DD");
|
|
||||||
|
|
||||||
cy.visit("/manage/jobs");
|
cy.visit("/manage/jobs");
|
||||||
|
|
||||||
cy.get('[data-cy="active-jobs-table"]')
|
cy.get('[data-cy="active-jobs-table"]')
|
||||||
@@ -17,6 +16,10 @@ describe(
|
|||||||
.find("> tr:not(.ant-table-measure-row)")
|
.find("> tr:not(.ant-table-measure-row)")
|
||||||
.as("active-jobs-table")
|
.as("active-jobs-table")
|
||||||
.should("not.have.class", "ant-table-placeholder");
|
.should("not.have.class", "ant-table-placeholder");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("order multiple parts for the job", () => {
|
||||||
|
const today = moment(new Date()).format("YYYY-MM-DD");
|
||||||
|
|
||||||
cy.get("@active-jobs-table")
|
cy.get("@active-jobs-table")
|
||||||
.contains(job.clm_no)
|
.contains(job.clm_no)
|
||||||
@@ -69,5 +72,58 @@ describe(
|
|||||||
.eq(15)
|
.eq(15)
|
||||||
.contains("Ordered");
|
.contains("Ordered");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it.only("order parts for the job", () => {
|
||||||
|
const today = moment(new Date()).format("YYYY-MM-DD");
|
||||||
|
|
||||||
|
cy.get("@active-jobs-table")
|
||||||
|
.contains(job2.clm_no)
|
||||||
|
.first()
|
||||||
|
.parent()
|
||||||
|
.find('[data-cy="active-job-link"]')
|
||||||
|
.click();
|
||||||
|
|
||||||
|
// Go to repair data tab
|
||||||
|
cy.get('[data-cy="tab-repairdata"]').should("be.visible").click();
|
||||||
|
// Click on filter parts only
|
||||||
|
cy.get('[data-cy="filter-parts-button"]')
|
||||||
|
.should("not.be.disabled")
|
||||||
|
.click();
|
||||||
|
// Select multiple rows
|
||||||
|
cy.get('[data-cy="repair-data-table"]')
|
||||||
|
.find("input:checkbox")
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
|
// Click Order Parts
|
||||||
|
cy.get('[data-cy="order-parts-button"]')
|
||||||
|
.should("not.be.disabled")
|
||||||
|
.click();
|
||||||
|
// Modal should be visible
|
||||||
|
cy.get('[data-cy="parts-order-modal"]').should("be.visible");
|
||||||
|
// Fill required fields
|
||||||
|
cy.get(".ant-select-selection-search").find(`#vendorid`).click();
|
||||||
|
cy.get(`#vendorid_list`)
|
||||||
|
.next()
|
||||||
|
.find(".ant-select-item-option-content")
|
||||||
|
.first()
|
||||||
|
.click({ force: true });
|
||||||
|
cy.get("#deliver_by").click();
|
||||||
|
cy.get(`[title="${today}"]`).should("be.visible").click({ force: true });
|
||||||
|
|
||||||
|
cy.get('[data-cy="part-order-select-none"]').check();
|
||||||
|
cy.get('[data-cy="order-part-submit"]').should("not.be.disabled").click();
|
||||||
|
|
||||||
|
cy.get(".ant-notification-notice-message").contains(
|
||||||
|
"Parts order created successfully."
|
||||||
|
);
|
||||||
|
|
||||||
|
cy.get('[data-cy="repair-data-table"]')
|
||||||
|
.find(".ant-table-tbody")
|
||||||
|
.find("> tr:not(.ant-table-measure-row)")
|
||||||
|
.first()
|
||||||
|
.find(".ant-table-cell")
|
||||||
|
.eq(15)
|
||||||
|
.contains("Ordered");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user