Skip to content

Commit

Permalink
Merge branch 'develop' into test2#fixconsultationurl
Browse files Browse the repository at this point in the history
  • Loading branch information
konavivekramakrishna authored Dec 27, 2023
2 parents 67496cc + 17e7391 commit e7d2c3a
Show file tree
Hide file tree
Showing 16 changed files with 391 additions and 110 deletions.
77 changes: 42 additions & 35 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,6 @@ jobs:
needs: build-staging
name: Deploy to staging GCP cluster
runs-on: ubuntu-latest
- uses: actions/setup-node@v3
with:
node-version: '20'
environment:
name: Staging-GCP
url: https://care-staging.ohc.network/
Expand All @@ -202,15 +199,19 @@ jobs:
token: ${{ secrets.GIT_ACCESS_TOKEN }}
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@v2
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@v2
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
Expand All @@ -233,9 +234,6 @@ jobs:
needs: build-production
name: Deploy to GKE Manipur
runs-on: ubuntu-latest
- uses: actions/setup-node@v3
with:
node-version: '20'
environment:
name: Production-Manipur
url: https://care.mn.gov.in
Expand All @@ -248,14 +246,18 @@ jobs:
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@v2
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@v2
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
Expand All @@ -278,9 +280,6 @@ jobs:
needs: build-production
name: Deploy to GKE Karnataka
runs-on: ubuntu-latest
- uses: actions/setup-node@v3
with:
node-version: '20'
environment:
name: Production-Karnataka
url: https://karnataka.care
Expand All @@ -293,14 +292,18 @@ jobs:
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@v2
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@v2
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
Expand All @@ -323,9 +326,6 @@ jobs:
needs: build-production
name: Deploy to GKE Sikkim
runs-on: ubuntu-latest
- uses: actions/setup-node@v3
with:
node-version: '20'
environment:
name: Production-Sikkim
url: https://care.sikkim.gov.in
Expand All @@ -338,14 +338,18 @@ jobs:
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@v2
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@v2
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
Expand All @@ -368,9 +372,6 @@ jobs:
needs: build-production
name: Deploy to GKE Assam
runs-on: ubuntu-latest
- uses: actions/setup-node@v3
with:
node-version: '20'
environment:
name: Production-Assam
url: https://care.assam.gov.in
Expand All @@ -383,14 +384,18 @@ jobs:
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@v2
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@v2
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
Expand All @@ -413,9 +418,6 @@ jobs:
needs: build-production
name: Deploy to GKE Nagaland
runs-on: ubuntu-latest
- uses: actions/setup-node@v3
with:
node-version: '20'
environment:
name: Production - Nagaland
url: https://care.nagaland.gov.in
Expand All @@ -427,15 +429,19 @@ jobs:
token: ${{ secrets.GIT_ACCESS_TOKEN }}
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@v2
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Get the GKE credentials, so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@v2
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
Expand All @@ -458,9 +464,6 @@ jobs:
needs: build-production
name: Deploy to GKE Meghalaya
runs-on: ubuntu-latest
- uses: actions/setup-node@v3
with:
node-version: '20'
environment:
name: Production-Meghalaya
url: https://care.meghealth.gov.in
Expand All @@ -472,15 +475,19 @@ jobs:
token: ${{ secrets.GIT_ACCESS_TOKEN }}
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@v2
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Get the GKE credentials, so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@v2
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/facility_spec/facility_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ describe("Facility Creation", () => {
.should("be.visible");
// verify the facility homepage
cy.visit("/facility");
cy.get("#removeicon").click();
manageUserPage.typeFacilitySearch(facilityName);
facilityPage.verifyFacilityBadgeContent(facilityName);
manageUserPage.assertFacilityInCard(facilityName);
Expand Down
147 changes: 125 additions & 22 deletions cypress/e2e/facility_spec/locations.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress";
import { AssetPage } from "../../pageobject/Asset/AssetCreation";
import { UserCreationPage } from "../../pageobject/Users/UserCreation";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import FacilityLocation from "../../pageobject/Facility/FacilityLocation";
// import { AssetPagination } from "../../pageobject/Asset/AssetPagination";

describe("Location Management Section", () => {
const assetPage = new AssetPage();
const userCreationPage = new UserCreationPage();
const facilityPage = new FacilityPage();
const facilityLocation = new FacilityLocation();
// const assetPagination = new AssetPagination();
const EXPECTED_LOCATION_ERROR_MESSAGES = [
"Name is required",
"Location Type is required",
];
const EXPECTED_BED_ERROR_MESSAGES = [
"Please enter a name",
"Please select a bed type",
];
const locationName = "Test-location";
const locationDescription = "Test Description";
const locationType = "WARD";
const locationMiddleware = "dev_middleware.coronasafe.live";
const locationModifiedName = "Test Modified location";
const locationModifiedDescription = "Test Modified Description";
const locationModifiedType = "ICU";
const locationModifiedMiddleware = "dev-middleware.coronasafe.live";
const bedName = "Test Bed";
const bedDescrption = "test description";
const bedType = "ICU";
const bedStatus = "Vacant";
const bedModifiedName = "test modified bed";
const bedModifiedDescrption = "test modified description";
const bedModifiedType = "Isolation";
const numberOfBeds = 10;
// const numberOfModifiedBeds = 25;

before(() => {
cy.loginByApi("devdistrictadmin", "Coronasafe@123");
cy.saveLocalStorage();
Expand All @@ -20,28 +56,95 @@ describe("Location Management Section", () => {
cy.get("[id=location-management]").click();
});

it("Adds Location", () => {
cy.contains("Add New Location").click();
cy.get("[name='name']").type("Test Location");
cy.get("textarea[name='description']").type("Test Description");
cy.get("#location-type").click();
cy.get("#location-type-option-ICU").click();
cy.intercept(/\/api\/v1\/facility\/[\w-]+\/asset_location\//).as(
"addLocation"
);
cy.get("button").contains("Add Location").click();
cy.wait("@addLocation").then((interception) => {
switch (interception?.response?.statusCode) {
case 201:
cy.verifyNotification("Location created successfully");
return;
case 400:
cy.verifyNotification(
"Name - Asset location with this name and facility already exists."
);
return;
}
});
it("Adds Location to a facility and modify it", () => {
// add a new location form mandatory error
facilityLocation.clickAddNewLocationButton();
assetPage.clickassetupdatebutton();
userCreationPage.verifyErrorMessages(EXPECTED_LOCATION_ERROR_MESSAGES);
// create a new location
facilityPage.fillFacilityName(locationName);
facilityLocation.fillDescription(locationDescription);
facilityLocation.selectLocationType(locationType);
facilityLocation.fillMiddlewareAddress(locationMiddleware);
assetPage.clickassetupdatebutton();
// verify the reflection
facilityLocation.verifyLocationName(locationName);
facilityLocation.verifyLocationType(locationType);
facilityLocation.verifyLocationDescription(locationDescription);
facilityLocation.verifyLocationMiddleware(locationMiddleware);
// modify the existing data
facilityLocation.clickEditLocationButton();
facilityPage.fillFacilityName(locationModifiedName);
facilityLocation.fillDescription(locationModifiedDescription);
facilityLocation.selectLocationType(locationModifiedType);
facilityLocation.fillMiddlewareAddress(locationModifiedMiddleware);
assetPage.clickassetupdatebutton();
// verify the reflection
facilityLocation.verifyLocationName(locationModifiedName);
facilityLocation.verifyLocationType(locationModifiedType);
facilityLocation.verifyLocationDescription(locationModifiedDescription);
facilityLocation.verifyLocationMiddleware(locationModifiedMiddleware);
});

it("Add Multiple Bed to a facility location and delete a bed", () => {
// create multiple bed and verify
facilityLocation.clickManageBedButton();
facilityLocation.clickAddBedButton();
facilityLocation.enterBedName(bedName);
facilityLocation.enterBedDescription(bedDescrption);
facilityLocation.selectBedType(bedType);
facilityLocation.setMultipleBeds(numberOfBeds);
assetPage.clickassetupdatebutton();
// verify the bed creation
facilityLocation.verifyBedBadge(bedType);
facilityLocation.verifyBedBadge(bedStatus);
facilityLocation.verifyIndividualBedName(bedName, numberOfBeds);
// delete a bed and verify it
facilityLocation.deleteFirstBed();
facilityLocation.deleteBedRequest();
assetPage.clickassetupdatebutton();
facilityLocation.deleteBedRequest();
});

// it("Add Multiple Bed to a facility location and verify pagination", () => {
// // bed creation
// facilityLocation.clickManageBedButton();
// facilityLocation.clickAddBedButton();
// facilityLocation.enterBedName(bedModifiedName);
// facilityLocation.enterBedDescription(bedModifiedDescrption);
// facilityLocation.selectBedType(bedModifiedType);
// facilityLocation.setMultipleBeds(numberOfModifiedBeds);
// assetPage.clickassetupdatebutton();
// // pagination
// assetPagination.navigateToNextPage();
// assetPagination.navigateToPreviousPage();
// }); need to be unblocked upon issue #6906 is solved

it("Add Single Bed to a facility location and modify it", () => {
// mandatory field verification in bed creation
facilityLocation.clickManageBedButton();
facilityLocation.clickAddBedButton();
assetPage.clickassetupdatebutton();
userCreationPage.verifyErrorMessages(EXPECTED_BED_ERROR_MESSAGES);
// create a new single bed and verify
facilityLocation.enterBedName(bedName);
facilityLocation.enterBedDescription(bedDescrption);
facilityLocation.selectBedType(bedType);
assetPage.clickassetupdatebutton();
// Verify the bed creation
facilityLocation.verifyBedNameBadge(bedName);
facilityLocation.verifyBedBadge(bedType);
facilityLocation.verifyBedBadge(bedStatus);
// edit the created bed
facilityLocation.clickEditBedButton();
facilityLocation.enterBedName(bedModifiedName);
facilityLocation.enterBedDescription(bedModifiedDescrption);
facilityLocation.selectBedType(bedModifiedType);
assetPage.clickassetupdatebutton();
// verify the modification
facilityLocation.verifyBedNameBadge(bedModifiedName);
facilityLocation.verifyBedBadge(bedModifiedType);
facilityLocation.verifyBedBadge(bedStatus);
});

afterEach(() => {
Expand Down
Loading

0 comments on commit e7d2c3a

Please sign in to comment.