Skip to content

Commit

Permalink
chore: stabilize cypress tests in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
simonadomnisoru committed Dec 16, 2024
1 parent 6782c70 commit 8cd7192
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Feature: User interacts with the Enrollment New Event Workspace
And the user selects Positive
And you click the Save without completing button
Then all events should be displayed
And the newest event in datatable nr 1 should contain Active
And the newest event in datatable nr 1 should contain 13
And the newest event in datatable nr 1 should contain Positive
And the newest event in datatable nr 2 should contain Active
And the newest event in datatable nr 2 should contain 13
And the newest event in datatable nr 2 should contain Positive
And the events in Sputum smear microscopy are deleted

Scenario: Required fields should display an error when saving without data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Then('all events should be displayed', () => {
});

Then(/^the newest event in datatable nr (.*) should contain (.*)$/, (eq, status) => {
cy.get('[data-test="dhis2-uicore-datatable"]')
cy.get('[data-test="stage-content"]')
.eq(eq)
.within(() => {
cy.get('[data-test="dhis2-uicore-datatablerow"]')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ Feature: User interacts with Stages and Events Widget
When you click the Unskip event overflow button on the Skipped event
Then there is an Overdue event in the TB visit stage

@with-restore-deleted-event
@with-add-event-to-delete
Scenario: User can delete an event
Given you open the enrollment page by typing #/enrollment?enrollmentId=ikYMpSKXik1&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=Trc1H9T5C6f
Given you open the enrollment page by typing #/enrollment?enrollmentId=hVPClvNrk9Z&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=WLecfORSpr0
And there is an Active event in the TB visit stage
When you click the Delete event overflow button on the Active event
And you confirm you want to delete the event
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Given, When, Then, defineStep as And, After } from '@badeball/cypress-cucumber-preprocessor';
import { Given, When, Then, defineStep as And, Before } from '@badeball/cypress-cucumber-preprocessor';
import { getCurrentYear } from '../../../support/date';
import '../sharedSteps';

After({ tags: '@with-restore-deleted-event' }, () => {
cy.visit('#/enrollment?enrollmentId=ikYMpSKXik1&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=Trc1H9T5C6f');
Before({ tags: '@with-add-event-to-delete' }, () => {
cy.visit('#/enrollment?enrollmentId=hVPClvNrk9Z&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=WLecfORSpr0');

cy.get('[data-test="stages-and-events-widget"]')
.find('[data-test="widget-contents"]')
Expand Down

0 comments on commit 8cd7192

Please sign in to comment.