Skip to content

Commit

Permalink
updates to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker committed Oct 11, 2024
1 parent e5480f3 commit 09cc318
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/PatientRegistration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const getRelativeDateString = (deltaDays = 0) => {
month: "2-digit",
year: "numeric",
})
.replace("/", "");
.replace(/\//g, "");
};

describe("Patient Creation with consultation", () => {
Expand Down
5 changes: 4 additions & 1 deletion cypress/pageobject/Asset/AssetCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class AssetPage {
).click();
cy.get(
'[data-test-id="date-input"]:visible [data-test-id="clear-date-input"]',
).click();
).click({ force: true });
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(lastServicedOn);
Expand Down Expand Up @@ -285,6 +285,9 @@ export class AssetPage {

enterAssetservicedate(text: string) {
cy.get("input[name='last_serviced_on']").click();
cy.get(
'[data-test-id="date-input"]:visible [data-test-id="clear-date-input"]',
).click({ force: true });
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(text);
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class PatientConsultationPage {
cy.get(selector).click();
cy.get(
'[data-test-id="date-input"]:visible [data-test-id="clear-date-input"]',
).click();
).click({ force: true });
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(date);
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Patient/PatientTreatmentPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class PatientTreatmentPlan {
cy.get("#procedure-time").click();
cy.get(
'[data-test-id="date-input"]:visible [data-test-id="clear-date-input"]',
).click();
).click({ force: true });
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(time);
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Users/UserCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class UserCreationPage {
cy.get("#" + elementId).click();
cy.get(
'[data-test-id="date-input"]:visible [data-test-id="clear-date-input"]',
).click();
).click({ force: true });
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]')
.click()
.type(value);
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Users/UserProfilePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class UserProfilePage {
cy.get("#date_of_birth").click();
cy.get(
'[data-test-id="date-input"]:visible [data-test-id="clear-date-input"]',
).click();
).click({ force: true });
cy.get('[data-test-id="date-input"]:visible [data-time-input="0"]').type(
date_of_birth,
);
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Cypress.Commands.add("clickAndTypeDate", (selector, date) => {
cy.get(selector).click();
cy.get(
`[data-test-id="date-input"]:visible [data-test-id="clear-date-input"]`,
).click();
).click({ force: true });
cy.get(`[data-test-id="date-input"]:visible [data-time-input="0"]`)
.click()
.type(date);
Expand Down

0 comments on commit 09cc318

Please sign in to comment.