-
Notifications
You must be signed in to change notification settings - Fork 1
[RPMP-1266] Review-reassign cypress smoke test #1011
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
Open
kamenbachvarov-nhs
wants to merge
6
commits into
main
Choose a base branch
from
PRMP-1266
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+137
−21
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e4d502c
WIP - add review item to the review table fix
kamenbachvarov-nhs 1e7a802
WIP - click admin console
kamenbachvarov-nhs 40d221f
WIP
kamenbachvarov-nhs 50bc59c
review reassign smoke test rc
kamenbachvarov-nhs 5e986e4
fix test name
kamenbachvarov-nhs 3239575
fix admin hub datatestid and review reason
kamenbachvarov-nhs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
app/cypress/e2e/1-ndr-smoke-tests/gp_user_workflows/review_reassign_happy_workflow.cy.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| import { Roles } from '../../../support/roles'; | ||
| import dbItem from '../../../fixtures/dynamo-db-items/example-review-h81109.json'; | ||
|
|
||
| const workspace = Cypress.env('WORKSPACE'); | ||
| const tableName = `${workspace}_DocumentUploadReview`; | ||
| const path = `9730155348/e3e4f62e-6f95-4d8c-8870-5212b6353ae9/test_patient_record.pdf`; | ||
| const bucketName = `${workspace}-document-pending-review-store`; | ||
|
|
||
| describe('GP Workflow: Review and Reassign', () => { | ||
| context('Review and Reassign', () => { | ||
| beforeEach(() => { | ||
| cy.addItemToDynamoDb(tableName, dbItem); | ||
| cy.addPdfFileToS3(bucketName, path, 'test_patient_record.pdf'); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| cy.deleteItemFromDynamoDb(tableName, dbItem.ID, 1); | ||
| cy.deleteItemFromDynamoDb(tableName, dbItem.ID, 2); | ||
| cy.deleteFileFromS3(bucketName, path); | ||
| }); | ||
|
|
||
| it( | ||
| '[Smoke] GP ADMIN user can review and reassign a document to the correct patient', | ||
| { tags: 'smoke', defaultCommandTimeout: 20000 }, | ||
| () => { | ||
| cy.smokeLogin(Roles.SMOKE_GP_ADMIN); | ||
|
|
||
| // click admin console | ||
| cy.navigateToHomePage(); | ||
| cy.getByTestId('admin-hub-btn').should('exist').click(); | ||
|
|
||
| // click review docs | ||
| cy.getByTestId('admin-reviews-btn').should('exist').click(); | ||
|
|
||
| // find the example review item by nhs number and view it | ||
| cy.getByTestId('view-record-link-e3e4f62e-6f95-4d8c-8870-5212b6353ae9') | ||
| .should('exist') | ||
| .click(); | ||
|
|
||
| // click "dont accept the record" and continue | ||
| cy.getByTestId('reject-record-option').should('exist').check(); | ||
| cy.getByTestId('reject-record-option').should('be.checked'); | ||
| cy.getByTestId('continue-btn').should('exist').click(); | ||
|
|
||
| // find the textbox and search for the correct nhs number to reassign to | ||
| cy.getByTestId('nhs-number-input').should('exist').click(); | ||
| cy.getByTestId('nhs-number-input').type('9730788197'); | ||
| cy.getByTestId('continue-button').should('exist').click(); | ||
|
|
||
| // confirm demographics of the new patient and continue | ||
| cy.getByTestId('confirm-patient-details-btn').should('exist').click(); | ||
|
|
||
| // assert reassignment success message and path | ||
| cy.contains('This document has been matched to the correct patient').should( | ||
| 'be.visible', | ||
| ); | ||
| cy.url().should('contain', '/admin/reviews/:reviewId/complete/patient-matched'); | ||
|
|
||
| // assert the review is no longer in our review queue | ||
| cy.getByTestId('review-another-btn').should('exist').click(); | ||
| cy.getByTestId('view-record-link-e3e4f62e-6f95-4d8c-8870-5212b6353ae9').should( | ||
| 'not.exist', | ||
| ); | ||
|
|
||
| // logout | ||
| cy.getByTestId('logout-btn').click(); | ||
|
|
||
| // login as new ods code to verify the document is now in their review queue | ||
| cy.getByTestId('start-btn').should('exist'); // wait for login button to appear after logout | ||
| cy.smokeLogin(Roles.SMOKE_GP_ADMIN, 'M85143'); | ||
| cy.navigateToHomePage(); | ||
| cy.getByTestId('admin-hub-btn').should('exist').click(); | ||
| cy.getByTestId('admin-reviews-btn').should('exist').click(); | ||
| cy.getByTestId('view-record-link-e3e4f62e-6f95-4d8c-8870-5212b6353ae9').should( | ||
| 'exist', | ||
| ); | ||
| }, | ||
| ); | ||
| }); | ||
| }); |
17 changes: 17 additions & 0 deletions
17
app/cypress/fixtures/dynamo-db-items/example-review-h81109.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "ID": "e3e4f62e-6f95-4d8c-8870-5212b6353ae9", | ||
| "Version": 1, | ||
| "Author": "H81109", | ||
| "Custodian": "H81109", | ||
| "DocumentSnomedCodeType": "16521000000101", | ||
| "Files": [ | ||
| { | ||
| "FileLocation": "s3://ndrk-document-pending-review-store/9730155348/e3e4f62e-6f95-4d8c-8870-5212b6353ae9/test_patient_record.pdf", | ||
| "FileName": "test_patient_record.pdf" | ||
| } | ||
| ], | ||
| "NhsNumber": "9730155348", | ||
| "ReviewReason": "Unsuccessful upload", | ||
| "ReviewStatus": "PENDING_REVIEW", | ||
| "UploadDate": 1768728372 | ||
| } | ||
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this probably needs to be ndr-dev or "workspace" variable somehow