diff --git a/end-to-end-tests/cypress/e2e/legal-requirements/legal-requirements.cy.js b/end-to-end-tests/cypress/e2e/legal-requirements/legal-requirements.cy.js index a4392e192..7b6bfed05 100644 --- a/end-to-end-tests/cypress/e2e/legal-requirements/legal-requirements.cy.js +++ b/end-to-end-tests/cypress/e2e/legal-requirements/legal-requirements.cy.js @@ -2,15 +2,26 @@ // TO DO: Check Legal Requirement validation on first time use; check Empty tags. -describe('Legal Requirements', { tags: '@dev'}, () => { +describe('Legal Requirements', { tags: '@dev' }, () => { beforeEach(() => { cy.selectsFirstProjectOnList() cy.get('[data-test="transfer-legal-requirements"]').click() }) - it('TC01: Answer to Incoming Trust Agreement and changes current answer from Yes, No, Not Applicable ', () => { + it('TC01: Legal Requirement page for project', () => { + //verify title + cy.title().should('eq', 'Legal Requirements - Manage an academy transfer') + // verify heading + cy.get('h1').contains('Legal requirements') + }) + + it('TC02: Answer to Incoming Trust Agreement and changes current answer from Yes, No, Not Applicable ', () => { // Clicks on link cy.incomingTrustAgreementLink() + // verify title + cy.title().should('eq', 'Incoming trust agreement - Manage an academy transfer') + // verify heading + cy.get('h1').contains('Has the incoming trust agreed to take on the academy?') // Selects Yes cy.get('[id="IncomingTrustAgreement"]').click() cy.saveAndContinueButton().click() @@ -29,9 +40,13 @@ describe('Legal Requirements', { tags: '@dev'}, () => { cy.incomingTrustAgreementStatus().should('contain.text', 'Not applicable') }) - it('TC02: Answer to Diocesan consent and changes current answer from Yes, No, Not Applicable', () => { + it('TC03: Answer to Diocesan consent and changes current answer from Yes, No, Not Applicable', () => { // Clicks on change link cy.diocesanConsentLink() + //verify title + cy.title().should('eq', 'Diocesan consent - Manage an academy transfer') + // verify heading + cy.get('h1').contains('Have you spoken with the diocese about the incoming trust?') // Selects Yes cy.get('[id="DiocesanConsent"]').click() cy.saveAndContinueButton().click() @@ -50,9 +65,13 @@ describe('Legal Requirements', { tags: '@dev'}, () => { cy.diocesanConsentStatus().should('contain.text', 'Not applicable') }) - it('TC02: Answer to Outgoing Trust consent and changes current answer from Yes, No, Not Applicable', () => { + it('TC04: Answer to Outgoing Trust consent and changes current answer from Yes, No, Not Applicable', () => { // Clicks on change link cy.outgoingTrustConsentLink() + //verify title + cy.title().should('eq', 'Outgoing trust resolution - Manage an academy transfer') + // verify heading + cy.get('h1').contains('Have you received a resolution from the outgoing trust?') // Selects Yes cy.get('[id="OutgoingTrustConsent"]').click() cy.saveAndContinueButton().click() @@ -71,28 +90,28 @@ describe('Legal Requirements', { tags: '@dev'}, () => { cy.outgoingTrustConsentStatus().should('contain.text', 'Not applicable') }) - it('TC04: Confirm Legal Requirements page check & marked complete', () => { + it('TC05: Confirm Legal Requirements page check & marked complete', () => { cy.selectsFirstProjectOnList().then(() => { cy.get('[data-test="legal-requirements"]') - .invoke('text') - .then((text) => { - if (text.includes('COMPLETED')) { - return - } - else { - cy.get('[data-test="transfer-legal-requirements"]').click() - cy.get('[data-test="mark-section-complete"]').click() - cy.get('[class="govuk-button govuk-!-margin-top-6"]').click() - cy.get('[data-test="legal-requirements"]').should('contain.text', 'COMPLETED') - } - }) + .invoke('text') + .then((text) => { + if (text.includes('COMPLETED')) { + return + } + else { + cy.get('[data-test="transfer-legal-requirements"]').click() + cy.get('[data-test="mark-section-complete"]').click() + cy.get('[class="govuk-button govuk-!-margin-top-6"]').click() + cy.get('[data-test="legal-requirements"]').should('contain.text', 'COMPLETED') + } + }) }) }) - it('TC05: Back to task list button link', () => { + it('TC06: Back to task list button link', () => { cy.get('[class="govuk-back-link"]') - .should('be.visible') - .should('contain.text', 'Back to task list').click() + .should('be.visible') + .should('contain.text', 'Back to task list').click() }) }) \ No newline at end of file