Skip to content

Commit

Permalink
Cypress: Fixes & Refactoring (ohcnetwork#3798)
Browse files Browse the repository at this point in the history
* Create main.yml

* Fix main.yml errors

* Update main.yml

* Update and rename main.yml to merge_upstream.yml

* Update merge_upstream.yml

* Update merge_upstream.yml

* Refactor cypress workflow

- Change to ubuntu-latest
- Switch to npm from yarn
- Give appropriate names for each step in workflow

* Fix patient crud error on Add Patient button

* Remove accidentally added workflow

* Delete stale.yml (ohcnetwork#3782)

* feat: added github stale action (ohcnetwork#3785)

* Made the teleicuvitalcard responsive (ohcnetwork#3669)

* Made TeleViatlsCard responsive

* Minor enhancement

* fix buggy redirect after clicking on cancel button in add more bed types (ohcnetwork#3710)

* fix buggy redirect after clicking on cancel button in add more bed types

* fix: deepscan issues

* Update packages and remove obsolete dependencies (ohcnetwork#3748)

* Remove nonessential packages

* Update packages having a minor version change

* Add back autoprefixer

* Fix for google maps

* Change error message for offline camera (ohcnetwork#3789)

* Minor UI enhacement in Patients page for extreme small devices and some ranges (ohcnetwork#3779)

* Use `Inter` font as the sans font (ohcnetwork#3683)

* Adds `Inter` as sans font

* fix overweighted font usages

* correct font weights

* correct font weights

* Fix login page title overflow

* Adds fallback to `sans-serif`

Co-authored-by: Bodhish Thomas <bodhish@gmail.com>

* Update src/style/index.css

Co-authored-by: Bodhish Thomas <bodhish@gmail.com>

* fix syntax

* fix typo

Co-authored-by: Bodhish Thomas <bodhish@gmail.com>

* Patient Category Colors (ohcnetwork#3728)

* patient category type

* show category in patient list page

* move colors to tailwind config for app wide access

* category on info card

* fix issue with classes skipped from build

* category on patient profile

* patient info card, move category above patient photo

* Revert "patient info card, move category above patient photo"

This reverts commit 9dc5d55.

* Patient Review feature fixes (ohcnetwork#3584)

* Add review_interval and review badges

* Change label to Review before

* Update src/Components/Patient/DailyRounds.tsx

Co-authored-by: Khavin Shankar <khavinshankar@gmail.com>

* Upgrade cypress to v10.10.0

* Fix Error in facility create with adding doctor

* Fix `parseInt` parameter error in patient crud

* Add emojis

Co-authored-by: Khavin Shankar <khavinshankar@gmail.com>
Co-authored-by: ARYAN PATEL <patelaryan7751@gmail.com>
Co-authored-by: Pragati Bhattad <55177805+Pragati1610@users.noreply.github.com>
Co-authored-by: Ashesh <3626859+Ashesh3@users.noreply.github.com>
Co-authored-by: Rithvik Nishad <rithvikn2001@gmail.com>
Co-authored-by: Bodhish Thomas <bodhish@gmail.com>
  • Loading branch information
7 people committed Oct 22, 2022
1 parent 22b34bf commit a2d8420
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 38 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,57 @@ on:

jobs:
cypress-run:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout 📥
uses: actions/checkout@v3

- name: Checkout care
- name: Checkout care 📥
uses: actions/checkout@v3
with:
repository: coronasafe/care
path: care

- name: Docker Layer Caching
- name: Docker Layer Caching 🍥
uses: satackey/action-docker-layer-caching@v0.0.11

- name: Compose Up Care
- name: Run docker compose up on care 🐳
run: cd care && touch .env && make build && make up && cd .. && sleep 30s
# Voluntarily kept 30 seconds delay to wait for migrations to complete.

- run: docker exec care python manage.py collectstatic
- run: docker exec care python manage.py load_dummy_data
- name: Run Django collectstatic and load dummy data on care 🐍
run: |
docker exec care python manage.py collectstatic
docker exec care python manage.py load_dummy_data
- name: Check if care is up
- name: Check care is up
run: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:9000

- name: Replace proxy with local care
- name: Change api proxy url 📝
run: 'sed --in-place "s^\"proxy\": .*,^\"proxy\": \"http://localhost:9000\",^g" package.json'

- run: yarn install
- name: Cypress run
- name: Install dependencies 📦
run: npm install --legacy-peer-deps

- name: Cypress run 🥬
uses: cypress-io/github-action@v4
with:
install: false
start: yarn start
start: npm run start
wait-on: "http://localhost:4000"
wait-on-timeout: 300
browser: electron
- uses: actions/upload-artifact@v2

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

# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v2
- name: Upload cypress videos 📹
uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos
Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/facility_spec/facility.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,15 @@ describe("Facility", () => {
cy.get("[id=bed-capacity-cancel]").click();

// add doctor information
cy.get("button")
.should("contain", "Add Doctor Types")
.contains("Add Doctor Types")
.click({ force: true });
cy.url().should("include", "doctor");
cy.get("[id=area-of-specialization]").select("1");
cy.get("[id=count]").type("15");
cy.get("[id=doctor-save").click();
cy.verifyNotification("Doctor count added successfully");

cy.url().should("include", "doctor");
cy.get("[id=doctor-cancel").click();
cy.url().then((url) => {
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/patient_spec/patient_crud.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress";

const username = "devdistrictadmin";
const password = "Coronasafe@123";
const phone_number = "9" + parseInt(Math.random() * 10 ** 9).toString();
const phone_number = "9" + parseInt((Math.random() * 10 ** 9).toString());
const emergency_phone_number = "9430123487";
let patient_url = "";

Expand Down Expand Up @@ -50,8 +50,8 @@ describe("Patient Creation", () => {
emergency_phone_number,
{ delay: 100 }
);
cy.get("[data-testid=pincode] input").click();
cy.get("[data-testid=submit-button]").click();
cy.wait(1000);
cy.get("button").get("[data-testid=submit-button]").click();
cy.url().should("include", "/consultation");
cy.url().then((url) => {
cy.log(url);
Expand Down
34 changes: 16 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"@typescript-eslint/eslint-plugin": "^5.13.0",
"@typescript-eslint/parser": "^5.13.0",
"autoprefixer": "^10.4.12",
"cypress": "^10.6.0",
"cypress": "^10.10.0",
"cypress-localstorage-commands": "^2.1.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.5.0",
Expand Down

1 comment on commit a2d8420

@vercel
Copy link

@vercel vercel bot commented on a2d8420 Oct 22, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.