Skip to content

Commit

Permalink
Fix cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSurgisonGDS committed Jun 29, 2023
1 parent 7258326 commit b20775b
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ const serverNameQuery = 'a.govuk-header__link.govuk-header__service-name, a.govu

const managePagePath = '/manage-prototype'

function restore () {
// Restore index.html and config.json from prototype starter
cy.task('copyFromStarterFiles', { filename: appConfigPath })
cy.task('copyFromStarterFiles', { filename: appIndexPath })
}

describe('change service name', () => {
before(() => {
// Restore index.html and config.json from prototype starter
cy.task('copyFromStarterFiles', { filename: appConfigPath })
cy.task('copyFromStarterFiles', { filename: appIndexPath })
})
before(restore)
after(restore)

it('The service name should change to "cypress test" and the task should be set to "Done"', () => {
waitForApplication()
waitForApplication('/')

cy.task('log', 'Visit the index page and navigate to the manage your prototype page')
cy.visit('/')
cy.get('.govuk-heading-xl').contains(originalText)
cy.get('p strong').contains(appConfigPath)
cy.get(`main a[href="${managePagePath}"]`).contains('Manage your prototype').click()
Expand Down

0 comments on commit b20775b

Please sign in to comment.