-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
19 changed files
with
129 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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 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 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
5 changes: 3 additions & 2 deletions
5
...ess/e2e/1-ndr-smoke-tests/gp_user_workflows/download_lloyd_george_not_bsol_workflow.cy.js
This file contains 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 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
81 changes: 81 additions & 0 deletions
81
...e/1-ndr-smoke-tests/gp_user_workflows/upload_lloyd_george_is_bsol_gp_admin_workflow.cy.js
This file contains 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,81 @@ | ||
import { pdsPatients, stubPatients } from '../../../support/patients'; | ||
import { Roles } from '../../../support/roles'; | ||
|
||
const workspace = Cypress.env('WORKSPACE'); | ||
const uploadedFilePathNames = [ | ||
'cypress/fixtures/lg-files/jane_smith/1of3_Lloyd_George_Record_[Jane Smith]_[9000000004]_[22-10-2010].pdf', | ||
'cypress/fixtures/lg-files/jane_smith/2of3_Lloyd_George_Record_[Jane Smith]_[9000000004]_[22-10-2010].pdf', | ||
'cypress/fixtures/lg-files/jane_smith/3of3_Lloyd_George_Record_[Jane Smith]_[9000000004]_[22-10-2010].pdf', | ||
]; | ||
const uploadedFileNames = [ | ||
'1of3_Lloyd_George_Record_[Jane Smith]_[9000000004]_[22-10-2010].pdf', | ||
'2of3_Lloyd_George_Record_[Jane Smith]_[9000000004]_[22-10-2010].pdf', | ||
'3of3_Lloyd_George_Record_[Jane Smith]_[9000000004]_[22-10-2010].pdf', | ||
]; | ||
const viewLloydGeorgeRecordUrl = '/patient/view/lloyd-george-record'; | ||
const baseUrl = Cypress.config('baseUrl'); | ||
const tableName = `${workspace}_LloydGeorgeReferenceMetadata`; | ||
|
||
const activePatient = | ||
workspace === 'ndr-dev' ? pdsPatients.activeNoUploadBsol : stubPatients.activeNoUploadBsol; | ||
|
||
describe('GP Workflow: Upload Lloyd George record', () => { | ||
context('Upload a Lloyd George document', () => { | ||
it( | ||
'[Smoke] BSOL GP ADMIN can upload and then view a Lloyd George record for an active patient with no record', | ||
{ tags: 'smoke', defaultCommandTimeout: 20000 }, | ||
() => { | ||
cy.smokeLogin(Roles.GP_ADMIN_BSOL); | ||
|
||
cy.get('#nhs-number-input').should('exist'); | ||
cy.get('#nhs-number-input').click(); | ||
cy.get('#nhs-number-input').type(activePatient); | ||
cy.getByTestId('search-submit-btn').should('exist'); | ||
cy.getByTestId('search-submit-btn').click(); | ||
|
||
cy.url({ timeout: 15000 }).should('contain', '/search/patient/verify'); | ||
|
||
cy.get('#verify-submit').should('exist'); | ||
cy.get('#verify-submit').click(); | ||
|
||
cy.url().should('contain', '/patient/view/lloyd-george-record'); | ||
cy.getByTestId('upload-patient-record-text').should( | ||
'include.text', | ||
'You can upload full or part of a patient record', | ||
); | ||
cy.getByTestId('upload-patient-record-button').should('exist'); | ||
cy.getByTestId('upload-patient-record-button').click(); | ||
uploadedFilePathNames.forEach((file) => { | ||
cy.getByTestId('button-input').selectFile(file, { force: true }); | ||
}); | ||
cy.get('#upload-button').click(); | ||
uploadedFileNames.forEach((name) => { | ||
cy.getByTestId('upload-documents-table').should('contain', name); | ||
}); | ||
cy.getByTestId('upload-complete-page', { timeout: 20000 }).should('exist'); | ||
cy.getByTestId('upload-complete-page') | ||
.should('include.text', 'Record uploaded for') | ||
.should( | ||
'include.text', | ||
`You have successfully uploaded ${uploadedFileNames.length} files`, | ||
) | ||
.should('include.text', 'Hide files'); | ||
|
||
uploadedFileNames.forEach((name) => { | ||
cy.getByTestId('upload-complete-page').should('contain', name); | ||
cy.getByTestId(name.split('_')[0]) | ||
.invoke('attr', 'data-ref') | ||
.then((ref) => { | ||
cy.deleteItemFromDynamoDb(tableName, ref); | ||
}); | ||
}); | ||
cy.getByTestId('upload-complete-card').should('be.visible'); | ||
cy.getByTestId('view-record-btn').should('be.visible'); | ||
cy.getByTestId('search-patient-btn').should('be.visible'); | ||
cy.getByTestId('view-record-btn').should('be.visible'); | ||
cy.getByTestId('view-record-btn').click(); | ||
cy.url().should('eq', baseUrl + viewLloydGeorgeRecordUrl); | ||
}, | ||
); | ||
}); | ||
}); |
Binary file added
BIN
+57.9 KB
...s/lg-files/jane_smith/1of3_Lloyd_George_Record_[Jane Smith]_[9000000004]_[22-10-2010].pdf
Binary file not shown.
Binary file added
BIN
+57.9 KB
...s/lg-files/jane_smith/2of3_Lloyd_George_Record_[Jane Smith]_[9000000004]_[22-10-2010].pdf
Binary file not shown.
Binary file added
BIN
+57.9 KB
...s/lg-files/jane_smith/3of3_Lloyd_George_Record_[Jane Smith]_[9000000004]_[22-10-2010].pdf
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
export const pdsPatients = { | ||
activeUpload: 9730153817, | ||
activeNoUploadBsol: 9730787077, | ||
}; | ||
|
||
export const stubPatients = { | ||
activeNoUpload: 9000000002, | ||
activeUpload: 9730153817, | ||
activeNoUploadBsol: 9000000004, | ||
}; |
This file contains 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 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 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 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 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