Add Random Sampling E2E Test (OP-2837)#93
Open
sunilparajuli wants to merge 2 commits intoopenimis:feature/coremis-e2e-vitefrom
Open
Add Random Sampling E2E Test (OP-2837)#93sunilparajuli wants to merge 2 commits intoopenimis:feature/coremis-e2e-vitefrom
sunilparajuli wants to merge 2 commits intoopenimis:feature/coremis-e2e-vitefrom
Conversation
weilu
reviewed
Mar 15, 2026
Comment on lines
+7
to
+15
| cy.fixture('cred').then((cred) => { | ||
| this.cred = cred; | ||
| cy.get('input[type="text"]').type(this.cred.username); | ||
| cy.get('input[type="password"]').type(this.cred.password); | ||
| cy.get('button[type="submit"]').click(); | ||
|
|
||
| // Ensure login is successful and we are on the home page | ||
| cy.contains('Welcome').should('be.visible'); | ||
| }); |
Contributor
There was a problem hiding this comment.
Use cy.login defined in commands.js?
|
|
||
| const randomPercent = Math.floor(Math.random() * 16) + 5; | ||
| cy.enterMuiInput('Percent of claims', randomPercent); | ||
| cy.chooseMuiSelect('Task Group', 'any'); |
Contributor
There was a problem hiding this comment.
Is this task group guaranteed to exist for our CI setup?
Comment on lines
+642
to
+649
| // Fallback: if specific value not found, pick the first available option | ||
| if (!found) { | ||
| cy.wrap($options.first()).click({ force: true }); | ||
| } | ||
| } else { | ||
| // Fallback: just close the dropdown by clicking the body if no options found | ||
| cy.get('body').click(0, 0); | ||
| } |
Contributor
There was a problem hiding this comment.
Another PR is going to implement chooseMuiSelectFirstAvailable: https://github.com/openimis/openimis-dist_dkr/pull/84/changes#r2913544525 Consider using that instead of this fallback as the intention is more explicit.
| cy.contains(/CREATE CLAIM SAMPLE/i).click({ force: true }); | ||
|
|
||
| // Verify success confirmation and return to page | ||
| cy.contains(/New task for claim sampling was created/i).should('be.visible'); |
Contributor
There was a problem hiding this comment.
Is the task creation the end of this workflow? Don't we want to check the entities are created as expected after the task is approved?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description: Add Random Sampling E2E Test (OP-2837)
Add E2E test for the Random Sampling module.
What was done:
Implemented the 4-step workflow in
cypress/e2e/randomsampling.cy.js
.
Improved MUI interaction commands in
cypress/support/commands.js
to ensure stability on the Vite distribution.
Verification:
Verified manually in the browser and via automated Cypress runs.
Confirmed working on the latest Docker environment.
Jira Ticket: OP-2837