Skip to content

Commit

Permalink
chore: removes the dhis2-capture- prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
paschalidi committed Mar 3, 2021
1 parent 7a5d640 commit ee11088
Show file tree
Hide file tree
Showing 55 changed files with 294 additions and 294 deletions.
14 changes: 7 additions & 7 deletions cypress/integration/EnrollmentPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ beforeEach(() => {

Given('you are on an enrollment page', () => {
cy.visit('/#/enrollment?programId=IpHINAT79UW&orgUnitId=UgYg0YW7ZIh&teiId=fhFQhO0xILJ&enrollmentId=gPDueU02tn8');
cy.get('[data-test="dhis2-capture-enrollment-page-content"]')
cy.get('[data-test="enrollment-page-content"]')
.contains('Enrollment Dashboard');
});

Expand All @@ -18,28 +18,28 @@ And('you select the Inpatient morbidity program', () => {
});

And('you see the registration form for the Inpatient morbidity program', () => {
cy.get('[data-test="dhis2-capture-registration-page-content"]')
cy.get('[data-test="registration-page-content"]')
.contains('New Inpatient morbidity and mortality')
.should('exist');
cy.get('[data-test="dhis2-capture-registration-page-content"]')
cy.get('[data-test="registration-page-content"]')
.contains('Saving to Inpatient morbidity and mortality in Taninahun (Malen) CHP')
.should('exist');
});

And('you see the registration form for the Malaria case diagnosis', () => {
cy.get('[data-test="dhis2-capture-registration-page-content"]')
cy.get('[data-test="registration-page-content"]')
.contains('New malaria entity in program: Malaria case diagnosis, treatment and investigation')
.should('exist');
cy.get('[data-test="dhis2-capture-registration-page-content"]')
cy.get('[data-test="registration-page-content"]')
.contains('Saving a malaria entity in Malaria case diagnosis, treatment and investigation in Taninahun (Malen) CHP.')
.should('exist');
});

And('you see the registration form for the MNCH PNC program', () => {
cy.get('[data-test="dhis2-capture-registration-page-content"]')
cy.get('[data-test="registration-page-content"]')
.contains('New person in program: MNCH / PNC (Adult Woman)')
.should('exist');
cy.get('[data-test="dhis2-capture-registration-page-content"]')
cy.get('[data-test="registration-page-content"]')
.contains('Saving a person in MNCH / PNC (Adult Woman) in Taninahun (Malen) CHP.')
.should('exist');
});
Expand Down
54 changes: 27 additions & 27 deletions cypress/integration/LockedSelector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ beforeEach(() => {
});

When('you click the "New" button to add a new event', () => {
cy.get('[data-test="dhis2-capture-new-event-button"]')
cy.get('[data-test="new-event-button"]')
.click();
});

When('you click the first option from the "New" button to add a new event', () => {
cy.get('[data-test="dhis2-capture-new-button"]')
cy.get('[data-test="new-button"]')
.click();
cy.get('[data-test="dhis2-capture-new-menuitem-one"]')
cy.get('[data-test="new-menuitem-one"]')
.click();
});

Then('you should see informative text saying you should do finish your selections', () => {
cy.get('[data-test="dhis2-capture-informative-paper"]')
cy.get('[data-test="informative-paper"]')
.should('exist');
});

Given('you are in the main page with organisation unit preselected', () => {
cy.visit('/#/?orgUnitId=DiszpKrYNg8');
cy.get('[data-test="dhis2-capture-new-event-button"]')
cy.get('[data-test="new-event-button"]')
.should('exist');
});

Expand All @@ -33,7 +33,7 @@ Then('you should be taken to the new page', () => {

Given('you are in the main page with program preselected', () => {
cy.visit('/#/?programId=VBqh0ynB2wv');
cy.get('[data-test="dhis2-capture-new-button"]')
cy.get('[data-test="new-button"]')
.should('exist');
});

Expand Down Expand Up @@ -66,7 +66,7 @@ Given('you select both org unit and program Child Programme', () => {
});

When('you click the "Start again" button', () => {
cy.get('[data-test="dhis2-capture-start-again-button"]')
cy.get('[data-test="start-again-button"]')
.click();
});

Expand All @@ -83,7 +83,7 @@ Then('you should see the table', () => {
});

Then('you can see the new event page', () => {
cy.get('[data-test="dhis2-capture-start-again-button"]')
cy.get('[data-test="start-again-button"]')
.should('exist');
});

Expand All @@ -107,7 +107,7 @@ Given('you land on a main page with an invalid org unit id', () => {
});

Then('you should see error message', () => {
cy.get('[data-test="dhis2-capture-error-message-handler"]')
cy.get('[data-test="error-message-handler"]')
.should('exist');
});

Expand All @@ -117,12 +117,12 @@ Given('you land on a view event page from the url', () => {

Given('you are in the new event page with no selections made', () => {
cy.visit('/#/new');
cy.get('[data-test="dhis2-capture-informative-paper"]')
cy.get('[data-test="informative-paper"]')
.should('exist');
});

When('you click the cancel button', () => {
cy.get('[data-test="dhis2-capture-new-page-cancel-button"]')
cy.get('[data-test="new-page-cancel-button"]')
.click();
});

Expand Down Expand Up @@ -190,14 +190,14 @@ Given('you land on a view event page with an invalid id', () => {
});

When('you click the find button', () => {
cy.get('[data-test="dhis2-capture-find-button"]')
cy.get('[data-test="find-button"]')
.click();
});

When('you click the find button from the dropdown menu', () => {
cy.get('[data-test="dhis2-capture-find-button"]')
cy.get('[data-test="find-button"]')
.click();
cy.get('[data-test="dhis2-capture-find-menuitem-one"]')
cy.get('[data-test="find-menuitem-one"]')
.click();
});

Expand All @@ -210,13 +210,13 @@ Then('you are navigated to the search page with the same org unit and program Ch
});

Then('there should be visible a title with Child Program', () => {
cy.get('[data-test="dhis2-capture-search-page-content"]')
cy.get('[data-test="search-page-content"]')
.contains('person in program: Child Programme')
.should('exist');
});

And('there should be Child Programme domain forms visible to search with', () => {
cy.get('[data-test="dhis2-capture-search-page-content"]')
cy.get('[data-test="search-page-content"]')
.find('[data-test="capture-ui-input"]')
.should('have.length', 1);
});
Expand Down Expand Up @@ -245,7 +245,7 @@ Given(/^you land on the enrollment page by having typed the (.*)$/, (url) => {
});

Then(/^you can see on the locked selector the following (.*)$/, (state) => {
lockedSelectorCases[state].map(selection => cy.get('[data-test="dhis2-capture-locked-selector"]').contains(selection));
lockedSelectorCases[state].map(selection => cy.get('[data-test="locked-selector"]').contains(selection));
});

Then(/^you see the following (.*)$/, (message) => {
Expand All @@ -254,7 +254,7 @@ Then(/^you see the following (.*)$/, (message) => {

And('you land on the enrollment page by having typed only the enrollmentId on the url', () => {
cy.visit('/#/enrollment?enrollmentId=gPDueU02tn8');
cy.get('[data-test="dhis2-capture-enrollment-page-content"]')
cy.get('[data-test="enrollment-page-content"]')
.contains('Enrollment Dashboard');
});

Expand All @@ -272,7 +272,7 @@ And('you navigated to the main page', () => {

And('you see message explaining you need to select a program', () => {
cy.url().should('eq', `${Cypress.config().baseUrl}/#/enrollment?orgUnitId=UgYg0YW7ZIh&teiId=fhFQhO0xILJ&enrollmentId=gPDueU02tn8`);
cy.get('[data-test="dhis2-capture-enrollment-page-content"]')
cy.get('[data-test="enrollment-page-content"]')
.contains('Carlos Cruz is enrolled in multiple programs. Choose a program.');
});

Expand All @@ -287,13 +287,13 @@ And('you reset the org unit selection', () => {

And('you see the enrollment page but there is no org unit id in the url', () => {
cy.url().should('eq', `${Cypress.config().baseUrl}/#/enrollment?programId=IpHINAT79UW&teiId=fhFQhO0xILJ&enrollmentId=gPDueU02tn8`);
cy.get('[data-test="dhis2-capture-enrollment-page-content"]')
cy.get('[data-test="enrollment-page-content"]')
.contains('Enrollment Dashboard');
});

And('you see the enrollment page', () => {
cy.url().should('eq', `${Cypress.config().baseUrl}/#/enrollment?programId=IpHINAT79UW&orgUnitId=UgYg0YW7ZIh&teiId=fhFQhO0xILJ&enrollmentId=gPDueU02tn8`);
cy.get('[data-test="dhis2-capture-enrollment-page-content"]')
cy.get('[data-test="enrollment-page-content"]')
.contains('Enrollment Dashboard');
});

Expand All @@ -307,7 +307,7 @@ And('you reset the enrollment selection', () => {

And('you see message explaining you need to select an enrollment', () => {
cy.url().should('eq', `${Cypress.config().baseUrl}/#/enrollment?programId=IpHINAT79UW&orgUnitId=UgYg0YW7ZIh&teiId=fhFQhO0xILJ`);
cy.get('[data-test="dhis2-capture-enrollment-page-content"]')
cy.get('[data-test="enrollment-page-content"]')
.contains('There are multiple enrollments for this program. Choose an enrollment to view the dashboard.');
});

Expand All @@ -319,9 +319,9 @@ And('you select the Child Programme', () => {
});

And('you see message explaining there are no enrollments for this program', () => {
cy.get('[data-test="dhis2-capture-enrollment-page-content"]')
cy.get('[data-test="enrollment-page-content"]')
.contains('Carlos Cruz is not enrolled in this program.');
cy.get('[data-test="dhis2-capture-enrollment-page-content"]')
cy.get('[data-test="enrollment-page-content"]')
.contains('Enroll Carlos Cruz in this program.');
});

Expand All @@ -333,7 +333,7 @@ And('you select the Antenatal care visit', () => {
});

And('you see message explaining this is an Event program', () => {
cy.get('[data-test="dhis2-capture-enrollment-page-content"]')
cy.get('[data-test="enrollment-page-content"]')
.contains('Antenatal care visit is an event program and does not have enrollments.');
});

Expand All @@ -345,9 +345,9 @@ When('you select org unit that is incompatible with the already selected program
});

Then('you can see message on the locked selector', () => {
cy.get('[data-test="dhis2-capture-locked-selector"]')
cy.get('[data-test="locked-selector"]')
.contains('No programs available.');
cy.get('[data-test="dhis2-capture-locked-selector"]')
cy.get('[data-test="locked-selector"]')
.contains('Show all');
});

30 changes: 15 additions & 15 deletions cypress/integration/NewEventThroughAddRelationship/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ beforeEach(() => {
});

When('you add data to the form', () => {
cy.get('[data-test="dhis2-capture-dataentry-field-eventDate"]')
cy.get('[data-test="dataentry-field-eventDate"]')
.find('input')
.type('2020-01-01')
.blur();
cy.get('[data-test="dhis2-capture-form-field-qrur9Dvnyt5"]')
cy.get('[data-test="form-field-qrur9Dvnyt5"]')
.find('input')
.type('25');
cy.get('[data-test="dhis2-capture-form-field-oZg33kd9taw"]')
cy.get('[data-test="form-field-oZg33kd9taw"]')
.find('input')
.type('Male{enter}', { force: true });
});
Expand All @@ -39,28 +39,28 @@ Then('the event should be sent to the server successfully', () => {


When('you fill in the registration details', () => {
cy.get('[data-test="dhis2-capture-relationship-register-tei-program-selector"]')
cy.get('[data-test="relationship-register-tei-program-selector"]')
.find('input')
.type('Child{enter}', { force: true });
cy.get('[data-test="dhis2-capture-form-field-w75KJ2mc4zz"]')
cy.get('[data-test="form-field-w75KJ2mc4zz"]')
.find('input')
.type('Sarah');
cy.get('[data-test="dhis2-capture-form-field-zDhUuAYrxNC"]')
cy.get('[data-test="form-field-zDhUuAYrxNC"]')
.find('input')
.type('Gonz');
cy.get('[data-test="dhis2-capture-form-field-cejWyOfXge6"]')
cy.get('[data-test="form-field-cejWyOfXge6"]')
.find('input')
.type('Female{enter}', { force: true });
cy.get('[data-test="dhis2-capture-dataentry-field-incidentDate"]')
cy.get('[data-test="dataentry-field-incidentDate"]')
.find('input')
.type('2020-01-01')
.blur();
});

When('you submit the registration form', () => {
cy.get('[data-test="dhis2-capture-create-and-link-button"]')
cy.get('[data-test="create-and-link-button"]')
.click();
cy.get('[data-test="dhis2-capture-create-as-new-person"]')
cy.get('[data-test="create-as-new-person"]')
.click();
});

Expand Down Expand Up @@ -103,15 +103,15 @@ Then('the data should be sent to the server successfully', () => {
});

When('you search for an existing unique id and link to the person', () => {
cy.get('[data-test="dhis2-capture-form-field-lZGmxYbs97q"]')
cy.get('[data-test="form-field-lZGmxYbs97q"]')
.find('input')
.type('9191132445122')
.blur(); // TODO: Look into why the click below is failing if the field is not blurred first

cy.get('[data-test="dhis2-capture-relationship-tei-search-button-relationshipTeiSearch-nEenWmSyUEp-0"]')
cy.get('[data-test="relationship-tei-search-button-relationshipTeiSearch-nEenWmSyUEp-0"]')
.click();

cy.get('[data-test="dhis2-capture-relationship-tei-link-vu9dsAuJ29q"]')
cy.get('[data-test="relationship-tei-link-vu9dsAuJ29q"]')
.click();
});

Expand Down Expand Up @@ -147,14 +147,14 @@ Then('the event and relationship should be sent to the server successfully', ()
});

When('you select search scope TB program', () => {
cy.get('[data-test="dhis2-capture-virtualized-select"]')
cy.get('[data-test="virtualized-select"]')
.click()
.contains('TB prog')
.click();
});

And('you expand the attributes search area', () => {
cy.get('[data-test="dhis2-capture-collapsible-button"]')
cy.get('[data-test="collapsible-button"]')
.eq(4)
.click();
});
Loading

0 comments on commit ee11088

Please sign in to comment.