IO-2327 timetickets test cases

This commit is contained in:
swtmply
2023-08-30 12:11:31 +08:00
parent 7fc9bd5b35
commit 692f5c0167
3 changed files with 40 additions and 4 deletions

View File

@@ -216,8 +216,6 @@ describe(
.and("not.be.disabled")
.click();
// TODO check if labors are calculated correctly
cy.wait("@bodyshop").then(({ request }) => {
const token = request.headers.authorization;
@@ -280,6 +278,41 @@ describe(
cy.get('[data-cy="tech-employee-id"]').type("a");
cy.get('[data-cy="tech-employee-password"]').type("a{enter}");
cy.contains("Logged in as");
// go to clock in
cy.get('[data-cy="sider-joblock"]').click({ force: true });
// find the job ro
cy.get('[data-cy="clock-ro-select"]').type("273");
cy.get('[data-cy="clock-ro-select"] .ant-select-selection-search input')
.invoke("attr", "id")
.then((selElm) => {
const dropDownSelector = `#${selElm}_list`;
cy.get(dropDownSelector)
.next()
.find(".ant-select-item-option-content")
.first()
.click({ force: true });
});
// select cost center
cy.get('[data-cy="clock-cost-center-select"]').click();
cy.get(
'[data-cy="clock-cost-center-select"] .ant-select-selection-search input'
)
.invoke("attr", "id")
.then((selElm) => {
const dropDownSelector = `#${selElm}_list`;
cy.get(dropDownSelector)
.next()
.find(".ant-select-item-option-content")
.contains("Body")
.first()
.click({ force: true });
});
// clock in and out of the job
});
}
);

View File

@@ -34,6 +34,7 @@ export function TechClockInComponent({ form, bodyshop, technician }) {
convertedOnly={!bodyshop.tt_allow_post_to_invoiced}
notExported={!bodyshop.tt_allow_post_to_invoiced}
notInvoiced={!bodyshop.tt_allow_post_to_invoiced}
data-cy="clock-ro-select"
/>
</Form.Item>
@@ -47,7 +48,7 @@ export function TechClockInComponent({ form, bodyshop, technician }) {
},
]}
>
<Select>
<Select data-cy="clock-cost-center-select">
{emps &&
emps.rates.map((item) => (
<Select.Option key={item.cost_center} value={item.cost_center}>

View File

@@ -56,7 +56,9 @@ export function TechSider({ technician, techLogout }) {
disabled={!!!technician}
icon={<Icon component={FaBusinessTime} />}
>
<Link to={`/tech/jobclock`}>{t("menus.tech.jobclockin")}</Link>
<Link data-cy="sider-joblock" to={`/tech/jobclock`}>
{t("menus.tech.jobclockin")}
</Link>
</Menu.Item>
<Menu.Item
key="4"