diff --git a/tests/e2e/default-mobile/reports/send-message.wdio-spec.js b/tests/e2e/default-mobile/reports/send-message.wdio-spec.js index e8071bb5647..45bd04afad0 100644 --- a/tests/e2e/default-mobile/reports/send-message.wdio-spec.js +++ b/tests/e2e/default-mobile/reports/send-message.wdio-spec.js @@ -12,15 +12,7 @@ describe('Report - Send message action', () => { const healthCenter = places.get('health_center'); const clinic = places.get('clinic'); - const onlineUserContact = personFactory.build({ - name: 'OnlineUser', - phone: '+25475525749', - parent: { _id: healthCenter._id, parent: healthCenter.parent } - }); - const chwContact = personFactory.build({ - _id: 'chw-contact-1', - name: 'CHW Contact', phone: '+25475525759', parent: { _id: clinic._id, parent: clinic.parent } }); @@ -28,13 +20,10 @@ describe('Report - Send message action', () => { const onlineUser = userFactory.build({ place: healthCenter._id, roles: ['program_officer'], - contact: onlineUserContact }); const person = personFactory.build({ - _id: 'patient1', phone: '+25475525741', - name: 'patient1', parent: { _id: clinic._id, parent: clinic.parent } }); @@ -44,14 +33,11 @@ describe('Report - Send message action', () => { }); before(async () => { - await utils.saveDocs([...places.values(), person, chwContact]); - await utils.saveDocs([report]); + await utils.saveDocs([...places.values(), person, chwContact, report]); await utils.createUsers([onlineUser]); await loginPage.login(onlineUser); }); - after(async () => await utils.revertSettings(true)); - it('should display option to send message', async () => { await commonElements.goToReports(); const firstReport = await reportsPage.firstReport(); diff --git a/tests/page-objects/default/common/common.wdio.page.js b/tests/page-objects/default/common/common.wdio.page.js index 7772fa56cc0..7da5a9fc2f7 100644 --- a/tests/page-objects/default/common/common.wdio.page.js +++ b/tests/page-objects/default/common/common.wdio.page.js @@ -29,8 +29,8 @@ const syncSuccess = () => $(`${hamburgerMenuItemSelector}.sync-status .success`) const syncInProgress = () => $('*="Currently syncing"'); const syncRequired = () => $(`${hamburgerMenuItemSelector}.sync-status .required`); const jsonError = async () => (await $('pre')).getText(); -const reportsContentSelector = '#reports-content'; -const reportsFastActionFAB = () => $(`${reportsContentSelector} .fast-action-fab-button mat-icon`); +const REPORTS_CONTENT_SELECTOR = '#reports-content'; +const reportsFastActionFAB = () => $(`${REPORTS_CONTENT_SELECTOR} .fast-action-fab-button mat-icon`); const actionBar = () => $('.detail-actions.right-pane'); const actionBarActions = () => $$('.detail-actions.right-pane span');