IO-2327 added auto part ordering

This commit is contained in:
swtmply
2023-08-23 04:22:40 +08:00
parent e74ba0942e
commit e7887ea822

View File

@@ -5,7 +5,7 @@ import Dinero from "dinero.js";
const uuid = () => Cypress._.random(0, 1e6);
describe.only(
describe(
"Billing job parts orders",
{
defaultCommandTimeout: 10000,
@@ -243,7 +243,6 @@ describe.only(
.should("exist");
});
// select no in job estimate
it("posts bill directly", () => {
cy.get('[data-cy="tab-partssublet"]').should("be.visible").click();
@@ -476,6 +475,43 @@ describe(
});
it("validates auto reconciliation through posting bill", () => {
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(".ant-checkbox-input")
.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-comments"]').type("testing from cypress");
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="tab-partssublet"]').should("be.visible").click();
// Find the first row in the parts order
cy.get('[data-cy="part-orders-table"]')
.find(".ant-table-tbody")