-
Notifications
You must be signed in to change notification settings - Fork 483
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 janab-qa-testing
- Loading branch information
Showing
85 changed files
with
1,410 additions
and
1,775 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
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,85 @@ | ||
import { cy, describe, before, beforeEach, it, afterEach } from "local-cypress"; | ||
import LoginPage from "../../pageobject/Login/LoginPage"; | ||
import UserProfilePage from "../../pageobject/Users/UserProfilePage"; | ||
import ManageUserPage from "../../pageobject/Users/ManageUserPage"; | ||
|
||
describe("Manage User Profile", () => { | ||
const loginPage = new LoginPage(); | ||
const userProfilePage = new UserProfilePage(); | ||
const manageUserPage = new ManageUserPage(); | ||
|
||
const age = "30"; | ||
const gender = "Male"; | ||
const email = "[email protected]"; | ||
const phone = "+918899887788"; | ||
const workinghours = "8"; | ||
const doctorQualification = "MBBS"; | ||
const doctorYoE = "10"; | ||
const medicalCouncilRegistration = "1234567890"; | ||
|
||
const facilitySearch = "Dummy Facility 1"; | ||
|
||
before(() => { | ||
loginPage.loginAsDevDoctor(); | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
console.log(localStorage); | ||
cy.clearLocalStorage(/filters--.+/); | ||
console.log(localStorage); | ||
cy.awaitUrl("/user/profile"); | ||
}); | ||
|
||
it("Set Age, Gender, Email, Phone and Working Hours for a user and verify its reflection in user profile", () => { | ||
userProfilePage.clickEditProfileButton(); | ||
|
||
userProfilePage.typeAge(age); | ||
userProfilePage.selectGender(gender); | ||
userProfilePage.typeEmail(email); | ||
userProfilePage.typePhone(phone); | ||
userProfilePage.typeWhatsApp(phone); | ||
userProfilePage.typeWorkingHours(workinghours); | ||
userProfilePage.typeDoctorQualification(doctorQualification); | ||
userProfilePage.typeDoctorYoE(doctorYoE); | ||
userProfilePage.typeMedicalCouncilRegistration(medicalCouncilRegistration); | ||
|
||
userProfilePage.clickUpdateButton(); | ||
|
||
cy.verifyNotification("Details updated successfully"); | ||
|
||
userProfilePage.assertAge(age); | ||
userProfilePage.assertGender(gender); | ||
userProfilePage.assertEmail(email); | ||
userProfilePage.assertPhone(phone); | ||
userProfilePage.assertWhatsApp(phone); | ||
userProfilePage.assertWorkingHours(workinghours); | ||
}); | ||
|
||
it("Adding video connect link for a user and verify its reflection in user profile and doctor connect", () => { | ||
// verify the user doesn't have any video connect link | ||
userProfilePage.assertVideoConnectLink("-"); | ||
// Link a new video connect link and ensure it is under video connect link | ||
userProfilePage.clickEditProfileButton(); | ||
userProfilePage.typeVideoConnectLink("https://www.example.com"); | ||
userProfilePage.clickUpdateButton(); | ||
userProfilePage.assertVideoConnectLink("https://www.example.com"); | ||
// Edit the video connect link and ensure it is updated | ||
userProfilePage.clickEditProfileButton(); | ||
userProfilePage.typeVideoConnectLink("https://www.test.com"); | ||
userProfilePage.clickUpdateButton(); | ||
userProfilePage.assertVideoConnectLink("https://www.test.com"); | ||
// Go to particular facility doctor connect and verify the video connect link is present | ||
manageUserPage.navigateToFacility(); | ||
manageUserPage.typeFacilitySearch(facilitySearch); | ||
manageUserPage.assertFacilityInCard(facilitySearch); | ||
manageUserPage.clickFacilityPatients(); | ||
manageUserPage.clickDoctorConnectButton(); | ||
manageUserPage.assertVideoConnectLink("Dev Doctor", "https://www.test.com"); | ||
}); | ||
|
||
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
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,84 @@ | ||
export default class UserProfilePage { | ||
assertVideoConnectLink(link: string) { | ||
cy.get("#videoconnectlink-profile-details").should("contain.text", link); | ||
} | ||
|
||
clickEditProfileButton() { | ||
cy.get("#edit-cancel-profile-button").click(); | ||
} | ||
|
||
typeVideoConnectLink(link: string) { | ||
cy.get("#video_connect_link").click().clear().type(link); | ||
} | ||
|
||
clickUpdateButton() { | ||
cy.get("#submit").click(); | ||
} | ||
|
||
typeAge(age: string) { | ||
cy.get("#age").click().clear().type(age); | ||
} | ||
|
||
selectGender(gender: string) { | ||
cy.get("#gender").click(); | ||
cy.get("#gender-option-" + gender).click(); | ||
} | ||
|
||
typeEmail(email: string) { | ||
cy.get("#email").click().clear().type(email); | ||
} | ||
|
||
typePhone(phone: string) { | ||
cy.get("#phoneNumber").click().clear().type(phone); | ||
} | ||
|
||
typeWhatsApp(phone: string) { | ||
cy.get("#altPhoneNumber").click().clear().type(phone); | ||
} | ||
|
||
typeWorkingHours(workinghours: string) { | ||
cy.get("#weekly_working_hours").click().clear().type(workinghours); | ||
} | ||
|
||
typeDoctorQualification = (doctorQualification: string) => { | ||
cy.get("#doctor_qualification").click().clear().type(doctorQualification); | ||
}; | ||
|
||
typeDoctorYoE = (doctorYoE: string) => { | ||
cy.get("#doctor_experience_commenced_on").click().clear().type(doctorYoE); | ||
}; | ||
|
||
typeMedicalCouncilRegistration = (medicalCouncilRegistration: string) => { | ||
cy.get("#doctor_medical_council_registration") | ||
.click() | ||
.clear() | ||
.type(medicalCouncilRegistration); | ||
}; | ||
|
||
assertAge(age: string) { | ||
cy.get("#age-profile-details").should("contain.text", age); | ||
} | ||
|
||
assertGender(gender: string) { | ||
cy.get("#gender-profile-details").should("contain.text", gender); | ||
} | ||
|
||
assertEmail(email: string) { | ||
cy.get("#emailid-profile-details").should("contain.text", email); | ||
} | ||
|
||
assertPhone(phone: string) { | ||
cy.get("#contactno-profile-details").should("contain.text", phone); | ||
} | ||
|
||
assertWhatsApp(phone: string) { | ||
cy.get("#whatsapp-profile-details").should("contain.text", phone); | ||
} | ||
|
||
assertWorkingHours(workinghours: string) { | ||
cy.get("#averageworkinghour-profile-details").should( | ||
"contain.text", | ||
workinghours | ||
); | ||
} | ||
} |
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.