-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into qa-testing
- Loading branch information
Showing
285 changed files
with
16,115 additions
and
7,924 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
# Whitelabelling envs | ||
|
||
REACT_APP_TITLE="CARE" | ||
REACT_APP_META_DESCRIPTION="CoronaSafe Network is an open-source public utility designed by a multi-disciplinary team of innovators and volunteers. CoronaSafe Care is a Digital Public Good recognised by United Nations." | ||
REACT_APP_TITLE=CARE | ||
REACT_APP_META_DESCRIPTION=CoronaSafe Network is an open-source public utility designed by a multi-disciplinary team of innovators and volunteers. CoronaSafe Care is a Digital Public Good recognised by United Nations. | ||
REACT_APP_COVER_IMAGE=https://cdn.coronasafe.network/care_logo.svg | ||
REACT_APP_COVER_IMAGE_ALT=https://cdn.coronasafe.network/care_logo.svg | ||
REACT_APP_CONFIG="" | ||
REACT_PUBLIC_URL="https://care.coronasafe.in" | ||
REACT_PUBLIC_URL=https://care.coronasafe.in | ||
|
||
# Dev envs | ||
ESLINT_NO_DEV_ERRORS=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,6 +180,48 @@ jobs: | |
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||
deploy-staging-gcp: | ||
needs: build-staging | ||
name: Deploy to staging GCP cluster | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: Staging-GCP | ||
url: https://care-staging.ohc.network/ | ||
steps: | ||
- name: Checkout Kube Config | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: coronasafe/care-staging-gcp | ||
token: ${{ secrets.GIT_ACCESS_TOKEN }} | ||
path: kube | ||
ref: main | ||
|
||
# Setup gcloud CLI | ||
- 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@fb08709ba27618c31c09e014e1d8364b02e5042e | ||
with: | ||
cluster_name: ${{ secrets.GKE_CLUSTER }} | ||
location: ${{ secrets.GKE_ZONE }} | ||
credentials: ${{ secrets.GKE_SA_KEY }} | ||
|
||
- name: install kubectl | ||
uses: azure/[email protected] | ||
with: | ||
version: "v1.23.6" | ||
id: install | ||
|
||
- name: Deploy Care Fe Production | ||
run: | | ||
mkdir -p $HOME/.kube/ | ||
cd kube/deployments/ | ||
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml | ||
kubectl apply -f care-fe.yaml | ||
deploy-production-manipur: | ||
needs: build-production | ||
name: Deploy to GKE Manipur | ||
|
@@ -389,3 +431,45 @@ jobs: | |
cd kube/deployments/ | ||
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml | ||
kubectl apply -f care-fe.yaml | ||
deploy-production-meghalaya: | ||
needs: build-production | ||
name: Deploy to GKE Meghalaya | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: Production-Meghalaya | ||
url: https://care.meghealth.gov.in | ||
steps: | ||
- name: Checkout Kube Config | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: coronasafe/ml-care-infra | ||
token: ${{ secrets.GIT_ACCESS_TOKEN }} | ||
path: kube | ||
ref: main | ||
|
||
# Setup gcloud CLI | ||
- 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@fb08709ba27618c31c09e014e1d8364b02e5042e | ||
with: | ||
cluster_name: ${{ secrets.GKE_CLUSTER }} | ||
location: ${{ secrets.GKE_ZONE }} | ||
credentials: ${{ secrets.GKE_SA_KEY }} | ||
|
||
- name: install kubectl | ||
uses: azure/[email protected] | ||
with: | ||
version: "v1.23.6" | ||
id: install | ||
|
||
- name: Deploy Care Fe Production | ||
run: | | ||
mkdir -p $HOME/.kube/ | ||
cd kube/deployments/ | ||
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml | ||
kubectl apply -f care-fe.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Lint Code Base | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- master | ||
merge_group: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: read | ||
statuses: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "18" | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run lint | ||
run: npm run lint -- --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ public/build-meta.json | |
# Using NPM | ||
yarn.lock | ||
pnpm-lock.yaml | ||
bun.lockb | ||
|
||
# Cypress | ||
cypress/downloads | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/// <reference types="cypress" /> | ||
|
||
import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; | ||
import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; | ||
import { AssetQRScanPage } from "../../pageobject/Asset/AssetQRScan"; | ||
import { AssetPagination } from "../../pageobject/Asset/AssetPagination"; | ||
import { AssetFilters } from "../../pageobject/Asset/AssetFilters"; | ||
import { AssetPage } from "../../pageobject/Asset/AssetCreation"; | ||
import LoginPage from "../../pageobject/Login/LoginPage"; | ||
import { v4 as uuidv4 } from "uuid"; | ||
|
||
describe("Asset Tab", () => { | ||
const assetSearchPage = new AssetSearchPage(); | ||
const assetQRScanPage = new AssetQRScanPage(); | ||
const assetPagination = new AssetPagination(); | ||
const assetFilters = new AssetFilters(); | ||
const assetPage = new AssetPage(); | ||
const loginPage = new LoginPage(); | ||
const assetName = "Dummy Camera 10"; | ||
const qrCode = uuidv4(); | ||
const serialNumber = Math.floor(Math.random() * 10 ** 10).toString(); | ||
|
||
before(() => { | ||
loginPage.loginAsDisctrictAdmin(); | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.awaitUrl("/assets"); | ||
}); | ||
|
||
// search for a element | ||
|
||
it("Search Asset Name/QR_ID/Serial_number", () => { | ||
assetSearchPage.typeSearchKeyword(assetName); | ||
assetSearchPage.pressEnter(); | ||
assetSearchPage.verifyBadgeContent(assetName); | ||
assetSearchPage.clickAssetByName(assetName); | ||
assetSearchPage.clickUpdateButton(); | ||
assetSearchPage.clearAndTypeQRCode(qrCode); | ||
assetSearchPage.clearAndTypeSerialNumber(serialNumber); | ||
assetSearchPage.clickAssetSubmitButton(); | ||
assetSearchPage.visitAssetsPage(); | ||
assetSearchPage.typeSearchKeyword(qrCode); | ||
assetSearchPage.pressEnter(); | ||
assetSearchPage.verifyAssetListContains(assetName); | ||
assetSearchPage.verifyBadgeContent(qrCode); | ||
assetSearchPage.typeSearchKeyword(serialNumber); | ||
assetSearchPage.verifyAssetListContains(assetName); | ||
assetSearchPage.verifyBadgeContent(serialNumber); | ||
}); | ||
|
||
// scan a asset qr code | ||
|
||
it("Scan Asset QR", () => { | ||
assetQRScanPage.scanAssetQR(); | ||
}); | ||
|
||
// filter the asset and verify the badges are there | ||
|
||
it("Filter Asset", () => { | ||
assetFilters.filterAssets( | ||
"Dummy Facility 1", | ||
"INTERNAL", | ||
"ACTIVE", | ||
"ONVIF Camera", | ||
"Camera Loc" | ||
); | ||
assetFilters.clickadvancefilter(); | ||
assetFilters.clickslideoverbackbutton(); // to verify the back button doesn't clear applied filters | ||
assetFilters.assertFacilityText("Dummy Facility 1"); | ||
assetFilters.assertAssetTypeText("INTERNAL"); | ||
assetFilters.assertAssetClassText("ONVIF"); | ||
assetFilters.assertStatusText("ACTIVE"); | ||
assetFilters.assertLocationText("Camera Loc"); | ||
assetFilters.clickadvancefilter(); | ||
assetFilters.clearFilters(); | ||
}); | ||
|
||
// Verify the pagination in the page | ||
|
||
it("Next/Previous Page", () => { | ||
assetPagination.navigateToNextPage(); | ||
assetPagination.navigateToPreviousPage(); | ||
}); | ||
|
||
it("Import new asset", () => { | ||
assetPage.selectassetimportbutton(); | ||
assetPage.selectImportOption(); | ||
assetPage.selectImportFacility("Dummy Facility 1"); | ||
assetPage.importAssetFile(); | ||
assetPage.selectImportLocation("Camera Locations"); | ||
assetPage.clickImportAsset(); | ||
}); | ||
|
||
it("verify imported asset", () => { | ||
assetSearchPage.typeSearchKeyword("New Test Asset"); | ||
assetSearchPage.pressEnter(); | ||
assetSearchPage.verifyAssetIsPresent("New Test Asset"); | ||
}); | ||
|
||
it("Export asset", () => { | ||
assetPage.selectassetimportbutton(); | ||
assetPage.selectjsonexportbutton(); | ||
assetPage.selectassetimportbutton(); | ||
assetPage.selectcsvexportbutton(); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
}); |
Oops, something went wrong.