-
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 rithviknishad/improve-live-feed
- Loading branch information
Showing
82 changed files
with
3,273 additions
and
2,240 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 |
---|---|---|
|
@@ -11,6 +11,10 @@ on: | |
- master | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
IMAGE_NAME: care_fe | ||
AWS_DEFAULT_REGION: ap-south-1 | ||
|
@@ -431,3 +435,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
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,88 @@ | ||
// FacilityCreation | ||
import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; | ||
import LoginPage from "../../pageobject/Login/LoginPage"; | ||
import FacilityHome from "../../pageobject/Facility/FacilityHome"; | ||
import ManageUserPage from "../../pageobject/Users/ManageUserPage"; | ||
import FacilityPage from "../../pageobject/Facility/FacilityCreation"; | ||
import { UserPage } from "../../pageobject/Users/UserSearch"; | ||
|
||
describe("Facility Homepage Function", () => { | ||
const loginPage = new LoginPage(); | ||
const facilityHome = new FacilityHome(); | ||
const facilityPage = new FacilityPage(); | ||
const manageUserPage = new ManageUserPage(); | ||
const userPage = new UserPage(); | ||
const facilitiesAlias = "downloadFacilitiesCSV"; | ||
const capacitiesAlias = "downloadCapacitiesCSV"; | ||
const doctorsAlias = "downloadDoctorsCSV"; | ||
const triagesAlias = "downloadTriagesCSV"; | ||
const facilityname = "Dummy Facility 1"; | ||
const statename = "Kerala"; | ||
const district = "Ernakulam"; | ||
const facilitytype = "Private Hospital"; | ||
|
||
before(() => { | ||
loginPage.loginAsDisctrictAdmin(); | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.awaitUrl("/facility"); | ||
}); | ||
|
||
it("Verify the functionality of advance filter", () => { | ||
userPage.clickAdvancedFilters(); | ||
facilityPage.selectState(statename); | ||
facilityPage.selectDistrict(district); | ||
// facilityPage.selectLocalBody("Anthikad Grama"); current dummy data have issue in local body | ||
facilityPage.clickUpdateFacilityType(facilitytype); | ||
userPage.applyFilter(); | ||
facilityPage.verifyStateBadgeContent(statename); | ||
facilityPage.verifyDistrictBadgeContent(district); | ||
facilityPage.verifyFacilityTypeBadgeContent(facilitytype); | ||
manageUserPage.assertFacilityInCard(facilityname); | ||
userPage.clearFilters(); | ||
userPage.verifyDataTestIdNotVisible("State"); | ||
userPage.verifyDataTestIdNotVisible("District"); | ||
userPage.verifyDataTestIdNotVisible("Facility type"); | ||
}); | ||
|
||
it("Search a facility in homepage", () => { | ||
manageUserPage.typeFacilitySearch(facilityname); | ||
facilityPage.verifyFacilityBadgeContent(facilityname); | ||
manageUserPage.assertFacilityInCard(facilityname); | ||
facilityHome.verifyURLContains(facilityname); | ||
}); | ||
|
||
it("Verify Facility Export Functionality", () => { | ||
// Download the Facilities CSV | ||
facilityHome.csvDownloadIntercept(facilitiesAlias, ""); | ||
facilityHome.clickExportButton(); | ||
facilityHome.clickMenuItem("Facilities"); | ||
facilityHome.verifyDownload(facilitiesAlias); | ||
facilityHome.clickSearchButton(); // to avoid flaky test, as sometimes, the test is unable to focus on the object | ||
// Download the Capacities CSV | ||
facilityHome.csvDownloadIntercept(capacitiesAlias, "&capacity"); | ||
facilityHome.clickExportButton(); | ||
facilityHome.clickMenuItem("Capacities"); | ||
facilityHome.verifyDownload(capacitiesAlias); | ||
facilityHome.clickSearchButton(); | ||
// Download the Doctors CSV | ||
facilityHome.csvDownloadIntercept(doctorsAlias, "&doctors"); | ||
facilityHome.clickExportButton(); | ||
facilityHome.clickMenuItem("Doctors"); | ||
facilityHome.verifyDownload(doctorsAlias); | ||
facilityHome.clickSearchButton(); | ||
// Download the Triages CSV | ||
facilityHome.csvDownloadIntercept(triagesAlias, "&triage"); | ||
facilityHome.clickExportButton(); | ||
facilityHome.clickMenuItem("Triages"); | ||
facilityHome.verifyDownload(triagesAlias); | ||
facilityHome.clickSearchButton(); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// cypress/support/pageObjects/FacilityHome.ts | ||
|
||
class FacilityHome { | ||
// Selectors | ||
exportButton = "#export-button"; | ||
searchButton = "#search"; | ||
menuItem = "[role='menuitem']"; | ||
|
||
// Operations | ||
clickExportButton() { | ||
cy.get(this.exportButton).click(); | ||
} | ||
|
||
clickSearchButton() { | ||
cy.get(this.searchButton).click(); | ||
} | ||
|
||
clickMenuItem(itemName: string) { | ||
cy.get(this.menuItem).contains(itemName).click(); | ||
} | ||
|
||
csvDownloadIntercept(alias: string, queryParam: string) { | ||
cy.intercept("GET", `**/api/v1/facility/?csv${queryParam}`).as(alias); | ||
} | ||
|
||
verifyDownload(alias: string) { | ||
cy.wait(`@${alias}`).its("response.statusCode").should("eq", 200); | ||
} | ||
|
||
getURL() { | ||
return cy.url(); | ||
} | ||
|
||
verifyURLContains(searchText) { | ||
const encodedText = encodeURIComponent(searchText).replace(/%20/g, "+"); | ||
this.getURL().should("include", `search=${encodedText}`); | ||
} | ||
} | ||
|
||
export default FacilityHome; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.