From 5469cc4927b724e7b10609da402b3ed64ff0f251 Mon Sep 17 00:00:00 2001 From: Khavin Shankar Date: Mon, 18 Nov 2024 15:59:37 +0530 Subject: [PATCH 1/3] fixed the condition in cypress video artefact upload (#9149) --- .github/workflows/cypress.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index ecd06f922c0..506c2e56f66 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -116,7 +116,6 @@ jobs: group: "UI-Chrome" env: CYPRESS_SPLIT_TESTS: "true" - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_OPTIONS: --max_old_space_size=4096 COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}} @@ -133,7 +132,7 @@ jobs: - name: Upload cypress videos 📹 uses: actions/upload-artifact@v3 - if: steps.pr_origin.outputs.is_forked == 'true' + if: ${{ failure() && steps.pr_origin.outputs.is_forked == 'true' }} with: name: cypress-videos path: cypress/videos \ No newline at end of file From 5a85fb3afe4a14c3e94c8b9ab64f02098c6356ff Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:24:19 +0530 Subject: [PATCH 2/3] Fixed the flaky test in user skill management cypress test (#9148) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- cypress/e2e/users_spec/UsersManage.cy.ts | 9 ++------- cypress/pageobject/Hcx/HcxClaims.ts | 3 +++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts index f3a04ca4410..22da938542d 100644 --- a/cypress/e2e/users_spec/UsersManage.cy.ts +++ b/cypress/e2e/users_spec/UsersManage.cy.ts @@ -65,14 +65,9 @@ describe("Manage User", () => { manageUserPage.clicklinkedskillbutton(); manageUserPage.selectSkillFromDropdown(linkedskill); manageUserPage.clickAddSkillButton(); - manageUserPage.clickCloseSlideOver(); - cy.wait(5000); // temporary hack to fix the failure - manageUserPage.clicklinkedskillbutton(); + cy.verifyNotification("Skill added successfully"); + cy.closeNotification(); manageUserPage.assertSkillInAddedUserSkills(linkedskill); - manageUserPage.clickUnlinkSkill(); - manageUserPage.clickSubmit(); - manageUserPage.selectSkillFromDropdown(linkedskill); - manageUserPage.clickAddSkillButton(); manageUserPage.clickCloseSlideOver(); // verifying the doctor connect manageUserPage.navigateToFacility(); diff --git a/cypress/pageobject/Hcx/HcxClaims.ts b/cypress/pageobject/Hcx/HcxClaims.ts index 9a915a05196..b93862e6d13 100644 --- a/cypress/pageobject/Hcx/HcxClaims.ts +++ b/cypress/pageobject/Hcx/HcxClaims.ts @@ -1,5 +1,8 @@ export class HcxClaims { selectEligiblePolicy(policy: string) { + cy.get("#select-insurance-policy", { timeout: 10000 }) + .should("be.visible") + .and("not.be.disabled"); cy.clickAndSelectOption("#select-insurance-policy", policy); } From c4f54a84bbbe885da149fcf1799e0c5a98f8218d Mon Sep 17 00:00:00 2001 From: Jacob John Jeevan <40040905+Jacobjeevan@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:36:08 +0530 Subject: [PATCH 3/3] Respiratory support table/graph: render no data points with no mode/modality (#9139) --- .../Facility/Consultations/VentilatorPlot.tsx | 60 +++++++------------ .../Consultations/VentilatorTable.tsx | 21 ++++--- 2 files changed, 36 insertions(+), 45 deletions(-) diff --git a/src/components/Facility/Consultations/VentilatorPlot.tsx b/src/components/Facility/Consultations/VentilatorPlot.tsx index 38948f165ea..2de4afe36a4 100644 --- a/src/components/Facility/Consultations/VentilatorPlot.tsx +++ b/src/components/Facility/Consultations/VentilatorPlot.tsx @@ -110,63 +110,47 @@ export const VentilatorPlot = ({ case "ventilator_tidal_volume": case "ventilator_peep": condition = - (currentRound.ventilator_interface === "INVASIVE" || - currentRound.ventilator_interface === "NON_INVASIVE") && - !!currentRound.ventilator_mode; + currentRound.ventilator_interface === "INVASIVE" || + currentRound.ventilator_interface === "NON_INVASIVE"; break; case "ventilator_fio2": condition = - currentRound.ventilator_interface === "OXYGEN_SUPPORT" && - currentRound.ventilator_oxygen_modality === "HIGH_FLOW_NASAL_CANNULA"; - break; - case "ventilator_spo2": - condition = - currentRound.ventilator_interface === "OXYGEN_SUPPORT" && - (currentRound.ventilator_oxygen_modality === "NASAL_PRONGS" || - currentRound.ventilator_oxygen_modality === "SIMPLE_FACE_MASK" || - currentRound.ventilator_oxygen_modality === - "NON_REBREATHING_MASK" || + currentRound.ventilator_interface === "INVASIVE" || + currentRound.ventilator_interface === "NON_INVASIVE" || + (currentRound.ventilator_interface === "OXYGEN_SUPPORT" && currentRound.ventilator_oxygen_modality === "HIGH_FLOW_NASAL_CANNULA"); break; + case "ventilator_spo2": + condition = currentRound.ventilator_interface !== "UNKNOWN"; + break; case "etco2": case "ventilator_oxygen_modality_flow_rate": condition = - !!currentRound.ventilator_mode || - !!currentRound.ventilator_oxygen_modality || - false; + currentRound.ventilator_interface === "OXYGEN_SUPPORT" && + currentRound.ventilator_oxygen_modality === "HIGH_FLOW_NASAL_CANNULA"; break; case "ventilator_oxygen_modality_oxygen_rate": condition = currentRound.ventilator_interface === "OXYGEN_SUPPORT" && - (currentRound.ventilator_oxygen_modality === "NASAL_PRONGS" || - currentRound.ventilator_oxygen_modality === "SIMPLE_FACE_MASK" || - currentRound.ventilator_oxygen_modality === "NON_REBREATHING_MASK"); + currentRound.ventilator_oxygen_modality !== "HIGH_FLOW_NASAL_CANNULA"; break; } switch (currentRound.ventilator_interface) { case "OXYGEN_SUPPORT": - legend = - t( - `OXYGEN_MODALITY__${currentRound.ventilator_oxygen_modality}_short`, - ) + - " (" + - t("RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT") + - ")"; + legend = currentRound.ventilator_oxygen_modality + ? `${t(`OXYGEN_MODALITY__${currentRound.ventilator_oxygen_modality}_short`)} (${t("RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT")})` + : t("RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT"); break; case "INVASIVE": - legend = - t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`) + - " (" + - t("RESPIRATORY_SUPPORT_SHORT__INVASIVE") + - ")"; + legend = currentRound.ventilator_mode + ? `${t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`)} (${t("RESPIRATORY_SUPPORT_SHORT__INVASIVE")})` + : t("RESPIRATORY_SUPPORT_SHORT__INVASIVE"); break; case "NON_INVASIVE": - legend = - t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`) + - " (" + - t("RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE") + - ")"; + legend = currentRound.ventilator_mode + ? `${t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`)} (${t("RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE")})` + : t("RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE"); break; } return { condition, legend }; @@ -178,9 +162,9 @@ export const VentilatorPlot = ({ switch (ventilatorInterface) { case "INVASIVE": case "NON_INVASIVE": - return round.ventilator_mode; + return round.ventilator_mode ?? "None"; case "OXYGEN_SUPPORT": - return round.ventilator_oxygen_modality; + return round.ventilator_oxygen_modality ?? "None"; default: return null; } diff --git a/src/components/Facility/Consultations/VentilatorTable.tsx b/src/components/Facility/Consultations/VentilatorTable.tsx index 2059f14bac0..9e4084cbaea 100644 --- a/src/components/Facility/Consultations/VentilatorTable.tsx +++ b/src/components/Facility/Consultations/VentilatorTable.tsx @@ -30,9 +30,13 @@ export default function VentilatorTable(props: VentilatorTableProps) { switch (ventilator_interface) { case "INVASIVE": case "NON_INVASIVE": - return t(`VENTILATOR_MODE__${ventilator_mode}`); + return ventilator_mode + ? t(`VENTILATOR_MODE__${ventilator_mode}`) + : "None"; case "OXYGEN_SUPPORT": - return t(`OXYGEN_MODALITY__${ventilator_oxygen_modality}`); + return ventilator_oxygen_modality + ? t(`OXYGEN_MODALITY__${ventilator_oxygen_modality}`) + : "None"; default: return null; } @@ -55,9 +59,9 @@ export default function VentilatorTable(props: VentilatorTableProps) { switch (ventilatorInterface) { case "INVASIVE": case "NON_INVASIVE": - return round.ventilator_mode; + return round.ventilator_mode ?? "None"; case "OXYGEN_SUPPORT": - return round.ventilator_oxygen_modality; + return round.ventilator_oxygen_modality ?? "None"; default: return null; } @@ -74,8 +78,9 @@ export default function VentilatorTable(props: VentilatorTableProps) { const nextInterfaceOrModality = getModeOrModality(nextRound); if ( nextInterfaceOrModality && - currentRound.ventilator_interface == nextRound.ventilator_interface && - currentInterfaceOrModality == nextInterfaceOrModality + currentRound.ventilator_interface === + nextRound.ventilator_interface && + currentInterfaceOrModality === nextInterfaceOrModality ) { index += 1; } else { @@ -105,6 +110,8 @@ export default function VentilatorTable(props: VentilatorTableProps) { const sortedData: DailyRoundsModel[] = dailyRoundsList.sort( compareByDateString("taken_at"), ); + const tableBody = VentilatorTableBody(sortedData); + if (!tableBody.length) return null; return (
@@ -122,7 +129,7 @@ export default function VentilatorTable(props: VentilatorTableProps) { - {VentilatorTableBody(sortedData)} + {tableBody}
);