diff --git a/tests/page-objects/apdex/contacts.page.js b/tests/page-objects/apdex/contacts.page.js index aacd5240541..1228e49165c 100644 --- a/tests/page-objects/apdex/contacts.page.js +++ b/tests/page-objects/apdex/contacts.page.js @@ -8,32 +8,32 @@ const PATIENT_CONTACT = 'patientContact'; class ContactsPage extends Page { - async loadContactList(settingsProvider) { - await super.loadPage(settingsProvider, CONTACT_LIST); + async loadContactList() { + await super.loadPage(CONTACT_LIST); } - async loadChwArea(settingsProvider) { - await super.loadPage(settingsProvider, CHW_AREA); + async loadChwArea() { + await super.loadPage(CHW_AREA); } - async loadHousehold(settingsProvider) { - await super.loadPage(settingsProvider, HOUSEHOLD); + async loadHousehold() { + await super.loadPage(HOUSEHOLD); } - async loadPatient(settingsProvider) { - await super.loadPage(settingsProvider, PATIENT); + async loadPatient() { + await super.loadPage(PATIENT); } - async searchContact(settingsProvider) { - await super.searchPage(settingsProvider, CONTACT_LIST); + async searchContact() { + await super.searchPage(CONTACT_LIST); } - async submitPatientReport(settingsProvider) { - await super.loadForm(settingsProvider, PATIENT_REPORT); + async submitPatientReport() { + await super.loadForm(PATIENT_REPORT); } - async createPatient(settingsProvider) { - await super.loadForm(settingsProvider, PATIENT_CONTACT); + async createPatient() { + await super.loadForm(PATIENT_CONTACT); } } diff --git a/tests/page-objects/apdex/messages.page.js b/tests/page-objects/apdex/messages.page.js index e95a3d0bb69..5100eb69092 100644 --- a/tests/page-objects/apdex/messages.page.js +++ b/tests/page-objects/apdex/messages.page.js @@ -3,8 +3,8 @@ const MESSAGE_LIST = 'messageList'; class MessagesPage extends Page { - async loadMessageList(settingsProvider) { - await super.loadPage(settingsProvider, MESSAGE_LIST); + async loadMessageList() { + await super.loadPage(MESSAGE_LIST); } } diff --git a/tests/page-objects/apdex/page.js b/tests/page-objects/apdex/page.js index 20011d830be..95f2830e290 100644 --- a/tests/page-objects/apdex/page.js +++ b/tests/page-objects/apdex/page.js @@ -1,6 +1,8 @@ const { browser, driver } = require('@wdio/globals'); const { execSync } = require('child_process'); +const loadSettings = require('../../performance/apdex-score/settings-provider'); const APP_ID = 'org.medicmobile.webapp.mobile'; +const settingsProvider = loadSettings(); module.exports = class Page { @@ -118,7 +120,7 @@ module.exports = class Page { } } - async loadAndAssertPage(page, settingsProvider) { + async loadAndAssertPage(page) { if (!page) { return; } @@ -160,7 +162,7 @@ module.exports = class Page { this.scrollToElement(formPage); } - async fillUpForm(form, settingsProvider){ + async fillUpForm(form){ if (!form) { return; } @@ -200,7 +202,7 @@ module.exports = class Page { await this.waitForDisplayedAndRetry(UI_ELEMENT); } - async search (page, settingsProvider) { + async search (page) { if (!page || !page.search) { return; } @@ -241,17 +243,17 @@ module.exports = class Page { .catch(error => console.error('Error: ', error)); } - async loadPage(settingsProvider, pageName) { + async loadPage(pageName) { const page = settingsProvider.getPage(pageName); await this.loadAndAssertPage(page, settingsProvider); } - async loadForm(settingsProvider, formName) { + async loadForm(formName) { const form = settingsProvider.getForm(formName); await this.fillUpForm(form, settingsProvider); } - async searchPage(settingsProvider, pageName) { + async searchPage(pageName) { const page = settingsProvider.getPage(pageName); await this.search(page, settingsProvider); } diff --git a/tests/page-objects/apdex/reports.page.js b/tests/page-objects/apdex/reports.page.js index 12fc0d11fe1..f3932b9636f 100644 --- a/tests/page-objects/apdex/reports.page.js +++ b/tests/page-objects/apdex/reports.page.js @@ -3,12 +3,12 @@ const REPORT_LIST = 'reportList'; class ReportsPage extends Page { - async loadReportList(settingsProvider) { - await super.loadPage(settingsProvider, REPORT_LIST); + async loadReportList() { + await super.loadPage(REPORT_LIST); } - async searchReport(settingsProvider) { - await super.searchPage(settingsProvider, REPORT_LIST); + async searchReport() { + await super.searchPage(REPORT_LIST); } } diff --git a/tests/page-objects/apdex/targets.page.js b/tests/page-objects/apdex/targets.page.js index 1da3b081352..d296782efca 100644 --- a/tests/page-objects/apdex/targets.page.js +++ b/tests/page-objects/apdex/targets.page.js @@ -3,8 +3,8 @@ const TARGETS = 'targets'; class TargetsPage extends Page { - async loadTargets(settingsProvider) { - await super.loadPage(settingsProvider, TARGETS); + async loadTargets() { + await super.loadPage(TARGETS); } } diff --git a/tests/page-objects/apdex/tasks.page.js b/tests/page-objects/apdex/tasks.page.js index 01a26e9cbff..e8ed4f0d723 100644 --- a/tests/page-objects/apdex/tasks.page.js +++ b/tests/page-objects/apdex/tasks.page.js @@ -4,12 +4,12 @@ const PATIENT_TASK = 'patientTask'; class TasksPage extends Page { - async loadTaskList(settingsProvider) { - await super.loadPage(settingsProvider, TASK_LIST); + async loadTaskList() { + await super.loadPage(TASK_LIST); } - async submitTask(settingsProvider) { - await super.loadForm(settingsProvider, PATIENT_TASK); + async submitTask() { + await super.loadForm(PATIENT_TASK); } } diff --git a/tests/performance/apdex-score/specs/test.spec.js b/tests/performance/apdex-score/specs/test.spec.js index 1f18b32e1ca..9f4d3f47b41 100644 --- a/tests/performance/apdex-score/specs/test.spec.js +++ b/tests/performance/apdex-score/specs/test.spec.js @@ -23,55 +23,55 @@ describe('Apdex Performance Workflows', () => { for (let i = 0; i < repetitions; i++) { (skip.loadContactList ? xit : it)('should load contact list', async () => { - await contactsPage.loadContactList(settingsProvider); + await contactsPage.loadContactList(); }); (skip.loadChwArea ? xit : it)('should load CHW area', async () => { - await contactsPage.loadChwArea(settingsProvider); + await contactsPage.loadChwArea(); }); (skip.loadHousehold ? xit : it)('should load household', async () => { - await contactsPage.loadHousehold(settingsProvider); + await contactsPage.loadHousehold(); }); (skip.createPatient ? xit : it)('should create patient', async () => { - await contactsPage.createPatient(settingsProvider); + await contactsPage.createPatient(); }); (skip.loadPatient ? xit : it)('should load patient', async () => { - await contactsPage.loadPatient(settingsProvider); + await contactsPage.loadPatient(); }); (skip.submitPatientReport ? xit : it)('should submit patient report', async () => { - await contactsPage.submitPatientReport(settingsProvider); + await contactsPage.submitPatientReport(); }); (skip.searchContact ? xit : it)('should search contact', async () => { - await contactsPage.searchContact(settingsProvider); + await contactsPage.searchContact(); }); (skip.loadReportList ? xit : it)('should load report list and view a report', async () => { - await reportsPage.loadReportList(settingsProvider); + await reportsPage.loadReportList(); }); (skip.searchReport ? xit : it)('should search report', async () => { - await reportsPage.searchReport(settingsProvider); + await reportsPage.searchReport(); }); (skip.loadTaskList ? xit : it)('should load task list', async () => { - await tasksPage.loadTaskList(settingsProvider); + await tasksPage.loadTaskList(); }); (skip.submitTask ? xit : it)('should complete a task', async () => { - await tasksPage.submitTask(settingsProvider); + await tasksPage.submitTask(); }); (skip.loadTargets ? xit : it)('should load targets', async () => { - await targetsPage.loadTargets(settingsProvider); + await targetsPage.loadTargets(); }); (skip.loadMessageList ? xit : it)('should load message list and view a message', async () => { - await messagesPage.loadMessageList(settingsProvider); + await messagesPage.loadMessageList(); }); }