Skip to content

Commit

Permalink
Merge pull request #6164 from coronasafe/develop
Browse files Browse the repository at this point in the history
Production Release; Aug Week 5
  • Loading branch information
mathew-alex authored Aug 27, 2023
2 parents f88bb27 + 568a542 commit b91e9cb
Show file tree
Hide file tree
Showing 50 changed files with 986 additions and 156 deletions.
40 changes: 40 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{
"name": "care_fe",
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bullseye",
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": true,
"installDockerBuildx": true,
"version": "latest",
"dockerDashComposeVersion": "v2"
}
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"yoavbls.pretty-ts-errors",
"chenglou92.rescript-vscode"
]
}
},
"hostRequirements": {
"cpus": 4
},
"waitFor": "onCreateCommand",
"postCreateCommand": "npm install",
"postAttachCommand": {
"server": "npm run dev"
},
"portsAttributes": {
"4000": {
"label": "Application",
"onAutoForward": "openPreview"
}
},
"forwardPorts": [4000]
}
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
start: "npx vite preview --host"
wait-on: "http://localhost:4000"
wait-on-timeout: 300
browser: electron
browser: chrome
record: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ storybook-static
.swp
stats.json
public/build-meta.json
.vscode
.vscode/*
!.vscode/launch.json


# Reason React
Expand Down
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run application",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"dev"
],
"skipFiles": [
"<node_internals>/**"
]
}
]
}
1 change: 1 addition & 0 deletions cypress/e2e/facility_spec/facility.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe("Facility Creation", () => {
});

beforeEach(() => {
cy.viewport(1280, 720);
cy.restoreLocalStorage();
cy.awaitUrl("/facility");
});
Expand Down
6 changes: 5 additions & 1 deletion cypress/e2e/facility_spec/inventory.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ describe("Inventory Management Section", () => {
beforeEach(() => {
cy.restoreLocalStorage();
cy.awaitUrl("/");
cy.viewport(1280, 720);
cy.intercept("GET", "**/api/v1/facility/**").as("getFacilities");
cy.get("[id='facility-details']").first().click();
cy.get("[id=manage-facility-dropdown]").should("exist").click();
cy.wait("@getFacilities").its("response.statusCode").should("eq", 200);
cy.get("#manage-facility-dropdown button").should("be.visible");
cy.get("[id='manage-facility-dropdown']").scrollIntoView().click();
cy.get("[id=inventory-management]").click();
});

Expand Down
6 changes: 5 additions & 1 deletion cypress/e2e/facility_spec/locations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ describe("Location Management Section", () => {
});

beforeEach(() => {
cy.viewport(1280, 720);
cy.restoreLocalStorage();
cy.awaitUrl("/");
cy.intercept("GET", "**/api/v1/facility/**").as("getFacilities");
cy.get("[id='facility-details']").first().click();
cy.get("[id=manage-facility-dropdown]").should("exist").click();
cy.wait("@getFacilities").its("response.statusCode").should("eq", 200);
cy.get("#manage-facility-dropdown button").should("be.visible");
cy.get("[id='manage-facility-dropdown']").scrollIntoView().click();
cy.get("[id=location-management]").click();
});

Expand Down
46 changes: 31 additions & 15 deletions cypress/e2e/patient_spec/patient_crud.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ describe("Patient Creation with consultation", () => {
});

it("Create a new patient with no consultation", () => {
cy.get("button").should("contain", "Add Patient Details");
cy.get("#add-patient-div").click();
cy.get("#add-patient-details").should("be.visible");
cy.get("#add-patient-details").click();
cy.get("input[name='facilities']")
.type("cypress facility")
.then(() => {
Expand All @@ -35,8 +35,8 @@ describe("Patient Creation with consultation", () => {
cy.get("button").get("#submit").click();
cy.get("#phone_number-div").type(phone_number);
cy.get("#emergency_phone_number-div").type(emergency_phone_number);
cy.get("[data-testid=date-of-birth] button").click();
cy.get("#date-1").click();
cy.get("#date_of_birth").should("be.visible").click();
cy.get("#date-input").click().type("01082023");
cy.get("[data-testid=name] input").type("Test E2E User");
cy.get("[data-testid=Gender] button")
.click()
Expand Down Expand Up @@ -94,16 +94,19 @@ describe("Patient Creation with consultation", () => {
});

it("Edit the patient details", () => {
cy.intercept("GET", "**/facility/*/patient/**").as("getFacilities");
cy.awaitUrl(patient_url + "/update");
cy.wait("@getFacilities").its("response.statusCode").should("eq", 200);
cy.wait(10000);
cy.get("#address").scrollIntoView();
cy.get("#address").should("be.visible");
cy.get("#address").type("Test Patient Address Edited");
cy.get("[data-testid=name] input").clear();
cy.get("[data-testid=name] input").type("Test E2E User Edited");
cy.get("#emergency_phone_number-div")
.clear()
.then(() => {
cy.get("#emergency_phone_number__country").select("IN");
});
cy.get("#emergency_phone_number-div").type("9120330220");
cy.get("#address").clear().type("Test Patient Address Edited");
cy.get("#phone_number-div").clear();
cy.get("#phone_number-div").type("+919846856666");
cy.get("#emergency_phone_number-div").clear();
cy.get("#emergency_phone_number-div").type("+919120330220");
cy.get("#present_health").type("Severe Cough");
cy.get("#ongoing_medication").type("Paracetamol");
cy.get("#allergies").type("Dust");
Expand All @@ -117,7 +120,12 @@ describe("Patient Creation with consultation", () => {
cy.get("#policy_id").type("P123");
cy.get("#insurer_id").type("GICOFINDIA");
cy.get("#insurer_name").type("GICOFINDIA");
cy.get("button").get("[data-testid=submit-button]").click();
cy.get("[data-testid=blood-group] button")
.click()
.then(() => {
cy.get("[role='option']").contains("O+").click();
});
cy.get("button[data-testid='submit-button']").click();
cy.url().should("include", "/patient");
cy.url().then((url) => {
cy.log(url);
Expand All @@ -139,7 +147,6 @@ describe("Patient Creation with consultation", () => {
"+919120330220"
);
const patientDetails_values: string[] = [
"Test Patient Address Edited",
"Severe Cough",
"Paracetamol",
"Dust",
Expand All @@ -155,7 +162,11 @@ describe("Patient Creation with consultation", () => {
});

it("Create a New consultation to existing patient", () => {
cy.intercept("GET", "**/api/v1/patient/**").as("getFacilities");
cy.visit(patient_url + "/consultation");
cy.wait("@getFacilities").its("response.statusCode").should("eq", 200);
cy.get("#history_of_present_illness").should("be.visible");
cy.get("#history_of_present_illness").click().type("histroy");
cy.get("#consultation_status")
.click()
.then(() => {
Expand All @@ -167,13 +178,13 @@ describe("Patient Creation with consultation", () => {
cy.get("[role='option']").contains("ASYMPTOMATIC").click();
});
cy.get("#symptoms").click();
cy.get("#history_of_present_illness").click().type("histroy");

cy.get("#examination_details")
.click()
.type("Examination details and Clinical conditions");
cy.get("#weight").click().type("70");
cy.get("#height").click().type("170");
cy.get("#ip_no").type("192.168.1.11");
cy.get("#patient_no").type("IP007");
cy.get(
"#icd11_diagnoses_object input[placeholder='Select'][role='combobox']"
)
Expand All @@ -190,6 +201,11 @@ describe("Patient Creation with consultation", () => {
cy.contains("button", "Add Prescription Medication")
.should("be.visible")
.click();
cy.intercept("GET", "**/api/v1/medibase/**").as("getFacilities");
cy.get(
"div#medicine_object input[placeholder='Select'][role='combobox']"
).click();
cy.wait("@getFacilities").its("response.statusCode").should("eq", 200);
cy.get("div#medicine_object input[placeholder='Select'][role='combobox']")
.click()
.type("dolo{enter}");
Expand Down
6 changes: 2 additions & 4 deletions cypress/e2e/users_spec/user_crud.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ describe("User management", () => {
cy.get("[name='phone_number']").type(phone_number);
cy.get("[name='alt_phone_number']").type(alt_phone_number);
cy.intercept(/users/).as("check_availability");
cy.get("[id='date_of_birth']").click();
cy.get("div").contains("20").click();
cy.get("[id='year-0']").click();
cy.get("[id='date-1']").click();
cy.get("#date_of_birth").should("be.visible").click();
cy.get("#date-input").click().type("25081999");
cy.get("[name='username']").type(username);
cy.wait("@check_availability").its("response.statusCode").should("eq", 200);
cy.get("[name='password']").type("#@Cypress_test123");
Expand Down
7 changes: 6 additions & 1 deletion cypress/pageobject/Facility/FacilityCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ class FacilityPage {
}

visitUpdateFacilityPage(url: string) {
cy.intercept("GET", "**/api/v1/facility/**").as("getFacilities");
cy.visit(url);
cy.wait("@getFacilities").its("response.statusCode").should("eq", 200);
cy.get("#manage-facility-dropdown button").should("be.visible");
}

fillFacilityName(name: string) {
Expand Down Expand Up @@ -87,7 +90,9 @@ class FacilityPage {
}

clickManageFacilityDropdown() {
cy.get("#manage-facility-dropdown").click();
cy.get("#manage-facility-dropdown button")
.contains("Manage Facility")
.click();
}

clickUpdateFacilityOption() {
Expand Down
Loading

1 comment on commit b91e9cb

@vercel
Copy link

@vercel vercel bot commented on b91e9cb Aug 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

care-storybook – ./

care-storybook-git-master-ohcnetwork.vercel.app
care-storybook-ohcnetwork.vercel.app

Please sign in to comment.