Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: cleanup after running NewPage tests #3843

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cypress/e2e/NewPage/NewPage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ Feature: User creates a new entries from the registration page
And you fill the Malaria case diagnosis registration form with values
And you click the save malaria entity submit button
Then you see the enrollment event Edit page
# Cleanup
And you delete the recently added malaria entity


## New enrollment of existing TEI

Expand Down
15 changes: 13 additions & 2 deletions cypress/e2e/NewPage/NewPage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Given, When, Then, defineStep as And } from '@badeball/cypress-cucumber-preprocessor';
import { defineStep as And, Given, Then, When } from '@badeball/cypress-cucumber-preprocessor';
import moment from 'moment';
import { getCurrentYear } from '../../support/date';

Expand All @@ -17,7 +17,7 @@ And('there should be informative message explaining you need to select an organi
});

And('you select tracked entity type person', () => {
cy.get('[data-test="dhis2-uicore-select"')
cy.get('[data-test="dhis2-uicore-select"]')
.click();
cy.get('[data-test="dhis2-uicore-singleselectoption"]')
.contains('Person')
Expand Down Expand Up @@ -645,6 +645,17 @@ And('you delete the recently added tracked entity', () => {
cy.url().should('include', 'selectedTemplateId=IpHINAT79UW');
});

And('you delete the recently added malaria entity', () => {
cy.get('[data-test="widget-profile-overflow-menu"]')
.click();
cy.contains('Delete Malaria Entity')
.click();
cy.get('[data-test="widget-profile-delete-modal"]').within(() => {
cy.contains('Yes, delete Malaria Entity')
.click();
});
});

And(/^you select (.*) from the available tracked entity types/, (selection) => {
cy.get('[data-test="dhis2-uicore-select-input"]')
.click();
Expand Down
Loading