Skip to content

Commit 31aa2e0

Browse files
[PRMP-595] Implement new document screens (#895)
1 parent da20309 commit 31aa2e0

File tree

101 files changed

+1653
-2335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1653
-2335
lines changed

app/cypress/e2e/0-ndr-core-tests/auth_routes/auth_general_browser_states.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('Authentication & Authorisation', () => {
5050
routes.home,
5151
routes.patientSearch,
5252
'/patient/verify',
53-
'/patient/arf',
53+
'/patient/documents',
5454
'/patient/lloyd-george-record',
5555
routes.createReport,
5656
routes.createReportComplete,

app/cypress/e2e/0-ndr-core-tests/auth_routes/auth_gp_admin_path_access.cy.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ const patient = {
1717
const baseUrl = Cypress.config('baseUrl');
1818
const patientVerifyUrl = '/patient/verify';
1919
const lloydGeorgeViewUrl = '/patient/lloyd-george-record';
20-
const arfDownloadUrl = '/patient/arf';
21-
22-
const forbiddenRoutes = [arfDownloadUrl];
2320

2421
describe('GP Admin user role has access to the expected GP_ADMIN workflow paths', () => {
2522
context('GP Admin role has access to expected routes', () => {
@@ -52,19 +49,3 @@ describe('GP Admin user role has access to the expected GP_ADMIN workflow paths'
5249
});
5350
});
5451
});
55-
56-
describe('GP Admin user role cannot access expected forbidden routes', () => {
57-
context('GP Admin role has no access to forbidden routes', () => {
58-
forbiddenRoutes.forEach((forbiddenRoute) => {
59-
it(
60-
'GP Admin role cannot access route ' + forbiddenRoute,
61-
{ tags: 'regression' },
62-
() => {
63-
cy.login(Roles.GP_ADMIN);
64-
cy.visit(forbiddenRoute);
65-
cy.url().should('include', 'unauthorised');
66-
},
67-
);
68-
});
69-
});
70-
});

app/cypress/e2e/0-ndr-core-tests/auth_routes/auth_gp_clinical_path_access.cy.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ const patient = {
1717
const baseUrl = Cypress.config('baseUrl');
1818
const patientVerifyUrl = '/patient/verify';
1919
const lloydGeorgeViewUrl = '/patient/lloyd-george-record';
20-
const arfDownloadUrl = '/patient/arf';
21-
const forbiddenRoutes = [arfDownloadUrl];
2220

2321
describe('GP Clinical user role has access to the expected GP_CLINICAL workflow paths', () => {
2422
context(`GP Clinical role has access to expected routes`, () => {
@@ -50,20 +48,4 @@ describe('GP Clinical user role has access to the expected GP_CLINICAL workflow
5048
cy.url().should('eq', baseUrl + lloydGeorgeViewUrl);
5149
});
5250
});
53-
});
54-
55-
describe('GP Clinical user role cannot access expected forbidden routes', () => {
56-
context('GP Clinical role has no access to forbidden routes', () => {
57-
forbiddenRoutes.forEach((forbiddenRoute) => {
58-
it(
59-
'GP Clinical role cannot access route ' + forbiddenRoute,
60-
{ tags: 'regression' },
61-
() => {
62-
cy.login(Roles.GP_CLINICAL);
63-
cy.visit(forbiddenRoute);
64-
cy.url().should('include', 'unauthorised');
65-
},
66-
);
67-
});
68-
});
69-
});
51+
});

app/cypress/e2e/0-ndr-core-tests/auth_routes/auth_pcse_path_access.cy.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Roles } from '../../../support/roles';
22
import { routes } from '../../../support/routes';
3+
import { DOCUMENT_TYPE } from '../../../../src/helpers/utils/documentType';
34

45
const testPatient = '9000000009';
56
const patient = {
@@ -16,7 +17,7 @@ const patient = {
1617

1718
const baseUrl = Cypress.config('baseUrl');
1819
const lloydGeorgeViewUrl = '/patient/lloyd-george-record';
19-
const arfDownloadUrl = '/patient/arf';
20+
const documentsUrl = '/patient/documents';
2021

2122
const forbiddenRoutes = [lloydGeorgeViewUrl];
2223

@@ -28,6 +29,11 @@ describe('PCSE user role has access to the expected GP_ADMIN workflow paths', ()
2829
body: patient,
2930
}).as('search');
3031

32+
cy.intercept('GET', '/SearchDocumentReferences*', {
33+
statusCode: 200,
34+
body: [],
35+
}).as('documentSearch');
36+
3137
cy.login(Roles.PCSE);
3238

3339
cy.url().should('eq', baseUrl + routes.home);
@@ -40,7 +46,9 @@ describe('PCSE user role has access to the expected GP_ADMIN workflow paths', ()
4046
cy.wait('@search');
4147

4248
cy.get('#verify-submit').click();
43-
cy.url().should('eq', baseUrl + arfDownloadUrl);
49+
50+
cy.wait('@documentSearch');
51+
cy.url().should('eq', baseUrl + documentsUrl);
4452
});
4553
});
4654
});

app/cypress/e2e/0-ndr-core-tests/feature_flag_workflows/arf_workflow.cy.js

Lines changed: 0 additions & 122 deletions
This file was deleted.

app/cypress/e2e/0-ndr-core-tests/gp_user_workflows/download_lloyd_george_workflow.cy.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe('GP Workflow: View Lloyd George record', () => {
128128
cy.get('#verify-submit').click();
129129
cy.wait('@stitchJobCompleted', { timeout: 20000 });
130130

131-
cy.getByTestId('download-all-files-link').click();
131+
cy.getByTestId('download-files-link').click();
132132
};
133133

134134
context('Download Lloyd George document', () => {
@@ -153,8 +153,8 @@ describe('GP Workflow: View Lloyd George record', () => {
153153
cy.wait('@stitchJobCompleted', { timeout: 20000 });
154154
cy.title().should('eq', lloydGeorgeRecordPageTitle);
155155

156-
cy.getByTestId('download-all-files-link', { timeout: 20000 }).should('exist');
157-
cy.getByTestId('download-all-files-link').click();
156+
cy.getByTestId('download-files-link', { timeout: 20000 }).should('exist');
157+
cy.getByTestId('download-files-link').click();
158158

159159
// Select documents page
160160
cy.title().should('eq', downloadPageTitle);
@@ -270,8 +270,8 @@ describe('GP Workflow: View Lloyd George record', () => {
270270
cy.wait('@stitchJobCompleted', { timeout: 20000 });
271271
cy.title().should('eq', lloydGeorgeRecordPageTitle);
272272

273-
cy.getByTestId('download-all-files-link').should('exist');
274-
cy.getByTestId('download-all-files-link').click();
273+
cy.getByTestId('download-files-link').should('exist');
274+
cy.getByTestId('download-files-link').click();
275275

276276
// Select documents page
277277
cy.title().should('eq', downloadPageTitle);
@@ -384,7 +384,7 @@ describe('GP Workflow: View Lloyd George record', () => {
384384
cy.get('#verify-submit').click();
385385
cy.wait('@stitchJobPostEmpty', { timeout: 20000 });
386386

387-
cy.getByTestId('download-all-files-link').should('not.exist');
387+
cy.getByTestId('download-files-link').should('not.exist');
388388
},
389389
);
390390

@@ -399,7 +399,7 @@ describe('GP Workflow: View Lloyd George record', () => {
399399
cy.get('#verify-submit').click();
400400
cy.wait('@stitchJobCompleted', { timeout: 20000 });
401401

402-
cy.getByTestId('download-all-files-link').should('not.exist');
402+
cy.getByTestId('download-files-link').should('not.exist');
403403
},
404404
);
405405

@@ -418,8 +418,8 @@ describe('GP Workflow: View Lloyd George record', () => {
418418
cy.get('#verify-submit').click();
419419
cy.wait('@stitchJobCompleted', { timeout: 20000 });
420420

421-
cy.getByTestId('download-all-files-link').should('exist');
422-
cy.getByTestId('download-all-files-link').click();
421+
cy.getByTestId('download-files-link').should('exist');
422+
cy.getByTestId('download-files-link').click();
423423

424424
cy.wait('@documentManifest');
425425

app/cypress/e2e/0-ndr-core-tests/gp_user_workflows/patient_search_and_verify_workflow.cy.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -148,43 +148,6 @@ describe('GP Workflow: Patient search and verify', () => {
148148
);
149149
});
150150

151-
// skipped as arf journey is not viable at this point in time
152-
it.skip(
153-
`Shows patient upload screen when patient search is used as a
154-
GP_ADMIN and patient response is inactive`,
155-
{ tags: 'regression' },
156-
() => {
157-
setup(Roles.GP_ADMIN);
158-
cy.intercept('GET', '/SearchPatient*', {
159-
statusCode: 200,
160-
body: patient,
161-
}).as('search');
162-
163-
cy.get('#nhs-number-input').click();
164-
cy.get('#nhs-number-input').type(testPatient);
165-
cy.title().should(
166-
'eq',
167-
'Search for a patient - Access and store digital patient documents',
168-
);
169-
170-
cy.get('#search-submit').click();
171-
cy.wait('@search');
172-
cy.title().should('eq', 'Patient details - Access and store digital patient documents');
173-
174-
cy.url().should('include', 'verify');
175-
cy.url().should('eq', baseUrl + routes.patientVerify);
176-
cy.get('#gp-message').should('be.visible');
177-
cy.get('#gp-message').should(
178-
'have.text',
179-
'This page displays the current data recorded in the Personal Demographics Service for this patient.',
180-
);
181-
cy.get('#verify-submit').click();
182-
183-
cy.url().should('include', 'upload');
184-
cy.url().should('eq', baseUrl + routes.arfUpload);
185-
},
186-
);
187-
188151
it(
189152
'Does not show the upload documents page when upload patient is verified and inactive as a GP_Clinical',
190153
{ tags: 'regression' },

0 commit comments

Comments
 (0)