Skip to content

Commit

Permalink
Revert "Production Release 97 | March week 1 2024 (#7337)"
Browse files Browse the repository at this point in the history
This reverts commit 9c4b91d.
  • Loading branch information
gigincg committed Mar 6, 2024
1 parent 9c4b91d commit aa43cd3
Show file tree
Hide file tree
Showing 64 changed files with 4,377 additions and 4,948 deletions.
46 changes: 1 addition & 45 deletions .github/workflows/cypress.yaml
Expand Up @@ -42,25 +42,14 @@ jobs:
max_attempts: 5
command: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:9000
on_retry_command: sleep 5

- name: Determine PR Origin
id: pr_origin
run: echo "::set-output name=is_forked::$( echo ${{ github.event.pull_request.head.repo.fork }})"

- name: Install dependencies 📦
run: npm install

- name: Build & Compile rescript files ⚙️
run: "npm run build"

- name: Install Specific Chrome Version
run: |
sudo apt-get install -y wget
sudo wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get install ./google-chrome-stable_current_amd64.deb
- name: Cypress run for Non-Forked PRs 🥬
if: steps.pr_origin.outputs.is_forked == 'false'
- name: Cypress run 🥬
uses: cypress-io/github-action@v5
with:
env: SKIP_PREFLIGHT_CHECK=true
Expand All @@ -71,7 +60,6 @@ jobs:
browser: chrome
record: true
parallel: true
group: "UI-Chrome"
env:
CARE_API: http://localhost:9000
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
Expand All @@ -80,41 +68,9 @@ jobs:
COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}}
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}

- name: Cypress run for Forked PRs 🥬
if: steps.pr_origin.outputs.is_forked == 'true'
uses: cypress-io/github-action@v5
with:
env: SKIP_PREFLIGHT_CHECK=true
install: false
start: "npx vite preview --host"
wait-on: "http://localhost:4000"
wait-on-timeout: 300
browser: chrome
record: true
parallel: true
group: "UI-Chrome"
env:
CYPRESS_SPLIT_TESTS: "true"
CARE_API: http://localhost:9000
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}}
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}
SPLIT: ${{ strategy.job-total }}
SPLIT_INDEX: ${{ strategy.job-index }}

- name: Upload cypress screenshots on failure 📸
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots

- name: Upload cypress videos 📹
uses: actions/upload-artifact@v3
if: steps.pr_origin.outputs.is_forked == 'true'
with:
name: cypress-videos
path: cypress/videos

2 changes: 1 addition & 1 deletion .github/workflows/thank-you.yml
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/github-script@v6.3.3
with:
script: |
const thankyouNote = 'Your efforts have helped advance digital healthcare and TeleICU systems. :rocket: Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! :raised_hands:'
const thankyouNote = 'We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us :1st_place_medal:. We always welcome your contribution :slightly_smiling_face:, so feel free to contribute to anything anytime, and never lose that spirit of innovation :raised_hands:.'
const options = {
issue_number: context.issue.number,
owner: context.repo.owner,
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Open Healthcare Network
Copyright (c) 2020 Corona Safe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 0 additions & 6 deletions cypress.config.ts
@@ -1,6 +1,5 @@
import { defineConfig } from "cypress";
import fs from "fs";
import cypressSplit from "cypress-split";

export default defineConfig({
projectId: "wf7d2m",
Expand All @@ -20,11 +19,6 @@ export default defineConfig({
return null;
},
});

if (process.env.CYPRESS_SPLIT_TESTS === "true") {
cypressSplit(on, config);
}

return config;
},
baseUrl: "http://localhost:4000",
Expand Down
32 changes: 0 additions & 32 deletions cypress/e2e/auth_spec/redirect.cy.ts

This file was deleted.

11 changes: 0 additions & 11 deletions cypress/e2e/facility_spec/facility_creation.cy.ts
Expand Up @@ -136,30 +136,25 @@ describe("Facility Creation", () => {
facilityPage.fillExpectedDTypeCylinderRequirement(oxygenExpected);
facilityPage.selectLocation("Kochi, Kerala");
facilityPage.submitForm();
cy.closeNotification();
// create multiple bed capacity and verify card reflection
facilityPage.selectBedType("Oxygen beds");
facilityPage.fillTotalCapacity(bedCapacity);
facilityPage.fillCurrentlyOccupied(bedOccupancy);
facilityPage.clickbedcapcityaddmore();
cy.closeNotification();
facilityPage.selectBedType("Ordinary Bed");
facilityPage.fillTotalCapacity(bedCapacity);
facilityPage.fillCurrentlyOccupied(bedOccupancy);
facilityPage.clickbedcapcityaddmore();
cy.closeNotification();
facilityPage.getTotalBedCapacity().contains(totalCapacity);
facilityPage.getTotalBedCapacity().contains(totalOccupancy);
facilityPage.clickcancelbutton();
// create multiple bed capacity and verify card reflection
facilityPage.selectAreaOfSpecialization("General Medicine");
facilityPage.fillDoctorCount(doctorCapacity);
facilityPage.clickdoctorcapacityaddmore();
cy.closeNotification();
facilityPage.selectAreaOfSpecialization("Pulmonology");
facilityPage.fillDoctorCount(doctorCapacity);
facilityPage.clickdoctorcapacityaddmore();
cy.closeNotification();
facilityPage.getTotalDoctorCapacity().contains(doctorCapacity);
facilityPage.clickcancelbutton();
facilityPage.verifyfacilitynewurl();
Expand Down Expand Up @@ -191,12 +186,6 @@ describe("Facility Creation", () => {
facilityPage.getFacilityTotalBedCapacity().contains(totalOccupancy);
facilityPage.getFacilityTotalDoctorCapacity().scrollIntoView();
facilityPage.getFacilityTotalDoctorCapacity().contains(totalDoctor);
// verify the delete functionality
cy.get("#manage-facility-dropdown button").scrollIntoView();
facilityPage.clickManageFacilityDropdown();
facilityPage.clickDeleteFacilityOption();
facilityPage.confirmDeleteFacility();
cy.verifyNotification("Facility deleted successfully");
});

it("Create a new facility with single bed and doctor capacity", () => {
Expand Down
5 changes: 0 additions & 5 deletions cypress/e2e/facility_spec/facility_homepage.cy.ts
Expand Up @@ -37,9 +37,6 @@ describe("Facility Homepage Function", () => {

it("Verify the Facility card button redirection", () => {
// view cns button
manageUserPage.typeFacilitySearch(facilityName);
facilityPage.verifyFacilityBadgeContent(facilityName);
manageUserPage.assertFacilityInCard(facilityName);
facilityHome.clickViewCnsButton();
facilityHome.verifyCnsUrl();
facilityHome.navigateBack();
Expand Down Expand Up @@ -124,8 +121,6 @@ describe("Facility Homepage Function", () => {
facilityPage.selectLocalBody(localBody);
userPage.applyFilter();
// go to cns page in the facility details page
manageUserPage.typeFacilitySearch(facilityName);
facilityPage.verifyFacilityBadgeContent(facilityName);
manageUserPage.assertFacilityInCard(facilityName);
facilityHome.clickViewFacilityDetails();
facilityHome.clickFacilityCnsButton();
Expand Down
9 changes: 9 additions & 0 deletions cypress/e2e/facility_spec/facility_manage.cy.ts
Expand Up @@ -161,6 +161,15 @@ describe("Facility Manage Functions", () => {
);
});

it("Delete a existing facility and verify the error message", () => {
facilityPage.clickManageFacilityDropdown();
facilityPage.clickDeleteFacilityOption();
facilityPage.confirmDeleteFacility();
facilityManage.verifySuccessMessageVisibilityAndContent(
"You do not have permission to perform this action."
);
});

afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
4 changes: 3 additions & 1 deletion cypress/pageobject/Facility/FacilityCreation.ts
Expand Up @@ -289,7 +289,9 @@ class FacilityPage {
}

confirmDeleteFacility() {
cy.submitButton("Delete");
cy.intercept("DELETE", "**/api/v1/facility/**").as("deleteFacility");
cy.get("#submit").contains("Delete").click();
cy.wait("@deleteFacility").its("response.statusCode").should("eq", 403);
}

selectLocation(location: string) {
Expand Down
14 changes: 0 additions & 14 deletions cypress/pageobject/Login/LoginPage.ts
Expand Up @@ -10,23 +10,9 @@ class LoginPage {
cy.loginByApi("devdoctor", "Coronasafe@123");
}

loginAsStaff(): void {
cy.loginByApi("staffdev", "Coronasafe@123");
}

loginManuallyAsDistrictAdmin(): void {
cy.get("input[id='username']").type("devdistrictadmin");
cy.get("input[id='password']").type("Coronasafe@123");
cy.get("button").contains("Login").click();
}

login(username: string, password: string): void {
cy.loginByApi(username, password);
}

ensureLoggedIn(): void {
cy.get("p").contains("Sign Out").should("exist");
}
}

export default LoginPage;

0 comments on commit aa43cd3

Please sign in to comment.