Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #454 from DFE-Digital/115221/transfers_legal_requi…
Browse files Browse the repository at this point in the history
…rement

Refine legal requirements for  transfers
  • Loading branch information
rdogra-nimble authored Dec 14, 2022
2 parents 1ee5837 + 34800cf commit 52c4047
Showing 1 changed file with 39 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
})

})

0 comments on commit 52c4047

Please sign in to comment.