diff --git a/cypress/e2e/attorney/trust-corporation.cy.js b/cypress/e2e/attorney/trust-corporation.cy.js index e58ca61234..86b29182b9 100644 --- a/cypress/e2e/attorney/trust-corporation.cy.js +++ b/cypress/e2e/attorney/trust-corporation.cy.js @@ -7,8 +7,10 @@ describe('As a trust corporation', () => { // start cy.contains('a', 'Start').click(); - cy.contains('label', 'Random value').click(); - cy.get('form').submit(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Random value').click(); + cy.get('form').submit(); + }); // enter reference number cy.get('#f-reference-number').type(shareCode); diff --git a/cypress/e2e/certificate-provider/confirm-your-identity.cy.js b/cypress/e2e/certificate-provider/confirm-your-identity.cy.js index 3ea73c661a..1fd0c4115b 100644 --- a/cypress/e2e/certificate-provider/confirm-your-identity.cy.js +++ b/cypress/e2e/certificate-provider/confirm-your-identity.cy.js @@ -10,9 +10,10 @@ describe('confirm your identity', () => { it('can see details when successful', () => { cy.contains('button', 'Continue').click() - cy.get('[name="user"]').check('certificate-provider', { force: true }) - - cy.contains('button', 'Continue').click() + cy.origin('http://localhost:7012', () => { + cy.get('[name="user"]').check('certificate-provider', { force: true }) + cy.contains('button', 'Continue').click() + }); cy.url().should('contain', '/identity-details'); cy.checkA11yApp(); @@ -32,9 +33,10 @@ describe('confirm your identity', () => { it('can see details when not matched', () => { cy.contains('button', 'Continue').click() - cy.get('[name="user"]').check('donor', { force: true }) - - cy.contains('button', 'Continue').click() + cy.origin('http://localhost:7012', () => { + cy.get('[name="user"]').check('donor', { force: true }) + cy.contains('button', 'Continue').click() + }); cy.url().should('contain', '/identity-details'); cy.checkA11yApp(); @@ -54,9 +56,10 @@ describe('confirm your identity', () => { it('can see next steps when failing', () => { cy.contains('button', 'Continue').click() - cy.get('[name="return-code"]').check('T', { force: true }) - - cy.contains('button', 'Continue').click() + cy.origin('http://localhost:7012', () => { + cy.get('[name="return-code"]').check('T', { force: true }) + cy.contains('button', 'Continue').click() + }); cy.url().should('contain', '/identity-details'); cy.checkA11yApp(); @@ -72,9 +75,10 @@ describe('confirm your identity', () => { it('can see next steps when has insufficient evidence', () => { cy.contains('button', 'Continue').click() - cy.get('[name="return-code"]').check('X', { force: true }) - - cy.contains('button', 'Continue').click() + cy.origin('http://localhost:7012', () => { + cy.get('[name="return-code"]').check('X', { force: true }) + cy.contains('button', 'Continue').click() + }) cy.url().should('contain', '/identity-details'); cy.checkA11yApp(); @@ -90,9 +94,12 @@ describe('confirm your identity', () => { it('can go to the post office ', () => { cy.url().should('contain', '/confirm-your-identity'); - cy.contains('button', 'Continue').click(); - cy.go(-2); + cy.url().then(u => { + cy.contains('button', 'Continue').click(); + cy.visit(u.split('/').slice(3, -1).join('/') + '/task-list'); + }); + cy.contains('li', "Confirm your identity") .should('contain', 'In progress') .find('a') diff --git a/cypress/e2e/certificate-provider/enter-reference-number.cy.js b/cypress/e2e/certificate-provider/enter-reference-number.cy.js index 863732b2ae..b13d62ff39 100644 --- a/cypress/e2e/certificate-provider/enter-reference-number.cy.js +++ b/cypress/e2e/certificate-provider/enter-reference-number.cy.js @@ -8,8 +8,10 @@ describe('Enter reference number', () => { cy.visit(`/fixtures/certificate-provider?redirect=/certificate-provider-start&withShareCode=${shareCode}&email=${TestEmail}`); cy.contains('a', 'Start').click() - cy.contains('label', 'Random value').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Random value').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/certificate-provider-enter-reference-number') }); diff --git a/cypress/e2e/certificate-provider/start.cy.js b/cypress/e2e/certificate-provider/start.cy.js index 9b0e781c03..001c7e7e11 100644 --- a/cypress/e2e/certificate-provider/start.cy.js +++ b/cypress/e2e/certificate-provider/start.cy.js @@ -7,7 +7,9 @@ describe('Start', () => { cy.contains('a', 'Start').click(); if (Cypress.config().baseUrl.includes('localhost')) { - cy.url().should('contain', '/authorize') + cy.origin('http://localhost:7012', () => { + cy.url().should('contain', '/authorize') + }); } else { cy.origin('https://signin.integration.account.gov.uk', () => { cy.url().should('contain', '/') diff --git a/cypress/e2e/donor/add-correspondent.cy.js b/cypress/e2e/donor/add-correspondent.cy.js index b2582e247c..d16ca9edee 100644 --- a/cypress/e2e/donor/add-correspondent.cy.js +++ b/cypress/e2e/donor/add-correspondent.cy.js @@ -36,10 +36,11 @@ describe('Add correspondent', () => { cy.contains('.govuk-summary-list__row', 'Reference number').find('.govuk-summary-list__value') .invoke('text') .then((uid) => { - cy.visit(`http://localhost:9001/?detail-type=correspondent-updated&detail=${uid}`); - - cy.contains(`{"uid":"${uid}",`); - cy.contains(`"firstNames":"John","lastName":"Smith","email":"email@example.com"}`); + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=correspondent-updated&detail=${uid}`); + cy.contains(`{"uid":"${uid}",`); + cy.contains(`"firstNames":"John","lastName":"Smith","email":"email@example.com"}`); + }); }); }); @@ -68,10 +69,11 @@ describe('Add correspondent', () => { cy.contains('.govuk-summary-list__row', 'Reference number').find('.govuk-summary-list__value') .invoke('text') .then((uid) => { - cy.visit(`http://localhost:9001/?detail-type=correspondent-updated&detail=${uid}`); - - cy.contains(`{"uid":"${uid}",`); - cy.contains(`"firstNames":"John","lastName":"Smith","email":"email@example.com","address":{"line1":"2 RICHMOND PLACE","line2":"","line3":"","town":"BIRMINGHAM","postcode":"B14 7ED","country":"GB"}}`); + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=correspondent-updated&detail=${uid}`) + cy.contains(`{"uid":"${uid}",`); + cy.contains(`"firstNames":"John","lastName":"Smith","email":"email@example.com","address":{"line1":"2 RICHMOND PLACE","line2":"","line3":"","town":"BIRMINGHAM","postcode":"B14 7ED","country":"GB"}}`); + }); }); }); }); diff --git a/cypress/e2e/donor/check-your-lpa.cy.js b/cypress/e2e/donor/check-your-lpa.cy.js index 5455df8025..ef5e8c6eef 100644 --- a/cypress/e2e/donor/check-your-lpa.cy.js +++ b/cypress/e2e/donor/check-your-lpa.cy.js @@ -1,271 +1,273 @@ describe('Check the LPA', () => { - it('cannot change when personal welfare LPA can be used', () => { - cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent&lpa-type=personal-welfare'); + it('cannot change when personal welfare LPA can be used', () => { + cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent&lpa-type=personal-welfare'); - cy.contains('.govuk-summary-list__row', 'When your attorneys can use your LPA') - .contains('Only when I do not have mental capacity') - .contains('Change').should('not.exist'); - }); + cy.contains('.govuk-summary-list__row', 'When your attorneys can use your LPA') + .contains('Only when I do not have mental capacity') + .contains('Change').should('not.exist'); + }); - it("can submit the completed LPA", () => { - cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent&certificateProviderEmail=test@example.com'); + it("can submit the completed LPA", () => { + cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent&certificateProviderEmail=test@example.com'); - cy.contains('h1', "Check your LPA") + cy.contains('h1', "Check your LPA") - cy.checkA11yApp(); + cy.checkA11yApp(); - cy.contains('h2', "LPA decisions") + cy.contains('h2', "LPA decisions") - cy.contains('dt', "When your attorneys can use your LPA") - cy.contains('dt', "Who are your attorneys") - cy.contains('dt', "Who are your replacement attorneys") + cy.contains('dt', "When your attorneys can use your LPA") + cy.contains('dt', "Who are your attorneys") + cy.contains('dt', "Who are your replacement attorneys") - cy.contains('h2', "People named on the LPA") - cy.contains('h3', "Donor") - cy.contains('h3', "Certificate provider") - cy.contains('h3', "Attorneys") + cy.contains('h2', "People named on the LPA") + cy.contains('h3', "Donor") + cy.contains('h3', "Certificate provider") + cy.contains('h3', "Attorneys") - cy.get('#f-checked-and-happy').check({ force: true }) + cy.get('#f-checked-and-happy').check({ force: true }) - cy.contains('button', 'Confirm').click(); + cy.contains('button', 'Confirm').click(); - cy.url().should('contain', '/lpa-details-saved'); + cy.url().should('contain', '/lpa-details-saved'); - cy.visit('/dashboard'); + cy.visit('/dashboard'); - cy.contains('.govuk-body-s', 'Reference number:') - .invoke('text') - .then((text) => { - const uid = text.split(':')[1].trim(); - cy.visit(`http://localhost:9001/?detail-type=notification-sent&detail=${uid}`); + cy.contains('.govuk-body-s', 'Reference number:') + .invoke('text') + .then((text) => { + const uid = text.split(':')[1].trim(); - cy.contains(`"uid":"${uid}"`) - cy.contains('"notificationId":"an-email-id"'); - }); - }); + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=notification-sent&detail=${uid}`); + cy.contains(`"uid":"${uid}"`) + cy.contains('"notificationId":"an-email-id"'); + }); + }); + }); - it('does not allow checking when no changes', () => { - cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent'); + it('does not allow checking when no changes', () => { + cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent'); - cy.get('#f-checked-and-happy').check({ force: true }) - cy.contains('button', 'Confirm').click(); + cy.get('#f-checked-and-happy').check({ force: true }) + cy.contains('button', 'Confirm').click(); - cy.visitLpa('/check-your-lpa'); - cy.contains('button', 'Confirm').should('not.exist'); + cy.visitLpa('/check-your-lpa'); + cy.contains('button', 'Confirm').should('not.exist'); - cy.visitLpa('/restrictions'); - cy.get('#f-restrictions').type('2'); - cy.contains('button', 'Save and continue').click(); + cy.visitLpa('/restrictions'); + cy.get('#f-restrictions').type('2'); + cy.contains('button', 'Save and continue').click(); - cy.visitLpa('/check-your-lpa'); - cy.contains('button', 'Confirm'); - }); + cy.visitLpa('/check-your-lpa'); + cy.contains('button', 'Confirm'); + }); - describe('CP acting on paper', () => { - describe('on first check', () => { - it('content is tailored for paper CPs, a details component is shown and nav redirects to payment', () => { - cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent&certificateProvider=paper'); + describe('CP acting on paper', () => { + describe('on first check', () => { + it('content is tailored for paper CPs, a details component is shown and nav redirects to payment', () => { + cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent&certificateProvider=paper'); - cy.url().should('contain', '/check-your-lpa'); - cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy to show it to my certificate provider, Charlie Cooper') - cy.get('details').contains('What happens if I need to make changes later?') + cy.url().should('contain', '/check-your-lpa'); + cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy to show it to my certificate provider, Charlie Cooper') + cy.get('details').contains('What happens if I need to make changes later?') - cy.get('#f-checked-and-happy').check({ force: true }) - cy.contains('button', 'Confirm').click(); + cy.get('#f-checked-and-happy').check({ force: true }) + cy.contains('button', 'Confirm').click(); - cy.url().should('contain', '/lpa-details-saved'); + cy.url().should('contain', '/lpa-details-saved'); - cy.get('div[data-module=govuk-notification-banner]').contains('You should show your LPA to your certificate provider, Charlie Cooper.') + cy.get('div[data-module=govuk-notification-banner]').contains('You should show your LPA to your certificate provider, Charlie Cooper.') - cy.contains('a', 'Continue').click(); + cy.contains('a', 'Continue').click(); - cy.url().should('contain', '/task-list'); - }) - }) + cy.url().should('contain', '/task-list'); + }) + }) - describe('on subsequent check when LPA has not been paid for', () => { - it('content is tailored for paper CPs, a warning component is shown and nav redirects to payment', () => { - cy.visit('/fixtures?redirect=/task-list&progress=checkAndSendToYourCertificateProvider&certificateProvider=paper'); + describe('on subsequent check when LPA has not been paid for', () => { + it('content is tailored for paper CPs, a warning component is shown and nav redirects to payment', () => { + cy.visit('/fixtures?redirect=/task-list&progress=checkAndSendToYourCertificateProvider&certificateProvider=paper'); - cy.contains('li', 'Add a correspondent').should('contain', 'Completed').click(); + cy.contains('li', 'Add a correspondent').should('contain', 'Completed').click(); - cy.url().should('contain', '/add-correspondent'); - cy.contains('label', 'No').click(); - cy.contains('button', 'Save and continue').click(); + cy.url().should('contain', '/add-correspondent'); + cy.contains('label', 'No').click(); + cy.contains('button', 'Save and continue').click(); - cy.url().should('contain', '/task-list'); - cy.contains('li', 'Check and send to your certificate provider').should('contain', 'In progress').click(); + cy.url().should('contain', '/task-list'); + cy.contains('li', 'Check and send to your certificate provider').should('contain', 'In progress').click(); - cy.url().should('contain', '/check-your-lpa'); - cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy to show it to my certificate provider, Charlie Cooper') - cy.get('.govuk-warning-text').contains('Once you select the confirm button, your certificate provider will be sent a text telling them you have changed your LPA.') + cy.url().should('contain', '/check-your-lpa'); + cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy to show it to my certificate provider, Charlie Cooper') + cy.get('.govuk-warning-text').contains('Once you select the confirm button, your certificate provider will be sent a text telling them you have changed your LPA.') - cy.get('#f-checked-and-happy').check({ force: true }) - cy.contains('button', 'Confirm').click(); + cy.get('#f-checked-and-happy').check({ force: true }) + cy.contains('button', 'Confirm').click(); - cy.url().should('contain', '/lpa-details-saved'); + cy.url().should('contain', '/lpa-details-saved'); - cy.get('div[data-module=govuk-notification-banner]').contains('We’ve saved your changes and sent a text to your certificate provider, Charlie Cooper, to tell them that your LPA is ready for review. You should show them your LPA.') + cy.get('div[data-module=govuk-notification-banner]').contains('We’ve saved your changes and sent a text to your certificate provider, Charlie Cooper, to tell them that your LPA is ready for review. You should show them your LPA.') - cy.contains('a', 'Continue').click(); + cy.contains('a', 'Continue').click(); - cy.url().should('contain', '/task-list'); - }) - }) + cy.url().should('contain', '/task-list'); + }) + }) - describe('on subsequent check when LPA has been paid for', () => { - it('content is tailored for paper CPs, a warning component is shown and nav redirects to dashboard', () => { - cy.visit('/fixtures?redirect=/task-list&progress=payForTheLpa&certificateProvider=paper'); + describe('on subsequent check when LPA has been paid for', () => { + it('content is tailored for paper CPs, a warning component is shown and nav redirects to dashboard', () => { + cy.visit('/fixtures?redirect=/task-list&progress=payForTheLpa&certificateProvider=paper'); - cy.contains('li', 'Add a correspondent').should('contain', 'Completed').click(); + cy.contains('li', 'Add a correspondent').should('contain', 'Completed').click(); - cy.url().should('contain', '/add-correspondent'); - cy.contains('label', 'No').click(); - cy.contains('button', 'Save and continue').click(); + cy.url().should('contain', '/add-correspondent'); + cy.contains('label', 'No').click(); + cy.contains('button', 'Save and continue').click(); - cy.url().should('contain', '/task-list'); - cy.contains('li', 'Check and send to your certificate provider').should('contain', 'In progress').click(); + cy.url().should('contain', '/task-list'); + cy.contains('li', 'Check and send to your certificate provider').should('contain', 'In progress').click(); - cy.url().should('contain', '/check-your-lpa'); - cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy to show it to my certificate provider, Charlie Cooper') - cy.get('.govuk-warning-text').contains('Once you select the confirm button, your certificate provider will be sent a text telling them you have changed your LPA.') + cy.url().should('contain', '/check-your-lpa'); + cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy to show it to my certificate provider, Charlie Cooper') + cy.get('.govuk-warning-text').contains('Once you select the confirm button, your certificate provider will be sent a text telling them you have changed your LPA.') - cy.get('#f-checked-and-happy').check({ force: true }) - cy.contains('button', 'Confirm').click(); + cy.get('#f-checked-and-happy').check({ force: true }) + cy.contains('button', 'Confirm').click(); - cy.url().should('contain', '/lpa-details-saved'); + cy.url().should('contain', '/lpa-details-saved'); - cy.get('div[data-module=govuk-notification-banner]').contains('We’ve saved your changes and sent a text to your certificate provider, Charlie Cooper, to tell them that your LPA is ready for review. You should show them your LPA.') + cy.get('div[data-module=govuk-notification-banner]').contains('We’ve saved your changes and sent a text to your certificate provider, Charlie Cooper, to tell them that your LPA is ready for review. You should show them your LPA.') - cy.contains('a', 'Return to dashboard').click(); + cy.contains('a', 'Return to dashboard').click(); - cy.url().should('contain', '/dashboard'); - }) + cy.url().should('contain', '/dashboard'); + }) + }) }) - }) - describe('CP acting online', () => { - describe('on first check', () => { - it('content is tailored for online CPs, a details component is shown and nav redirects to payment', () => { - cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent'); + describe('CP acting online', () => { + describe('on first check', () => { + it('content is tailored for online CPs, a details component is shown and nav redirects to payment', () => { + cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent'); - cy.url().should('contain', '/check-your-lpa'); - cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy for OPG to share it with my certificate provider, Charlie Cooper') - cy.get('details').contains('What happens if I need to make changes later?') + cy.url().should('contain', '/check-your-lpa'); + cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy for OPG to share it with my certificate provider, Charlie Cooper') + cy.get('details').contains('What happens if I need to make changes later?') - cy.get('#f-checked-and-happy').check({ force: true }) - cy.contains('button', 'Confirm').click(); + cy.get('#f-checked-and-happy').check({ force: true }) + cy.contains('button', 'Confirm').click(); - cy.url().should('contain', '/lpa-details-saved'); + cy.url().should('contain', '/lpa-details-saved'); - cy.get('div[data-module=govuk-notification-banner]').contains('We’ve sent an email to your certificate provider, Charlie Cooper, to tell them what they need to do next. You should tell them to expect an email from us.') + cy.get('div[data-module=govuk-notification-banner]').contains('We’ve sent an email to your certificate provider, Charlie Cooper, to tell them what they need to do next. You should tell them to expect an email from us.') - cy.contains('a', 'Continue').click(); + cy.contains('a', 'Continue').click(); - cy.url().should('contain', '/task-list'); - }) - }) + cy.url().should('contain', '/task-list'); + }) + }) - describe('on subsequent check when LPA has not been paid for', () => { - it('content is tailored for online CPs, a warning component is shown and nav redirects to payment', () => { - cy.visit('/fixtures?redirect=/task-list&progress=checkAndSendToYourCertificateProvider'); + describe('on subsequent check when LPA has not been paid for', () => { + it('content is tailored for online CPs, a warning component is shown and nav redirects to payment', () => { + cy.visit('/fixtures?redirect=/task-list&progress=checkAndSendToYourCertificateProvider'); - cy.contains('li', 'Add a correspondent').should('contain', 'Completed').click(); + cy.contains('li', 'Add a correspondent').should('contain', 'Completed').click(); - cy.url().should('contain', '/add-correspondent'); - cy.contains('label', 'No').click(); - cy.contains('button', 'Save and continue').click(); + cy.url().should('contain', '/add-correspondent'); + cy.contains('label', 'No').click(); + cy.contains('button', 'Save and continue').click(); - cy.url().should('contain', '/task-list'); - cy.contains('li', 'Check and send to your certificate provider').should('contain', 'In progress').click(); + cy.url().should('contain', '/task-list'); + cy.contains('li', 'Check and send to your certificate provider').should('contain', 'In progress').click(); - cy.url().should('contain', '/check-your-lpa'); - cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy for OPG to share it with my certificate provider, Charlie Cooper') - cy.get('.govuk-warning-text').contains('Once you select the confirm button, your certificate provider will be sent a text telling them you have changed your LPA.') + cy.url().should('contain', '/check-your-lpa'); + cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy for OPG to share it with my certificate provider, Charlie Cooper') + cy.get('.govuk-warning-text').contains('Once you select the confirm button, your certificate provider will be sent a text telling them you have changed your LPA.') - cy.get('#f-checked-and-happy').check({ force: true }) - cy.contains('button', 'Confirm').click(); + cy.get('#f-checked-and-happy').check({ force: true }) + cy.contains('button', 'Confirm').click(); - cy.url().should('contain', '/lpa-details-saved'); + cy.url().should('contain', '/lpa-details-saved'); - cy.get('div[data-module=govuk-notification-banner]').contains('We’ve saved your changes and sent a text to your certificate provider, Charlie Cooper, to tell them that they should review your LPA online.') + cy.get('div[data-module=govuk-notification-banner]').contains('We’ve saved your changes and sent a text to your certificate provider, Charlie Cooper, to tell them that they should review your LPA online.') - cy.contains('a', 'Continue').click(); + cy.contains('a', 'Continue').click(); - cy.url().should('contain', '/task-list'); - }) - }) + cy.url().should('contain', '/task-list'); + }) + }) - describe('on subsequent check when LPA has been paid for', () => { - it('content is tailored for online CPs, a warning component is shown and nav redirects to dashboard', () => { - cy.visit('/fixtures?redirect=/task-list&progress=payForTheLpa'); + describe('on subsequent check when LPA has been paid for', () => { + it('content is tailored for online CPs, a warning component is shown and nav redirects to dashboard', () => { + cy.visit('/fixtures?redirect=/task-list&progress=payForTheLpa'); - cy.contains('li', 'Add a correspondent').should('contain', 'Completed').click(); + cy.contains('li', 'Add a correspondent').should('contain', 'Completed').click(); - cy.url().should('contain', '/add-correspondent'); - cy.contains('label', 'No').click(); - cy.contains('button', 'Save and continue').click(); + cy.url().should('contain', '/add-correspondent'); + cy.contains('label', 'No').click(); + cy.contains('button', 'Save and continue').click(); - cy.url().should('contain', '/task-list'); - cy.contains('li', 'Check and send to your certificate provider').should('contain', 'In progress').click(); + cy.url().should('contain', '/task-list'); + cy.contains('li', 'Check and send to your certificate provider').should('contain', 'In progress').click(); - cy.url().should('contain', '/check-your-lpa'); - cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy for OPG to share it with my certificate provider, Charlie Cooper') - cy.get('.govuk-warning-text').contains('Once you select the confirm button, your certificate provider will be sent a text telling them you have changed your LPA.') + cy.url().should('contain', '/check-your-lpa'); + cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy for OPG to share it with my certificate provider, Charlie Cooper') + cy.get('.govuk-warning-text').contains('Once you select the confirm button, your certificate provider will be sent a text telling them you have changed your LPA.') - cy.get('#f-checked-and-happy').check({ force: true }) - cy.contains('button', 'Confirm').click(); + cy.get('#f-checked-and-happy').check({ force: true }) + cy.contains('button', 'Confirm').click(); - cy.url().should('contain', '/lpa-details-saved'); + cy.url().should('contain', '/lpa-details-saved'); - cy.get('div[data-module=govuk-notification-banner]').contains('We’ve saved your changes and sent a text to your certificate provider, Charlie Cooper, to tell them that they should review your LPA online.') + cy.get('div[data-module=govuk-notification-banner]').contains('We’ve saved your changes and sent a text to your certificate provider, Charlie Cooper, to tell them that they should review your LPA online.') - cy.contains('a', 'Return to dashboard').click(); + cy.contains('a', 'Return to dashboard').click(); - cy.url().should('contain', '/dashboard'); - }) + cy.url().should('contain', '/dashboard'); + }) + }) }) - }) - it("must check and send again when making LPA changes after certificate provider is contacted", () => { - cy.visit('/fixtures?redirect=/task-list&progress=checkAndSendToYourCertificateProvider'); + it("must check and send again when making LPA changes after certificate provider is contacted", () => { + cy.visit('/fixtures?redirect=/task-list&progress=checkAndSendToYourCertificateProvider'); - cy.url().should('contain', '/task-list'); + cy.url().should('contain', '/task-list'); - cy.contains('li', 'Check and send to your certificate provider').should('contain', 'Completed'); - cy.contains('li', 'Pay for the LPA').should('contain', 'Not started'); - cy.contains('li', 'Add a correspondent').should('contain', 'Completed').click(); + cy.contains('li', 'Check and send to your certificate provider').should('contain', 'Completed'); + cy.contains('li', 'Pay for the LPA').should('contain', 'Not started'); + cy.contains('li', 'Add a correspondent').should('contain', 'Completed').click(); - cy.url().should('contain', '/add-correspondent'); - cy.contains('label', 'No').click(); - cy.contains('button', 'Save and continue').click(); + cy.url().should('contain', '/add-correspondent'); + cy.contains('label', 'No').click(); + cy.contains('button', 'Save and continue').click(); - cy.url().should('contain', '/task-list'); + cy.url().should('contain', '/task-list'); - cy.contains('li', 'Pay for the LPA').should('contain', 'Cannot start yet'); - cy.contains('li', 'Check and send to your certificate provider').should('contain', 'In progress').click(); + cy.contains('li', 'Pay for the LPA').should('contain', 'Cannot start yet'); + cy.contains('li', 'Check and send to your certificate provider').should('contain', 'In progress').click(); - cy.get('#f-checked-and-happy').check({ force: true }) - cy.contains('button', 'Confirm').click(); + cy.get('#f-checked-and-happy').check({ force: true }) + cy.contains('button', 'Confirm').click(); - cy.url().should('contain', '/lpa-details-saved'); + cy.url().should('contain', '/lpa-details-saved'); - cy.contains('a', 'Continue').click(); + cy.contains('a', 'Continue').click(); - cy.url().should('contain', '/task-list'); + cy.url().should('contain', '/task-list'); - cy.contains('li', 'Check and send to your certificate provider').should('contain', 'Completed'); - cy.contains('li', 'Pay for the LPA').should('contain', 'Not started'); - }) + cy.contains('li', 'Check and send to your certificate provider').should('contain', 'Completed'); + cy.contains('li', 'Pay for the LPA').should('contain', 'Not started'); + }) - it("errors when not selected", () => { - cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent'); - cy.contains('button', 'Confirm').click(); + it("errors when not selected", () => { + cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent'); + cy.contains('button', 'Confirm').click(); - cy.get('.govuk-error-summary').within(() => { - cy.contains('Select the box if you have checked your LPA and are happy to share it with your certificate provider'); - }); + cy.get('.govuk-error-summary').within(() => { + cy.contains('Select the box if you have checked your LPA and are happy to share it with your certificate provider'); + }); - cy.contains('.govuk-form-group .govuk-error-message', 'Select the box if you have checked your LPA and are happy to share it with your certificate provider'); - }) + cy.contains('.govuk-form-group .govuk-error-message', 'Select the box if you have checked your LPA and are happy to share it with your certificate provider'); + }) }); diff --git a/cypress/e2e/donor/confirm-your-identity.cy.js b/cypress/e2e/donor/confirm-your-identity.cy.js index a7b8d20c2d..c26c22d309 100644 --- a/cypress/e2e/donor/confirm-your-identity.cy.js +++ b/cypress/e2e/donor/confirm-your-identity.cy.js @@ -22,8 +22,10 @@ describe('Confirm your identity', () => { cy.checkA11yApp(); cy.contains('button', 'Continue').click(); - cy.contains('label', 'Sam Smith (donor)').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Sam Smith (donor)').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/identity-details'); cy.checkA11yApp(); @@ -54,8 +56,10 @@ describe('Confirm your identity', () => { cy.checkA11yApp(); cy.contains('button', 'Continue').click(); - cy.contains('label', 'Unable to prove identity (X)').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Unable to prove identity (X)').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/unable-to-confirm-identity'); cy.checkA11yApp(); @@ -78,8 +82,10 @@ describe('Confirm your identity', () => { cy.checkA11yApp(); cy.contains('button', 'Continue').click(); - cy.contains('label', 'Failed identity check (T)').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Failed identity check (T)').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/register-with-court-of-protection'); cy.checkA11yApp(); @@ -105,8 +111,10 @@ describe('Confirm your identity', () => { cy.checkA11yApp(); cy.contains('button', 'Continue').click(); - cy.contains('label', 'Failed identity check (T)').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Failed identity check (T)').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/register-with-court-of-protection'); cy.checkA11yApp(); @@ -132,8 +140,10 @@ describe('Confirm your identity', () => { cy.checkA11yApp(); cy.contains('button', 'Continue').click(); - cy.contains('label', 'Charlie Cooper (certificate provider)').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Charlie Cooper (certificate provider)').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/identity-details'); cy.checkA11yApp(); @@ -166,8 +176,10 @@ describe('Confirm your identity', () => { cy.checkA11yApp(); cy.contains('button', 'Continue').click(); - cy.contains('label', 'Charlie Cooper (certificate provider)').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Charlie Cooper (certificate provider)').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/identity-details'); cy.checkA11yApp(); @@ -194,8 +206,10 @@ describe('Confirm your identity', () => { cy.checkA11yApp(); cy.contains('button', 'Continue').click(); - cy.contains('label', 'Charlie Cooper (certificate provider)').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Charlie Cooper (certificate provider)').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/identity-details'); cy.checkA11yApp(); @@ -223,8 +237,10 @@ describe('Confirm your identity', () => { cy.contains('label', 'confirm my identity another way').click(); cy.contains('button', 'Continue').click(); - cy.contains('label', 'Charlie Cooper (certificate provider)').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Charlie Cooper (certificate provider)').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/identity-details'); cy.checkA11yApp(); @@ -251,9 +267,12 @@ describe('Confirm your identity', () => { .click(); cy.url().should('contain', '/confirm-your-identity'); - cy.contains('button', 'Continue').click(); - cy.go(-2); + cy.url().then(u => { + cy.contains('button', 'Continue').click(); + cy.visit(u.split('/').slice(3, -1).join('/') + '/task-list'); + }); + cy.contains('li', "Confirm your identity") .should('contain', 'In progress') .find('a') diff --git a/cypress/e2e/donor/lpa-type.cy.js b/cypress/e2e/donor/lpa-type.cy.js index 3ef5de7efb..9f362ebf59 100644 --- a/cypress/e2e/donor/lpa-type.cy.js +++ b/cypress/e2e/donor/lpa-type.cy.js @@ -37,8 +37,10 @@ describe('LPA type', () => { cy.url().should('contain', '/task-list'); cy.url().then((url) => { - cy.visit(`http://localhost:9001/?detail-type=uid-requested&detail=${url.split('/')[4]}`); - cy.contains(`"lpaID":"${url.split('/')[4]}"`); + cy.origin('http://localhost:9001', { args: { url } }, ({ url }) => { + cy.visit(`/?detail-type=uid-requested&detail=${url.split('/')[4]}`); + cy.contains(`"lpaID":"${url.split('/')[4]}"`); + }); }); cy.visit('/dashboard') @@ -47,10 +49,12 @@ describe('LPA type', () => { .invoke('text') .then((text) => { const uid = text.split(':')[1].trim(); - cy.visit(`http://localhost:9001/?detail-type=application-updated&detail=${uid}`); - cy.contains(`"uid":"${uid}"`); - cy.contains('"type":"property-and-affairs"'); + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=application-updated&detail=${uid}`); + cy.contains(`"uid":"${uid}"`); + cy.contains('"type":"property-and-affairs"'); + }); }); }); diff --git a/cypress/e2e/donor/make-a-new-lpa.cy.js b/cypress/e2e/donor/make-a-new-lpa.cy.js index 4c2319e5f9..50bd3fc188 100644 --- a/cypress/e2e/donor/make-a-new-lpa.cy.js +++ b/cypress/e2e/donor/make-a-new-lpa.cy.js @@ -9,8 +9,10 @@ describe('Make a new LPA', () => { cy.url().should('contain', '/your-name'); cy.checkA11yApp(); - cy.get('#f-first-names').should('have.value', 'Sam').clear().type("a"); - cy.get('#f-last-name').should('have.value', 'Smith').clear().type("b"); + cy.get('#f-first-names').should('have.value', 'Sam').focus().clear(); + cy.get('#f-first-names').type('a').should('have.value', 'a'); + cy.get('#f-last-name').should('have.value', 'Smith').focus().clear(); + cy.get('#f-last-name').type('b').should('have.value', 'b'); cy.contains("button", "Continue").click(); cy.url().should('contain', '/we-have-updated-your-details'); diff --git a/cypress/e2e/donor/payment.cy.js b/cypress/e2e/donor/payment.cy.js index 2b2501f73a..c08ab718e7 100644 --- a/cypress/e2e/donor/payment.cy.js +++ b/cypress/e2e/donor/payment.cy.js @@ -28,10 +28,11 @@ describe('Pay for LPA', { pageLoadTimeout: 8000 }, () => { cy.contains('.govuk-summary-list__row', 'Reference number').find('.govuk-summary-list__value') .invoke('text') .then((uid) => { - cy.visit(`http://localhost:9001/?detail-type=payment-received&detail=${uid}`); - - cy.contains('"amount":8200'); - cy.contains('"paymentId":"hu20sqlact5260q2nanm0q8u93"'); + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=payment-received&detail=${uid}`); + cy.contains('"amount":8200'); + cy.contains('"paymentId":"hu20sqlact5260q2nanm0q8u93"'); + }); }); }); @@ -112,11 +113,13 @@ describe('Pay for LPA', { pageLoadTimeout: 8000 }, () => { .invoke('text') .then((text) => { const uid = text.split(':')[1].trim(); - cy.visit(`http://localhost:9001/?detail-type=reduced-fee-requested&detail=${uid}`); - cy.contains('"requestType":"HalfFee"'); - cy.contains(new RegExp(`{"path":"${uid}/evidence/.+","filename":"supporting-evidence.png"}`)) - cy.contains('"evidenceDelivery":"upload"'); + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=reduced-fee-requested&detail=${uid}`); + cy.contains('"requestType":"HalfFee"'); + cy.contains(new RegExp(`{"path":"${uid}/evidence/.+","filename":"supporting-evidence.png"}`)) + cy.contains('"evidenceDelivery":"upload"'); + }); }); }); @@ -187,11 +190,13 @@ describe('Pay for LPA', { pageLoadTimeout: 8000 }, () => { .invoke('text') .then((text) => { const uid = text.split(':')[1].trim(); - cy.visit(`http://localhost:9001/?detail-type=reduced-fee-requested&detail=${uid}`); - cy.contains('"requestType":"NoFee"'); - cy.contains(new RegExp(`{"path":"${uid}/evidence/.+","filename":"supporting-evidence.png"}`)) - cy.contains('"evidenceDelivery":"upload"'); + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=reduced-fee-requested&detail=${uid}`); + cy.contains('"requestType":"NoFee"'); + cy.contains(new RegExp(`{"path":"${uid}/evidence/.+","filename":"supporting-evidence.png"}`)) + cy.contains('"evidenceDelivery":"upload"'); + }); }); }); @@ -262,11 +267,13 @@ describe('Pay for LPA', { pageLoadTimeout: 8000 }, () => { .invoke('text') .then((text) => { const uid = text.split(':')[1].trim(); - cy.visit(`http://localhost:9001/?detail-type=reduced-fee-requested&detail=${uid}`); - cy.contains('"requestType":"NoFee"'); - cy.contains(new RegExp(`{"path":"${uid}/evidence/.+","filename":"supporting-evidence.png"}`)) - cy.contains('"evidenceDelivery":"upload"'); + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=reduced-fee-requested&detail=${uid}`); + cy.contains('"requestType":"NoFee"'); + cy.contains(new RegExp(`{"path":"${uid}/evidence/.+","filename":"supporting-evidence.png"}`)) + cy.contains('"evidenceDelivery":"upload"'); + }); }); }); @@ -345,11 +352,13 @@ describe('Pay for LPA', { pageLoadTimeout: 8000 }, () => { .invoke('text') .then((text) => { const uid = text.split(':')[1].trim(); - cy.visit(`http://localhost:9001/?detail-type=reduced-fee-requested&detail=${uid}`); - cy.contains('"requestType":"HardshipFee"'); - cy.contains('"evidence"').should('not.exist'); - cy.contains('"evidenceDelivery":"post"'); + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=reduced-fee-requested&detail=${uid}`); + cy.contains('"requestType":"HardshipFee"'); + cy.contains('"evidence"').should('not.exist'); + cy.contains('"evidenceDelivery":"post"'); + }); }); }); @@ -371,10 +380,11 @@ describe('Pay for LPA', { pageLoadTimeout: 8000 }, () => { cy.contains('.govuk-summary-list__row', 'Reference number').find('.govuk-summary-list__value') .invoke('text') .then((uid) => { - cy.visit(`http://localhost:9001/?detail-type=payment-received&detail=${uid}`); - - cy.contains('"amount":4100'); - cy.contains('"paymentId":"hu20sqlact5260q2nanm0q8u93"'); + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=payment-received&detail=${uid}`); + cy.contains('"amount":4100'); + cy.contains('"paymentId":"hu20sqlact5260q2nanm0q8u93"'); + }); }); }); @@ -396,10 +406,11 @@ describe('Pay for LPA', { pageLoadTimeout: 8000 }, () => { cy.contains('.govuk-summary-list__row', 'Reference number').find('.govuk-summary-list__value') .invoke('text') .then((uid) => { - cy.visit(`http://localhost:9001/?detail-type=payment-received&detail=${uid}`); - - cy.contains('"amount":8200'); - cy.contains('"paymentId":"hu20sqlact5260q2nanm0q8u93"'); + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=payment-received&detail=${uid}`); + cy.contains('"amount":8200'); + cy.contains('"paymentId":"hu20sqlact5260q2nanm0q8u93"'); + }); }); }); diff --git a/cypress/e2e/donor/progress.cy.js b/cypress/e2e/donor/progress.cy.js index 4319014e48..5ba217e880 100644 --- a/cypress/e2e/donor/progress.cy.js +++ b/cypress/e2e/donor/progress.cy.js @@ -45,8 +45,12 @@ describe('Progress', () => { cy.visit('/fixtures?redirect=/task-list&progress=payForTheLpa'); cy.contains('a', 'Confirm your identity').click(); - cy.contains('button', 'Continue').click(); - cy.go(-2); + + cy.url().then(u => { + cy.contains('button', 'Continue').click(); + cy.visit(u.split('/').slice(3, -1).join('/') + '/task-list'); + }); + cy.contains('a', 'Confirm your identity').click(); cy.contains('label', 'I will confirm my identity at a Post Office').click(); cy.contains('button', 'Continue').click(); @@ -60,7 +64,9 @@ describe('Progress', () => { cy.contains('a', 'Confirm your identity').click(); cy.contains('label', 'to complete my Post Office identity confirmation').click(); cy.contains('button', 'Continue').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('button', 'Continue').click(); + }); cy.contains('Important:').should('not.exist'); cy.visitLpa('/progress'); diff --git a/cypress/e2e/donor/provide-your-details.cy.js b/cypress/e2e/donor/provide-your-details.cy.js index 7e4606be8f..0d1578d2c1 100644 --- a/cypress/e2e/donor/provide-your-details.cy.js +++ b/cypress/e2e/donor/provide-your-details.cy.js @@ -37,11 +37,13 @@ describe('Provide your details', () => { .then(url => { const id = url.split('/')[4]; - cy.visit(`http://localhost:9001/?detail-type=uid-requested&detail=${id}`); - cy.contains('"type":"property-and-affairs"'); - cy.contains(`"name":"John${rnd} Doe${rnd}"`); - cy.contains('"dob":"1990-02-01"'); - cy.contains('"postcode":"B14 7ED"'); + cy.origin('http://localhost:9001', { args: { rnd, id } }, ({ rnd, id }) => { + cy.visit(`/?detail-type=uid-requested&detail=${id}`); + cy.contains('"type":"property-and-affairs"'); + cy.contains(`"name":"John${rnd} Doe${rnd}"`); + cy.contains('"dob":"1990-02-01"'); + cy.contains('"postcode":"B14 7ED"'); + }); }); }); }); diff --git a/cypress/e2e/donor/sign-the-lpa.cy.js b/cypress/e2e/donor/sign-the-lpa.cy.js index d308efd164..2535cd0756 100644 --- a/cypress/e2e/donor/sign-the-lpa.cy.js +++ b/cypress/e2e/donor/sign-the-lpa.cy.js @@ -167,10 +167,12 @@ describe('Sign the LPA', () => { .invoke('text') .then((text) => { const uid = text.split(':')[1].trim(); - cy.visit(`http://localhost:9001/?detail-type=paper-form-requested&detail=${uid}`); - cy.contains(`"uid":"${uid}"`) - cy.contains(`"actorType":"certificateProvider"`) + cy.origin('http://localhost:9001', { args: { uid } }, ({ uid }) => { + cy.visit(`/?detail-type=paper-form-requested&detail=${uid}`); + cy.contains(`"uid":"${uid}"`) + cy.contains(`"actorType":"certificateProvider"`) + }); }); }); }) diff --git a/cypress/e2e/donor/you-cannot-sign-your-lpa-yet.cy.js b/cypress/e2e/donor/you-cannot-sign-your-lpa-yet.cy.js index 03870deef6..14192348ff 100644 --- a/cypress/e2e/donor/you-cannot-sign-your-lpa-yet.cy.js +++ b/cypress/e2e/donor/you-cannot-sign-your-lpa-yet.cy.js @@ -1,5 +1,4 @@ -// TODO unskip MLPAB-2700 -describe.skip('You cannot sign your LPA yet', () => { +describe('You cannot sign your LPA yet', () => { it('lists attorneys and replacement attorneys that are under 18', () => { const today = new Date() cy.visit('/fixtures?redirect=/choose-attorneys-summary&progress=peopleToNotifyAboutYourLpa'); diff --git a/cypress/e2e/supporter/start.cy.js b/cypress/e2e/supporter/start.cy.js index 2906187a30..3bf834d764 100644 --- a/cypress/e2e/supporter/start.cy.js +++ b/cypress/e2e/supporter/start.cy.js @@ -13,10 +13,12 @@ describe('Start', () => { cy.contains('a', 'Continue to GOV.UK One Login').click(); if (Cypress.config().baseUrl.includes('localhost')) { - cy.url().should('contain', '/authorize') + cy.origin('http://localhost:7012', () => { + cy.url().should('contain', '/authorize') - cy.get('#f-email').type(Math.random() + '@example.org') - cy.contains('button', 'Continue').click(); + cy.get('#f-email').type(Math.random() + '@example.org') + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/enter-your-name') } else { diff --git a/cypress/e2e/voucher/confirm-your-identity.cy.js b/cypress/e2e/voucher/confirm-your-identity.cy.js index fc7c2a4c2c..f434054ee6 100644 --- a/cypress/e2e/voucher/confirm-your-identity.cy.js +++ b/cypress/e2e/voucher/confirm-your-identity.cy.js @@ -11,8 +11,10 @@ describe('Confirm your identity', () => { it('can be confirmed', () => { cy.checkA11yApp(); cy.contains('button', 'Continue').click(); - cy.contains('label', 'Vivian Vaughn').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Vivian Vaughn').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/one-login-identity-details'); cy.checkA11yApp(); @@ -41,8 +43,10 @@ describe('Confirm your identity', () => { cy.checkA11yApp(); cy.contains('button', 'Continue').click(); - cy.contains('label', 'Charlie Cooper').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Charlie Cooper').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/confirm-allowed-to-vouch'); cy.checkA11yApp(); @@ -55,17 +59,22 @@ describe('Confirm your identity', () => { it('can fail', () => { cy.contains('button', 'Continue').click(); - cy.contains('label', 'Sam Smith').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Sam Smith').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/voucher-unable-to-confirm-identity'); }); it('can go to the post office ', () => { cy.url().should('contain', '/confirm-your-identity'); - cy.contains('button', 'Continue').click(); - cy.go(-2); + cy.url().then(u => { + cy.contains('button', 'Continue').click(); + cy.visit(u.split('/').slice(3, -1).join('/') + '/task-list'); + }); + cy.contains('li', "Confirm your identity") .should('contain', 'In progress') .find('a') diff --git a/cypress/e2e/voucher/confirm-your-name.cy.js b/cypress/e2e/voucher/confirm-your-name.cy.js index 67b5aaba88..e47a8100f1 100644 --- a/cypress/e2e/voucher/confirm-your-name.cy.js +++ b/cypress/e2e/voucher/confirm-your-name.cy.js @@ -18,7 +18,8 @@ describe('Confirm your name', () => { cy.url().should('contain', '/your-name') cy.checkA11yApp(); - cy.get('#f-first-names').clear().type('Barry'); + cy.get('#f-first-names').clear(); + cy.get('#f-first-names').type('Barry'); cy.contains('button', 'Save and continue').click(); cy.url().should('contain', '/confirm-your-name') @@ -33,7 +34,8 @@ describe('Confirm your name', () => { cy.url().should('contain', '/your-name') cy.checkA11yApp(); - cy.get('#f-last-name').clear().type('Smith'); + cy.get('#f-last-name').clear(); + cy.get('#f-last-name').type('Smith'); cy.contains('button', 'Save and continue').click(); cy.contains('button', 'Continue').click(); @@ -52,8 +54,10 @@ describe('Confirm your name', () => { cy.url().should('contain', '/your-name') cy.checkA11yApp(); - cy.get('#f-first-names').clear().type('Charlie'); - cy.get('#f-last-name').clear().type('Cooper'); + cy.get('#f-first-names').clear(); + cy.get('#f-first-names').type('Charlie'); + cy.get('#f-last-name').clear(); + cy.get('#f-last-name').type('Cooper'); cy.contains('button', 'Save and continue').click(); cy.contains('button', 'Continue').click(); diff --git a/cypress/e2e/voucher/enter-reference-number.cy.js b/cypress/e2e/voucher/enter-reference-number.cy.js index cfb8c540d9..c4e961786c 100644 --- a/cypress/e2e/voucher/enter-reference-number.cy.js +++ b/cypress/e2e/voucher/enter-reference-number.cy.js @@ -8,8 +8,10 @@ describe('Enter reference number', () => { cy.visit(`/fixtures/voucher?redirect=&withShareCode=${shareCode}`); cy.contains('a', 'Start').click() - cy.contains('label', 'Random value').click(); - cy.contains('button', 'Continue').click(); + cy.origin('http://localhost:7012', () => { + cy.contains('label', 'Random value').click(); + cy.contains('button', 'Continue').click(); + }); cy.url().should('contain', '/voucher-enter-reference-number') }); diff --git a/package.json b/package.json index a2af79f20a..f9844f8f71 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "axe-core": "^4.6", - "cypress": "13.17.0", + "cypress": "14.0.0", "cypress-axe": "^1.4", "cypress-file-upload": "^5.0.8", "cypress-multi-reporters": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 13b450d2a3..6b114a8e5d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -924,10 +924,10 @@ cypress-real-events@^1.8.1: resolved "https://registry.yarnpkg.com/cypress-real-events/-/cypress-real-events-1.13.0.tgz#6b7cd32dcac172db1493608f97a2576c7d0bd5af" integrity sha512-LoejtK+dyZ1jaT8wGT5oASTPfsNV8/ClRp99ruN60oPj8cBJYod80iJDyNwfPAu4GCxTXOhhAv9FO65Hpwt6Hg== -cypress@13.17.0: - version "13.17.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.17.0.tgz#34c3d68080c4497eace0f353bd1629587a5f600d" - integrity sha512-5xWkaPurwkIljojFidhw8lFScyxhtiFHl/i/3zov+1Z5CmY4t9tjIdvSXfu82Y3w7wt0uR9KkucbhkVvJZLQSA== +cypress@14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-14.0.0.tgz#a71cb0a243a0bfeb97b6973ab9c5291ca5288e93" + integrity sha512-kEGqQr23so5IpKeg/dp6GVi7RlHx1NmW66o2a2Q4wk9gRaAblLZQSiZJuDI8UMC4LlG5OJ7Q6joAiqTrfRNbTw== dependencies: "@cypress/request" "^3.0.6" "@cypress/xvfb" "^1.2.4"