From 2fdffa22adf8e9898b579faf2cf6c2d877a7b3d8 Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:27:30 +0530 Subject: [PATCH] Fixed the cypress env config file and removed hardcoded fallback (#9184) --- cypress.config.ts | 5 ++++- .../{PatientFileUpload.ts => PatientFileUpload.cy.ts} | 0 cypress/pageobject/Patient/PatientFileupload.ts | 4 +++- package-lock.json | 2 +- src/components/Files/AudioCaptureDialog.tsx | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) rename cypress/e2e/patient_spec/{PatientFileUpload.ts => PatientFileUpload.cy.ts} (100%) diff --git a/cypress.config.ts b/cypress.config.ts index b6e8fadd462..4da5d989a88 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,7 +1,10 @@ import { defineConfig } from "cypress"; import cypressSplit from "cypress-split"; +import * as dotenv from "dotenv"; import fs from "fs"; +dotenv.config(); + export default defineConfig({ projectId: "wf7d2m", defaultCommandTimeout: 10000, @@ -32,7 +35,7 @@ export default defineConfig({ requestTimeout: 15000, }, env: { - API_URL: process.env.REACT_CARE_API_URL ?? "http://localhost:9000", + API_URL: process.env.REACT_CARE_API_URL, ENABLE_HCX: process.env.REACT_ENABLE_HCX ?? false, }, }); diff --git a/cypress/e2e/patient_spec/PatientFileUpload.ts b/cypress/e2e/patient_spec/PatientFileUpload.cy.ts similarity index 100% rename from cypress/e2e/patient_spec/PatientFileUpload.ts rename to cypress/e2e/patient_spec/PatientFileUpload.cy.ts diff --git a/cypress/pageobject/Patient/PatientFileupload.ts b/cypress/pageobject/Patient/PatientFileupload.ts index 6cde7d78568..c70170a744d 100644 --- a/cypress/pageobject/Patient/PatientFileupload.ts +++ b/cypress/pageobject/Patient/PatientFileupload.ts @@ -20,7 +20,9 @@ export class PatientFileUpload { recordAudio() { cy.get("#record-audio").click(); - cy.wait(5000); + cy.wait(2000); + cy.get("#start-recording").click(); + cy.wait(2000); cy.get("#stop-recording").click(); cy.wait(1000); cy.get("#save-recording").click(); diff --git a/package-lock.json b/package-lock.json index 5c703af8fe1..63af1164ef0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20862,4 +20862,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/components/Files/AudioCaptureDialog.tsx b/src/components/Files/AudioCaptureDialog.tsx index 4d60f64a135..5512fad9dc6 100644 --- a/src/components/Files/AudioCaptureDialog.tsx +++ b/src/components/Files/AudioCaptureDialog.tsx @@ -133,7 +133,7 @@ export default function AudioCaptureDialog(props: AudioCaptureDialogProps) {

{t("audio__record")}

{t("audio__record_helper")}
-
+