Skip to content

Commit

Permalink
Merge pull request #770 from DFE-Digital/test-check-conversion-suppor…
Browse files Browse the repository at this point in the history
…t-grant-banners-no-longer-exist

Test check conversion support grant banners no longer exist
  • Loading branch information
dangood84 authored Dec 17, 2024
2 parents 6bea717 + 8d7ec90 commit c0c6be0
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,35 @@ describe('Create a FAM application', () => {

const trustOpeningYear = `${new Date().getFullYear() + 1}`

const homeAssertions = {
warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'),
warningText: () => cy.get('strong[class="govuk-warning-text__text"]'),
}

beforeEach(function () {
cy.visit(Cypress.env('URL'))

cookieHeaderModal.acceptAnalyticsCookies()

homeAssertions.warningIcon().should('not.exist')

homeAssertions.warningText().should('not.exist')

home.start()

login.login()
})

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()

Expand All @@ -86,6 +104,8 @@ describe('Create a FAM application', () => {

cy.executeAccessibilityTests()

applicationAssertionCheck.applicationOverviewBanner().should('not.exist')

application.addSchool()

cy.executeAccessibilityTests()
Expand All @@ -99,6 +119,8 @@ describe('Create a FAM application', () => {

cy.executeAccessibilityTests()

famSchoolOverviewAssertionCheck.conversionSupportGrantLink().should('not.exist')

application.startAboutTheConversion()

cy.executeAccessibilityTests()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,32 @@ describe('Create a JAM application', () => {
const chairName = `${faker.person.firstName()} ${faker.person.lastName()}`
const chairEmail = faker.internet.email()

const homeAssertions = {
warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'),
warningText: () => cy.get('strong[class="govuk-warning-text__text"]'),
}

beforeEach(function () {
cy.visit(Cypress.env('URL'))

cookieHeaderModal.acceptAnalyticsCookies()

homeAssertions.warningIcon().should('not.exist')

homeAssertions.warningText().should('not.exist')

home.start()

login.login()
})

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()
Expand All @@ -74,6 +88,9 @@ describe('Create a JAM application', () => {

cy.executeAccessibilityTests()

applicationAssertionCheck.applicationOverviewBanner().should('not.exist')
applicationAssertionCheck.conversionSupportGrantLink().should('not.exist')

application.addTrust()

cy.executeAccessibilityTests()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@ import application from '../page-objects/pages/application'
import confirmApplicationDelete from '../page-objects/pages/confirmApplicationDelete'

describe('Delete application', () => {

const homeAssertions = {
warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'),
warningText: () => cy.get('strong[class="govuk-warning-text__text"]'),
}

beforeEach(function () {
cy.visit(Cypress.env('URL'))

cookieHeaderModal.acceptAnalyticsCookies()

homeAssertions.warningIcon().should('not.exist')

homeAssertions.warningText().should('not.exist')

home.start()

login.login()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ describe('Invite/remove contributor', () => {
const contributorEmail = faker.internet.email()
const applicationId = '10280'

const homeAssertions = {
warningIcon: () => cy.get('span[class="govuk-warning-text__icon"]'),
warningText: () => cy.get('strong[class="govuk-warning-text__text"]'),
}

beforeEach(function () {
cy.visit(Cypress.env('URL'))

cookieHeaderModal.acceptAnalyticsCookies()

homeAssertions.warningIcon().should('not.exist')

homeAssertions.warningText().should('not.exist')

home.start()

login.login()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ class Application {

return this
}

public applicationOverviewBanner(): this {
cy.get('div[class="govuk-notification-banner"]')

return this
}
}

const application = new Application()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Home {

return this
}

}

const home = new Home()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class PreopeningSupportGrantDetails {

return this
}

}

const preopeningSupportGrantDetails = new PreopeningSupportGrantDetails()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class PreOpeningSupportGrantSummary {

return this
}

}

const preOpeningSupportGrantSummary = new PreOpeningSupportGrantSummary()
Expand Down

0 comments on commit c0c6be0

Please sign in to comment.