From a9018eb923edaea27ab67ef82418de99beaf2ac3 Mon Sep 17 00:00:00 2001 From: Gintare Vilkelyte Date: Fri, 5 Feb 2021 11:21:39 +0100 Subject: [PATCH] fix: changes selectors --- page_objects/capture/CaptureCommentsSection.js | 10 +++++----- page_objects/capture/CaptureHeaderBar.js | 4 ++-- page_objects/capture/CaptureIndexPage.js | 6 +++--- page_objects/capture/CaptureNewEventForm.js | 2 +- step_definitions/dhis2/capture/capture.js | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/page_objects/capture/CaptureCommentsSection.js b/page_objects/capture/CaptureCommentsSection.js index 3b2cb46..24a7437 100644 --- a/page_objects/capture/CaptureCommentsSection.js +++ b/page_objects/capture/CaptureCommentsSection.js @@ -2,23 +2,23 @@ import Page from '../Page' class CaptureCommentsSection extends Page { get comments() { - return browser.$$('[data-test="dhis2-capture-comment"]'); + return browser.$$('[data-test="comment"]'); } get commentsListElement() { - return browser.$('[data-test="dhis2-capture-comments-list"]'); + return browser.$('[data-test="comments-list"]'); } get newCommentButton() { - return browser.$('[data-test="dhis2-capture-new-comment-button"]'); + return browser.$('[data-test="new-comment-button"]'); } get newCommentTextField() { - return browser.$('[data-test="dhis2-capture-comment-textfield"]'); + return browser.$('[data-test="comment-textfield"]'); } get saveCommentButton() { - return browser.$('[data-test="dhis2-capture-comment-buttons-container"] button:first-of-type'); + return browser.$('[data-test="comment-buttons-container"] button:first-of-type'); } commentByValue(val) { diff --git a/page_objects/capture/CaptureHeaderBar.js b/page_objects/capture/CaptureHeaderBar.js index 37e1a99..8dc3c07 100644 --- a/page_objects/capture/CaptureHeaderBar.js +++ b/page_objects/capture/CaptureHeaderBar.js @@ -3,12 +3,12 @@ import { waitForWindowToLoad } from '@support/wait' class CaptureHeaderBar extends Page { get newEventButton() { - return browser.$('[data-test="dhis2-capture-new-button"]'); + return browser.$('[data-test="new-button"]'); } openNewEventFormInProgram() { this.newEventButton.click(); - browser.$('[data-test="dhis2-capture-new-menuitem-one"] a').click(); + browser.$('[data-test="new-menuitem-one"] a').click(); waitForWindowToLoad(); } diff --git a/page_objects/capture/CaptureIndexPage.js b/page_objects/capture/CaptureIndexPage.js index ac85786..396366c 100644 --- a/page_objects/capture/CaptureIndexPage.js +++ b/page_objects/capture/CaptureIndexPage.js @@ -11,7 +11,7 @@ class CaptureIndexPage extends Page { } get tableRows() { - return browser.$$('[data-test="online-list-table"] tbody [data-test="dhis2-capture-table-row"]') + return browser.$$('[data-test="online-list-table"] tbody [data-test="table-row"]') } get tableRowCount() { @@ -19,11 +19,11 @@ class CaptureIndexPage extends Page { } get ouSearch() { - return browser.$('[data-test="dhis2-capture-org-unit-selector-container"] [data-test="capture-ui-input"]') + return browser.$('[data-test="org-unit-selector-container"] [data-test="capture-ui-input"]') } get deleteEventButton() { - return browser.$('[data-test="dhis2-capture-delete-event-button"]'); + return browser.$('[data-test="delete-event-button"]'); } open() { diff --git a/page_objects/capture/CaptureNewEventForm.js b/page_objects/capture/CaptureNewEventForm.js index 9a22591..1bdd907 100644 --- a/page_objects/capture/CaptureNewEventForm.js +++ b/page_objects/capture/CaptureNewEventForm.js @@ -17,7 +17,7 @@ class CaptureNewEventForm extends Page { } get mainSaveButton() { - return browser.$('[data-test="dhis2-capture-main-button"]'); + return browser.$('[data-test="main-button"]'); } get commentsSection() { diff --git a/step_definitions/dhis2/capture/capture.js b/step_definitions/dhis2/capture/capture.js index 9125865..9aedb80 100644 --- a/step_definitions/dhis2/capture/capture.js +++ b/step_definitions/dhis2/capture/capture.js @@ -28,7 +28,7 @@ Given(/^there is at least one event in the list/, () => { }) When(/^I click on event content button for the (\d+) event/, (number) => { - captureIndexPage.tableRows[number - 1].$('[data-test="dhis2-capture-event-content-menu"]').click(); + captureIndexPage.tableRows[number - 1].$('[data-test="event-content-menu"]').click(); }) When(/^I click on delete event button/, () => { @@ -79,7 +79,7 @@ When(/^I save the event/, () => { Then(/^the comment "(.+)" should be displayed correctly/, (comment) => { expect(captureNewEventForm.commentsSection.comments.length).to.be.greaterThan(0); - var commentElementText = captureNewEventForm.commentsSection.comments[0].$('[data-test="dhis2-capture-comment-text"] p'); + var commentElementText = captureNewEventForm.commentsSection.comments[0].$('[data-test="comment-text"] p'); if (comment.includes('*bold*')) { expect(commentElementText.$('strong').getText()).to.equal('bold') @@ -111,7 +111,7 @@ When(/^I open the last saved event/, () => { Then(/^the author of "(.+)" should be "(.+)" user/, (commnt, user) => { let commentText = commnt.replace(/\*/g, '').replace(/_/g, ''); - expect(captureCommentsSection.commentByValue(commentText).$('[data-test=dhis2-capture-comment-user]').getText()).to.equal(user); + expect(captureCommentsSection.commentByValue(commentText).$('[data-test=comment-user]').getText()).to.equal(user); })