-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: initial setup of apdex automation in cht-core (#9037)
Co-authored-by: Rafa <[email protected]> Co-authored-by: Jennifer Q <[email protected]>
- Loading branch information
1 parent
07b6c11
commit a211a7c
Showing
15 changed files
with
9,250 additions
and
1,353 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const Page = require('@page-objects/apdex/page'); | ||
const CONTACT_LIST = 'contactList'; | ||
const CHW_AREA = 'chwArea'; | ||
const HOUSEHOLD = 'household'; | ||
const PATIENT = 'patient'; | ||
const PATIENT_REPORT = 'patientReport'; | ||
const PATIENT_CONTACT = 'patientContact'; | ||
|
||
class ContactsPage extends Page { | ||
|
||
async loadContactList() { | ||
await super.loadPage(CONTACT_LIST); | ||
} | ||
|
||
async loadChwArea() { | ||
await super.loadPage(CHW_AREA); | ||
} | ||
|
||
async loadHousehold() { | ||
await super.loadPage(HOUSEHOLD); | ||
} | ||
|
||
async loadPatient() { | ||
await super.loadPage(PATIENT); | ||
} | ||
|
||
async searchContact() { | ||
await super.searchPage(CONTACT_LIST); | ||
} | ||
|
||
async submitPatientReport() { | ||
await super.loadForm(PATIENT_REPORT); | ||
} | ||
|
||
async createPatient() { | ||
await super.loadForm(PATIENT_CONTACT); | ||
} | ||
|
||
} | ||
|
||
module.exports = new ContactsPage(); |
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,36 @@ | ||
const Page = require('@page-objects/apdex/page'); | ||
const CUSTOM_INSTANCE = 'Custom'; | ||
|
||
class LoadPage extends Page { | ||
|
||
get inputInstanceUrl() { | ||
return $('//android.widget.EditText[@resource-id="org.medicmobile.webapp.mobile:id/txtAppUrl"]'); | ||
} | ||
|
||
get btnSave() { | ||
return $('//android.widget.Button[@resource-id="org.medicmobile.webapp.mobile:id/btnSaveSettings"]'); | ||
} | ||
|
||
async loadInstance() { | ||
const isServerSettings = await super.isLinkExisting(CUSTOM_INSTANCE); | ||
// Check if the app has opened and the custom linktext is displayed before proceeding | ||
if (!isServerSettings) { | ||
return; | ||
} | ||
|
||
await super.toggleAirplaneMode('off'); | ||
await super.clickLink(CUSTOM_INSTANCE); | ||
await this.inputInstanceUrl.setValue(super.getSettingsProvider().getInstanceURL()); | ||
await this.btnSave.click(); | ||
} | ||
|
||
async turnOnAirplaneMode() { | ||
const commonElements = super.getSettingsProvider().getCommonElements(); | ||
const UI_ELEMENT = commonElements?.relaunchAppAssert || super.getLinkSelector('People'); | ||
await this.waitForDisplayedAndRetry(UI_ELEMENT); | ||
await super.toggleAirplaneMode('on'); | ||
} | ||
|
||
} | ||
|
||
module.exports = new LoadPage(); |
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,29 @@ | ||
const Page = require('@page-objects/apdex/page'); | ||
|
||
class LoginPage extends Page { | ||
|
||
get inputUsername() { | ||
return $('//android.view.View[@text="User name"]//parent::android.view.View/android.widget.EditText'); | ||
} | ||
|
||
get inputPassword() { | ||
return $('//*[@text="Password"]//parent::android.view.View/android.view.View/android.widget.EditText'); | ||
} | ||
|
||
async login(userType, userRole) { | ||
await this.inputUsername.waitForDisplayed(); | ||
|
||
const user = super.getSettingsProvider().getUser(userType, userRole); | ||
await this.inputUsername.setValue(user.username); | ||
await this.inputPassword.setValue(user.password); | ||
|
||
await super.clickButton('Login'); | ||
|
||
if (super.getSettingsProvider().hasPrivacyPolicy()) { | ||
await super.clickButton('Accept'); | ||
} | ||
} | ||
|
||
} | ||
|
||
module.exports = new LoginPage(); |
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,12 @@ | ||
const Page = require('@page-objects/apdex/page'); | ||
const MESSAGE_LIST = 'messageList'; | ||
|
||
class MessagesPage extends Page { | ||
|
||
async loadMessageList() { | ||
await super.loadPage(MESSAGE_LIST); | ||
} | ||
|
||
} | ||
|
||
module.exports = new MessagesPage(); |
Oops, something went wrong.