Skip to content

Commit

Permalink
chore: renames from dhis2-capture
Browse files Browse the repository at this point in the history
  • Loading branch information
paschalidi committed Jan 12, 2021
1 parent f59b947 commit 45717c4
Show file tree
Hide file tree
Showing 47 changed files with 227 additions and 227 deletions.
30 changes: 15 additions & 15 deletions cypress/integration/LockedSelector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ beforeEach(() => {

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

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();
});

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');
});

Given('you are in the main page with program 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 Down Expand Up @@ -59,7 +59,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 @@ -76,7 +76,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 @@ -100,7 +100,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 @@ -110,12 +110,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('/#/newEvent');
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 @@ -203,14 +203,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 @@ -223,13 +223,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);
});
50 changes: 25 additions & 25 deletions cypress/integration/NewEvent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ Given('you open the the new event page in Ngelehun and malaria case context', ()
});

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 @@ -41,41 +41,41 @@ Then('the event should be sent to the server successfully', () => {
});

When('you navigate to register a person relationship', () => {
cy.get('[data-test="dhis2-capture-add-relationship-button"]')
cy.get('[data-test="add-relationship-button"]')
.click();
cy.get('[data-test="dhis2-capture-relationship-type-selector-button-mxZDvSZYxlw"]')
cy.get('[data-test="relationship-type-selector-button-mxZDvSZYxlw"]')
.click();
cy.get('[data-test="dhis2-capture-create-relationship-button"]')
cy.get('[data-test="create-relationship-button"]')
.click();
});

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-enrollmentDate"]')
cy.get('[data-test="dataentry-field-enrollmentDate"]')
.find('input')
.type('2020-01-01')
.blur();
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 @@ -118,24 +118,24 @@ Then('the data should be sent to the server successfully', () => {
});

When('you navigate to find a person relationship', () => {
cy.get('[data-test="dhis2-capture-add-relationship-button"]')
cy.get('[data-test="add-relationship-button"]')
.click();
cy.get('[data-test="dhis2-capture-relationship-type-selector-button-mxZDvSZYxlw"]')
cy.get('[data-test="relationship-type-selector-button-mxZDvSZYxlw"]')
.click();
cy.get('[data-test="dhis2-capture-find-relationship-button"]')
cy.get('[data-test="find-relationship-button"]')
.click();
});

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 @@ -171,29 +171,29 @@ 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();
});


And('you click search', () => {
cy.get('[data-test="dhis2-capture-d2-form-area"]')
cy.get('[data-test="d2-form-area"]')
.find('button')
.click();
});

Then('you can see the first page of the results', () => {
cy.get('[data-test="dhis2-capture-card-list-item"]')
cy.get('[data-test="card-list-item"]')
.should('have.length.greaterThan', 0);
cy.get('[data-test="dhis2-capture-pagination"]')
cy.get('[data-test="pagination"]')
.contains('Page 1')
.should('exist');
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/Platform/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ When('you sign in', () => {
});

Then('you should see the app main selections', () => {
cy.get('[data-test="dhis2-capture-org-unit-selector-container"]');
cy.get('[data-test="org-unit-selector-container"]');

cy.get('[data-test="dhis2-capture-program-selector-container"]');
cy.get('[data-test="program-selector-container"]');
});

Then('you should see the header bar', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,100 +8,100 @@ Given('you open the the new event page in Ngelehun and malaria case context', ()
});

When('you navigate to register a person relationship', () => {
cy.get('[data-test="dhis2-capture-add-relationship-button"]')
cy.get('[data-test="add-relationship-button"]')
.click();
cy.get('[data-test="dhis2-capture-relationship-type-selector-button-mxZDvSZYxlw"]')
cy.get('[data-test="relationship-type-selector-button-mxZDvSZYxlw"]')
.click();
cy.get('[data-test="dhis2-capture-create-relationship-button"]')
cy.get('[data-test="create-relationship-button"]')
.click();
});


And('you fill in the first name with values that have duplicates', () => {
cy.get('[data-test="dhis2-capture-d2-form-component"]')
cy.get('[data-test="d2-form-component"]')
.find('[data-test="capture-ui-input"]')
.eq(1)
.type('Tesmi')
.blur();
});

And('you fill in the first name with values that have less than 5 duplicates', () => {
cy.get('[data-test="dhis2-capture-d2-form-component"]')
cy.get('[data-test="d2-form-component"]')
.find('[data-test="capture-ui-input"]')
.eq(1)
.type('Sarah')
.blur();
cy.get('[data-test="dhis2-capture-d2-form-component"]')
cy.get('[data-test="d2-form-component"]')
.find('[data-test="capture-ui-input"]')
.eq(2)
.type('Gonz')
.blur();
});

And('you fill in the first name with values that have exactly 5 duplicates', () => {
cy.get('[data-test="dhis2-capture-d2-form-component"]')
cy.get('[data-test="d2-form-component"]')
.find('[data-test="capture-ui-input"]')
.eq(1)
.type('Tesmi')
.blur();
cy.get('[data-test="dhis2-capture-d2-form-component"]')
cy.get('[data-test="d2-form-component"]')
.find('[data-test="capture-ui-input"]')
.eq(2)
.type('Abel')
.blur();
});

When('you click create', () => {
cy.get('[data-test="dhis2-capture-possible-duplicates-found-button"]')
cy.get('[data-test="possible-duplicates-found-button"]')
.should('exist');

cy.get('[data-test="dhis2-capture-create-and-link-button"]')
cy.get('[data-test="create-and-link-button"]')
.click();
});

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


And('you can see a modal', () => {
cy.get('[data-test="dhis2-capture-duplicates-modal"]')
cy.get('[data-test="duplicates-modal"]')
.should('exist');
});

And('you can see the first page of the results', () => {
cy.get('[data-test="dhis2-capture-search-results-list"]')
cy.get('[data-test="search-results-list"]')
.should('exist');
cy.get('[data-test="dhis2-capture-card-list-item"]')
cy.get('[data-test="card-list-item"]')
.should('have.length.greaterThan', 0);
cy.get('[data-test="dhis2-capture-pagination"]')
cy.get('[data-test="pagination"]')
.contains('Page 1')
.should('exist');
});

Then('you click the next page button', () => {
cy.get('[data-test="dhis2-capture-search-pagination-next-page"]')
cy.get('[data-test="search-pagination-next-page"]')
.click();
});

Then('you can see the second page of the results', () => {
cy.get('[data-test="dhis2-capture-search-results-list"]')
cy.get('[data-test="search-results-list"]')
.should('exist');
cy.get('[data-test="dhis2-capture-card-list-item"]')
cy.get('[data-test="card-list-item"]')
.should('have.length.greaterThan', 0);
cy.get('[data-test="dhis2-capture-pagination"]')
cy.get('[data-test="pagination"]')
.contains('Page 2')
.should('exist');
});

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

Then('all pagination is disabled', () => {
cy.get('[data-test="dhis2-capture-pagination"]')
cy.get('[data-test="pagination"]')
.contains('Page 1')
.should('exist');
});
Expand All @@ -112,7 +112,7 @@ And('you can see an empty page', () => {
});

Then('all pagination is disabled', () => {
cy.get('[data-test="dhis2-capture-pagination"]')
cy.get('[data-test="pagination"]')
.contains('Page 1')
.should('exist');
});
Expand Down
Loading

0 comments on commit 45717c4

Please sign in to comment.