From 2fff9b54cf0d0ccdfeb1008d47302e8455de5835 Mon Sep 17 00:00:00 2001 From: Dan Good Date: Mon, 16 Dec 2024 16:55:43 +0000 Subject: [PATCH 1/7] Added warningIcon() and warningText() page objects to Home page --- .../CypressTests/cypress/page-objects/pages/home.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/home.ts b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/home.ts index b40cc13cc..434b09cc7 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/home.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/home.ts @@ -4,6 +4,18 @@ class Home { return this } + + public warningIcon(): this { + cy.get('span[class="govuk-warning-text__icon"]') + + return this + } + + public warningText(): this { + cy.get('strong[class="govuk-warning-text__text"]') + + return this + } } const home = new Home() From 20029a541e2871b6114377cd8f6bcc8ddb651ea7 Mon Sep 17 00:00:00 2001 From: Dan Good Date: Mon, 16 Dec 2024 17:01:32 +0000 Subject: [PATCH 2/7] Added applicationOverviewBanner() component to application.ts page object --- .../CypressTests/cypress/page-objects/pages/application.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/application.ts b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/application.ts index da3049fb2..ca771044e 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/application.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/application.ts @@ -197,6 +197,12 @@ class Application { return this } + + public applicationOverviewBanner(): this { + cy.get('div[class="govuk-notification-banner"]') + + return this + } } const application = new Application() From 1a48b76dbb0563252da4e32553aeba1b2acac08d Mon Sep 17 00:00:00 2001 From: Dan Good Date: Mon, 16 Dec 2024 17:07:23 +0000 Subject: [PATCH 3/7] Added warningIcon() and warningText() components to preOeningSupportGrantDetails/conversionSupportGrantDetails page object --- .../pages/preOpeningSupportGrantDetails.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantDetails.ts b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantDetails.ts index 1aaa5af90..6331cbc66 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantDetails.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantDetails.ts @@ -16,6 +16,18 @@ class PreopeningSupportGrantDetails { return this } + + public warningIcon(): this { + cy.get('span[class="govuk-warning-text__icon"]') + + return this + } + + public warningText(): this { + cy.get('strong[class="govuk-warning-text__text"]') + + return this + } } const preopeningSupportGrantDetails = new PreopeningSupportGrantDetails() From 23098d8f9655fec2ec2024f6aa30bacde5976ae1 Mon Sep 17 00:00:00 2001 From: Dan Good Date: Mon, 16 Dec 2024 17:08:23 +0000 Subject: [PATCH 4/7] Added warningIcon() and warningText() components to preOeningSupportGrantSummary/conversionSupportGrantSummary page object --- .../pages/preOpeningSupportGrantSummary.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantSummary.ts b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantSummary.ts index 5d6c52a21..13e460d84 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantSummary.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantSummary.ts @@ -16,6 +16,18 @@ class PreOpeningSupportGrantSummary { return this } + + public warningIcon(): this { + cy.get('span[class="govuk-warning-text__icon"]') + + return this + } + + public warningText(): this { + cy.get('strong[class="govuk-warning-text__text"]') + + return this + } } const preOpeningSupportGrantSummary = new PreOpeningSupportGrantSummary() From a5a4f3b09e9b5f6cc6d3a6262cc24f70e4a92cd5 Mon Sep 17 00:00:00 2001 From: Dan Good Date: Mon, 16 Dec 2024 17:26:54 +0000 Subject: [PATCH 5/7] Added home consts for each spec file so we can check correctly that legacy Conversion support grant banner no longer exists on homepage --- .../CypressTests/cypress/e2e/createNewFAMApp.cy.ts | 10 ++++++++++ .../CypressTests/cypress/e2e/createNewJAMApp.cy.ts | 10 ++++++++++ .../CypressTests/cypress/e2e/deleteNewJAMApp.cy.ts | 11 +++++++++++ .../cypress/e2e/inviteAndRemoveContributor.cy.ts | 10 ++++++++++ 4 files changed, 41 insertions(+) diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewFAMApp.cy.ts b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewFAMApp.cy.ts index 519a2cb8c..6ba450182 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewFAMApp.cy.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewFAMApp.cy.ts @@ -60,11 +60,21 @@ describe('Create a FAM application', () => { const trustOpeningYear = `${new Date().getFullYear() + 1}` + const home = { + warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'), + warningText: () => cy.get('strong[class="govuk-warning-text__text"]'), + start: () => cy.get('[data-cy="startNowButton"]').click() + } + beforeEach(function () { cy.visit(Cypress.env('URL')) cookieHeaderModal.acceptAnalyticsCookies() + home.warningIcon().should('not.exist') + + home.warningText().should('not.exist') + home.start() login.login() diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewJAMApp.cy.ts b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewJAMApp.cy.ts index f53a95659..b59186f4b 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewJAMApp.cy.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewJAMApp.cy.ts @@ -48,11 +48,21 @@ describe('Create a JAM application', () => { const chairName = `${faker.person.firstName()} ${faker.person.lastName()}` const chairEmail = faker.internet.email() + const home = { + warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'), + warningText: () => cy.get('strong[class="govuk-warning-text__text"]'), + start: () => cy.get('[data-cy="startNowButton"]').click() + } + beforeEach(function () { cy.visit(Cypress.env('URL')) cookieHeaderModal.acceptAnalyticsCookies() + home.warningIcon().should('not.exist') + + home.warningText().should('not.exist') + home.start() login.login() diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/deleteNewJAMApp.cy.ts b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/deleteNewJAMApp.cy.ts index 24867c6e4..b3f894ac3 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/deleteNewJAMApp.cy.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/deleteNewJAMApp.cy.ts @@ -8,11 +8,22 @@ import application from '../page-objects/pages/application' import confirmApplicationDelete from '../page-objects/pages/confirmApplicationDelete' describe('Delete application', () => { + + const home = { + warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'), + warningText: () => cy.get('strong[class="govuk-warning-text__text"]'), + start: () => cy.get('[data-cy="startNowButton"]').click() + } + beforeEach(function () { cy.visit(Cypress.env('URL')) cookieHeaderModal.acceptAnalyticsCookies() + home.warningIcon().should('not.exist') + + home.warningText().should('not.exist') + home.start() login.login() diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/inviteAndRemoveContributor.cy.ts b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/inviteAndRemoveContributor.cy.ts index 61681544f..8e1a33b1a 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/inviteAndRemoveContributor.cy.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/inviteAndRemoveContributor.cy.ts @@ -12,11 +12,21 @@ describe('Invite/remove contributor', () => { const contributorEmail = faker.internet.email() const applicationId = '10280' + const home = { + warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'), + warningText: () => cy.get('strong[class="govuk-warning-text__text"]'), + start: () => cy.get('[data-cy="startNowButton"]').click() + } + beforeEach(function () { cy.visit(Cypress.env('URL')) cookieHeaderModal.acceptAnalyticsCookies() + home.warningIcon().should('not.exist') + + home.warningText().should('not.exist') + home.start() login.login() From 836881a1b21b07bbf3013d024ce64ef856244deb Mon Sep 17 00:00:00 2001 From: Dan Good Date: Mon, 16 Dec 2024 17:56:58 +0000 Subject: [PATCH 6/7] Refactor all tests to include neg tests for application banners on homepage, application overview page, and that the Conversion support grant link no longer appears --- .../cypress/e2e/createNewFAMApp.cy.ts | 20 +++++++++++++++---- .../cypress/e2e/createNewJAMApp.cy.ts | 15 ++++++++++---- .../cypress/e2e/deleteNewJAMApp.cy.ts | 7 +++---- .../e2e/inviteAndRemoveContributor.cy.ts | 7 +++---- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewFAMApp.cy.ts b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewFAMApp.cy.ts index 6ba450182..cfd16da68 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewFAMApp.cy.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewFAMApp.cy.ts @@ -60,10 +60,9 @@ describe('Create a FAM application', () => { const trustOpeningYear = `${new Date().getFullYear() + 1}` - const home = { + const homeAssertions = { warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'), warningText: () => cy.get('strong[class="govuk-warning-text__text"]'), - start: () => cy.get('[data-cy="startNowButton"]').click() } beforeEach(function () { @@ -71,9 +70,9 @@ describe('Create a FAM application', () => { cookieHeaderModal.acceptAnalyticsCookies() - home.warningIcon().should('not.exist') + homeAssertions.warningIcon().should('not.exist') - home.warningText().should('not.exist') + homeAssertions.warningText().should('not.exist') home.start() @@ -81,6 +80,15 @@ describe('Create a FAM application', () => { }) it('should be able to create a new application', () => { + + const applicationAssertionCheck = { + applicationOverviewBanner: () => cy.get('.govuk-notification-banner') + + } + + const famSchoolOverviewAssertionCheck = { + conversionSupportGrantLink: () => cy.contains('Conversion support grant') + } cy.executeAccessibilityTests() @@ -96,6 +104,8 @@ describe('Create a FAM application', () => { cy.executeAccessibilityTests() + applicationAssertionCheck.applicationOverviewBanner().should('not.exist') + application.addSchool() cy.executeAccessibilityTests() @@ -109,6 +119,8 @@ describe('Create a FAM application', () => { cy.executeAccessibilityTests() + famSchoolOverviewAssertionCheck.conversionSupportGrantLink().should('not.exist') + application.startAboutTheConversion() cy.executeAccessibilityTests() diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewJAMApp.cy.ts b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewJAMApp.cy.ts index b59186f4b..4f4f23a92 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewJAMApp.cy.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/createNewJAMApp.cy.ts @@ -48,10 +48,9 @@ describe('Create a JAM application', () => { const chairName = `${faker.person.firstName()} ${faker.person.lastName()}` const chairEmail = faker.internet.email() - const home = { + const homeAssertions = { warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'), warningText: () => cy.get('strong[class="govuk-warning-text__text"]'), - start: () => cy.get('[data-cy="startNowButton"]').click() } beforeEach(function () { @@ -59,9 +58,9 @@ describe('Create a JAM application', () => { cookieHeaderModal.acceptAnalyticsCookies() - home.warningIcon().should('not.exist') + homeAssertions.warningIcon().should('not.exist') - home.warningText().should('not.exist') + homeAssertions.warningText().should('not.exist') home.start() @@ -70,6 +69,11 @@ describe('Create a JAM application', () => { it('should be able to create a new application', () => { + const applicationAssertionCheck = { + applicationOverviewBanner: () => cy.get('.govuk-notification-banner'), + conversionSupportGrantLink: () => cy.contains('Conversion support grant') + } + cy.executeAccessibilityTests() yourApplications.startNewApplication() @@ -84,6 +88,9 @@ describe('Create a JAM application', () => { cy.executeAccessibilityTests() + applicationAssertionCheck.applicationOverviewBanner().should('not.exist') + applicationAssertionCheck.conversionSupportGrantLink().should('not.exist') + application.addTrust() cy.executeAccessibilityTests() diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/deleteNewJAMApp.cy.ts b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/deleteNewJAMApp.cy.ts index b3f894ac3..c239e4340 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/deleteNewJAMApp.cy.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/deleteNewJAMApp.cy.ts @@ -9,10 +9,9 @@ import confirmApplicationDelete from '../page-objects/pages/confirmApplicationDe describe('Delete application', () => { - const home = { + const homeAssertions = { warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'), warningText: () => cy.get('strong[class="govuk-warning-text__text"]'), - start: () => cy.get('[data-cy="startNowButton"]').click() } beforeEach(function () { @@ -20,9 +19,9 @@ describe('Delete application', () => { cookieHeaderModal.acceptAnalyticsCookies() - home.warningIcon().should('not.exist') + homeAssertions.warningIcon().should('not.exist') - home.warningText().should('not.exist') + homeAssertions.warningText().should('not.exist') home.start() diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/inviteAndRemoveContributor.cy.ts b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/inviteAndRemoveContributor.cy.ts index 8e1a33b1a..30bec6a28 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/e2e/inviteAndRemoveContributor.cy.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/e2e/inviteAndRemoveContributor.cy.ts @@ -12,10 +12,9 @@ describe('Invite/remove contributor', () => { const contributorEmail = faker.internet.email() const applicationId = '10280' - const home = { + const homeAssertions = { warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'), warningText: () => cy.get('strong[class="govuk-warning-text__text"]'), - start: () => cy.get('[data-cy="startNowButton"]').click() } beforeEach(function () { @@ -23,9 +22,9 @@ describe('Invite/remove contributor', () => { cookieHeaderModal.acceptAnalyticsCookies() - home.warningIcon().should('not.exist') + homeAssertions.warningIcon().should('not.exist') - home.warningText().should('not.exist') + homeAssertions.warningText().should('not.exist') home.start() From 8d7ec90fbd0e321d75816c142f7e145b8e523e24 Mon Sep 17 00:00:00 2001 From: Dan Good Date: Mon, 16 Dec 2024 17:58:55 +0000 Subject: [PATCH 7/7] Remove redundant components from page objects as they're now defined inside spec files --- .../CypressTests/cypress/page-objects/pages/home.ts | 11 ----------- .../pages/preOpeningSupportGrantDetails.ts | 11 ----------- .../pages/preOpeningSupportGrantSummary.ts | 11 ----------- 3 files changed, 33 deletions(-) diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/home.ts b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/home.ts index 434b09cc7..9fe929876 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/home.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/home.ts @@ -5,17 +5,6 @@ class Home { return this } - public warningIcon(): this { - cy.get('span[class="govuk-warning-text__icon"]') - - return this - } - - public warningText(): this { - cy.get('strong[class="govuk-warning-text__text"]') - - return this - } } const home = new Home() diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantDetails.ts b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantDetails.ts index 6331cbc66..a4cb9c4bd 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantDetails.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantDetails.ts @@ -17,17 +17,6 @@ class PreopeningSupportGrantDetails { return this } - public warningIcon(): this { - cy.get('span[class="govuk-warning-text__icon"]') - - return this - } - - public warningText(): this { - cy.get('strong[class="govuk-warning-text__text"]') - - return this - } } const preopeningSupportGrantDetails = new PreopeningSupportGrantDetails() diff --git a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantSummary.ts b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantSummary.ts index 13e460d84..1ee19f15e 100644 --- a/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantSummary.ts +++ b/Dfe.Academies.External.Web/CypressTests/cypress/page-objects/pages/preOpeningSupportGrantSummary.ts @@ -17,17 +17,6 @@ class PreOpeningSupportGrantSummary { return this } - public warningIcon(): this { - cy.get('span[class="govuk-warning-text__icon"]') - - return this - } - - public warningText(): this { - cy.get('strong[class="govuk-warning-text__text"]') - - return this - } } const preOpeningSupportGrantSummary = new PreOpeningSupportGrantSummary()