Skip to content

Commit

Permalink
smoketest url endpoint updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Alexander committed May 17, 2024
1 parent e4fc991 commit 83637bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ describe('GP Workflow: Patient search and verify', () => {
const activePatient =
workspace === 'ndr-dev' ? pdsPatients.activeUpload : stubPatients.activeUpload;
const homeUrl = '/home';
const verifyPatientUrl = '/search/patient/verify';
const lloydGeorgeUrl = '/patient/view/lloyd-george-record';
const patientVerifyUrl = '/patient/verify';
const lloydGeorgeRecordUrl = '/patient/lloyd-george-record';

gpRoles.forEach((role) => {
it(
Expand All @@ -30,10 +30,10 @@ describe('GP Workflow: Patient search and verify', () => {
cy.get('#nhs-number-input').type(activePatient);
cy.get('#search-submit').click();

cy.url({ timeout: 20000 }).should('eq', baseUrl + verifyPatientUrl);
cy.url({ timeout: 20000 }).should('eq', baseUrl + patientVerifyUrl);
cy.get('#verify-submit').click();

cy.url({ timeout: 10000 }).should('eq', baseUrl + lloydGeorgeUrl);
cy.url({ timeout: 10000 }).should('eq', baseUrl + lloydGeorgeRecordUrl);
},
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ const uploadedFileNames = [
'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 patientVerifyUrl = '/patient/verify';
const lloydGeorgeRecordUrl = '/patient/lloyd-george-record';

const activePatient =
workspace === 'ndr-dev' ? pdsPatients.activeNoUploadBsol : stubPatients.activeNoUploadBsol;

Expand All @@ -33,12 +36,12 @@ describe('GP Workflow: Upload Lloyd George record', () => {
cy.getByTestId('search-submit-btn').should('exist');
cy.getByTestId('search-submit-btn').click();

cy.url({ timeout: 15000 }).should('contain', '/search/patient/verify');
cy.url({ timeout: 15000 }).should('contain', patientVerifyUrl);

cy.get('#verify-submit').should('exist');
cy.get('#verify-submit').click();

cy.url().should('contain', '/patient/view/lloyd-george-record');
cy.url().should('contain', lloydGeorgeRecordUrl);
cy.getByTestId('upload-patient-record-text').should(
'include.text',
'You can upload full or part of a patient record',
Expand Down Expand Up @@ -74,7 +77,7 @@ describe('GP Workflow: Upload Lloyd George record', () => {
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);
cy.url().should('eq', baseUrl + lloydGeorgeRecordUrl);
},
);
});
Expand Down

0 comments on commit 83637bf

Please sign in to comment.