-
Notifications
You must be signed in to change notification settings - Fork 484
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 consultation/route-to-facility
- Loading branch information
Showing
129 changed files
with
7,249 additions
and
3,048 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
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 | ||
|
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,199 @@ | ||
import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; | ||
import LoginPage from "../../pageobject/Login/LoginPage"; | ||
import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch"; | ||
import FacilityPage from "../../pageobject/Facility/FacilityCreation"; | ||
import { UserPage } from "../../pageobject/Users/UserSearch"; | ||
import { UserCreationPage } from "../../pageobject/Users/UserCreation"; | ||
import { | ||
emergency_phone_number, | ||
phone_number, | ||
} from "../../pageobject/constants"; | ||
|
||
describe("User Creation", () => { | ||
const userPage = new UserPage(); | ||
const loginPage = new LoginPage(); | ||
const userCreationPage = new UserCreationPage(); | ||
const facilityPage = new FacilityPage(); | ||
const assetSearchPage = new AssetSearchPage(); | ||
const fillFacilityName = "Dummy Facility 1"; | ||
const makeid = (length: number) => { | ||
let result = ""; | ||
const characters = "abcdefghijklmnopqrstuvwxyz0123456789"; | ||
const charactersLength = characters.length; | ||
for (let i = 0; i < length; i++) { | ||
result += characters.charAt(Math.floor(Math.random() * charactersLength)); | ||
} | ||
return result; | ||
}; | ||
const username = makeid(25); | ||
const alreadylinkedusersviews = [ | ||
"devdoctor", | ||
"devstaff2", | ||
"devdistrictadmin", | ||
]; | ||
const EXPECTED_ERROR_MESSAGES = [ | ||
"Please select the User Type", | ||
"Please enter valid phone number", | ||
"Please enter the username", | ||
"Please enter date in YYYY/MM/DD format", | ||
"Please enter the password", | ||
"Confirm password is required", | ||
"First Name is required", | ||
"Last Name is required", | ||
"Please enter a valid email address", | ||
"Please select the Gender", | ||
"Please select the state", | ||
"Please select the district", | ||
"Please select the local body", | ||
]; | ||
|
||
const EXPECTED_PROFILE_ERROR_MESSAGES = [ | ||
"Field is required", | ||
"Field is required", | ||
"This field is required", | ||
"Please enter valid phone number", | ||
"This field is required", | ||
"This field is required", | ||
]; | ||
|
||
before(() => { | ||
loginPage.loginAsDisctrictAdmin(); | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.awaitUrl("/users"); | ||
}); | ||
|
||
it("Update the existing user profile and verify its reflection", () => { | ||
userCreationPage.clickElementById("profilenamelink"); | ||
userCreationPage.verifyElementContainsText( | ||
"username-profile-details", | ||
"devdistrictadmin" | ||
); | ||
userCreationPage.clickElementById("edit-cancel-profile-button"); | ||
userCreationPage.typeIntoElementByIdPostClear( | ||
"firstName", | ||
"District Editted" | ||
); | ||
userCreationPage.typeIntoElementByIdPostClear("lastName", "Cypress"); | ||
userCreationPage.typeIntoElementByIdPostClear("age", "22"); | ||
userCreationPage.selectDropdownOption("gender", "Male"); | ||
userCreationPage.typeIntoElementByIdPostClear( | ||
"phoneNumber", | ||
"+91" + phone_number | ||
); | ||
userCreationPage.typeIntoElementByIdPostClear( | ||
"altPhoneNumber", | ||
"+91" + emergency_phone_number | ||
); | ||
userCreationPage.typeIntoElementByIdPostClear("email", "[email protected]"); | ||
userCreationPage.typeIntoElementByIdPostClear("weekly_working_hours", "14"); | ||
userCreationPage.clickElementById("submit"); | ||
userCreationPage.verifyElementContainsText( | ||
"contactno-profile-details", | ||
"+91" + phone_number | ||
); | ||
userCreationPage.verifyElementContainsText( | ||
"whatsapp-profile-details", | ||
"+91" + emergency_phone_number | ||
); | ||
userCreationPage.verifyElementContainsText( | ||
"firstname-profile-details", | ||
"District Editted" | ||
); | ||
userCreationPage.verifyElementContainsText( | ||
"lastname-profile-details", | ||
"Cypress" | ||
); | ||
userCreationPage.verifyElementContainsText("age-profile-details", "22"); | ||
userCreationPage.verifyElementContainsText( | ||
"emailid-profile-details", | ||
"[email protected]" | ||
); | ||
userCreationPage.verifyElementContainsText( | ||
"gender-profile-details", | ||
"Male" | ||
); | ||
userCreationPage.verifyElementContainsText( | ||
"averageworkinghour-profile-details", | ||
"14" | ||
); | ||
}); | ||
|
||
it("Update the existing user profile Form Mandatory File Error", () => { | ||
userCreationPage.clickElementById("profilenamelink"); | ||
userCreationPage.clickElementById("edit-cancel-profile-button"); | ||
userCreationPage.clearIntoElementById("firstName"); | ||
userCreationPage.clearIntoElementById("lastName"); | ||
userCreationPage.clearIntoElementById("age"); | ||
userCreationPage.clearIntoElementById("phoneNumber"); | ||
userCreationPage.clearIntoElementById("altPhoneNumber"); | ||
userCreationPage.clearIntoElementById("weekly_working_hours"); | ||
userCreationPage.clickElementById("submit"); | ||
userCreationPage.verifyErrorMessages(EXPECTED_PROFILE_ERROR_MESSAGES); | ||
}); | ||
|
||
it("create new user and verify reflection", () => { | ||
userCreationPage.clickElementById("addUserButton"); | ||
userCreationPage.selectFacility("Dummy Shifting Center"); | ||
userCreationPage.typeIntoElementById("username", username); | ||
userCreationPage.typeIntoElementById("password", "Test@123"); | ||
userCreationPage.selectHomeFacility("Dummy Shifting Center"); | ||
userCreationPage.typeIntoElementById("phone_number", phone_number); | ||
userCreationPage.setInputDate("date_of_birth", "date-input", "25081999"); | ||
userCreationPage.selectDropdownOption("user_type", "Doctor"); | ||
userCreationPage.typeIntoElementById("c_password", "Test@123"); | ||
userCreationPage.typeIntoElementById("doctor_qualification", "MBBS"); | ||
userCreationPage.typeIntoElementById("doctor_experience_commenced_on", "2"); | ||
userCreationPage.typeIntoElementById( | ||
"doctor_medical_council_registration", | ||
"123456789" | ||
); | ||
userCreationPage.typeIntoElementById("first_name", "cypress test"); | ||
userCreationPage.typeIntoElementById("last_name", "staff user"); | ||
userCreationPage.typeIntoElementById("email", "[email protected]"); | ||
userCreationPage.selectDropdownOption("gender", "Male"); | ||
userCreationPage.selectDropdownOption("state", "Kerala"); | ||
userCreationPage.selectDropdownOption("district", "Ernakulam"); | ||
userCreationPage.clickElementById("submit"); | ||
userCreationPage.verifyNotification("User added successfully"); | ||
userPage.typeInSearchInput(username); | ||
userPage.checkUsernameText(username); | ||
userCreationPage.verifyElementContainsText("name", "cypress test"); | ||
userCreationPage.verifyElementContainsText("role", "Doctor"); | ||
userCreationPage.verifyElementContainsText("district", "Ernakulam"); | ||
userCreationPage.verifyElementContainsText( | ||
"home_facility", | ||
"Dummy Shifting Center" | ||
); | ||
userCreationPage.verifyElementContainsText("doctor-qualification", "MBBS"); | ||
userCreationPage.verifyElementContainsText("doctor-experience", "2"); | ||
userCreationPage.verifyElementContainsText( | ||
"medical-council-registration", | ||
"123456789" | ||
); | ||
}); | ||
|
||
it("create new user form throwing mandatory field error", () => { | ||
userCreationPage.clickElementById("addUserButton"); | ||
userCreationPage.clickElementById("submit"); | ||
userCreationPage.verifyErrorMessages(EXPECTED_ERROR_MESSAGES); | ||
}); | ||
|
||
it("view user redirection from facility page", () => { | ||
cy.visit("/facility"); | ||
assetSearchPage.typeSearchKeyword(fillFacilityName); | ||
assetSearchPage.pressEnter(); | ||
facilityPage.verifyFacilityBadgeContent(fillFacilityName); | ||
facilityPage.visitAlreadyCreatedFacility(); | ||
facilityPage.clickManageFacilityDropdown(); | ||
facilityPage.clickViewUsersOption(); | ||
userPage.verifyMultipleBadgesWithSameId(alreadylinkedusersviews); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
}); |
Oops, something went wrong.