diff --git a/.github/actions/run-e2e-tests/action.yml b/.github/actions/run-e2e-tests/action.yml deleted file mode 100644 index d6b4c5ce3..000000000 --- a/.github/actions/run-e2e-tests/action.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Run Cypress E2E tests -description: Run E2E tests using Cypress - -inputs: - url: - required: true - type: string - auth_secret: - required: true - type: string - -runs: - using: composite - - steps: - - name: Run Chrome Tests - uses: cypress-io/github-action@v6 - if: success() || failure() - with: - env: auth_secret="${{ inputs.auth_secret }}" - working-directory: ./tests/Dfe.EarlyYearsQualification.E2ETests/ - browser: chrome - config: baseUrl="${{ inputs.url }}" - - - name: Run Firefox Tests - uses: cypress-io/github-action@v6 - if: success() || failure() - with: - env: auth_secret="${{ inputs.auth_secret }}" - working-directory: ./tests/Dfe.EarlyYearsQualification.E2ETests/ - browser: firefox - config: baseUrl="${{ inputs.url }}" - - - name: Run Edge Tests - uses: cypress-io/github-action@v6 - if: success() || failure() - with: - env: auth_secret="${{ inputs.auth_secret }}" - working-directory: ./tests/Dfe.EarlyYearsQualification.E2ETests/ - browser: edge - config: baseUrl="${{ inputs.url }}" - - - name: Store screenshots on test failure - uses: actions/upload-artifact@v4 - if: failure() - with: - name: cypress-screenshots - path: ./tests/Dfe.EarlyYearsQualification.E2ETests/cypress/screenshots \ No newline at end of file diff --git a/.github/actions/run-playwright-e2e-tests/action.yml b/.github/actions/run-playwright-e2e-tests/action.yml new file mode 100644 index 000000000..9724c0ec1 --- /dev/null +++ b/.github/actions/run-playwright-e2e-tests/action.yml @@ -0,0 +1,30 @@ +name: Run Playwright end to end tests +description: Run end to end tests using Playwright + +runs: + using: composite + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18.x + - name: Install dependencies + shell: bash + working-directory: ./tests/Dfe.EarlyYearsQualification.E2ETests + run: npm ci + - name: Install Playwright Browsers + shell: bash + working-directory: ./tests/Dfe.EarlyYearsQualification.E2ETests + run: npx playwright install --with-deps + - name: Run Playwright tests + shell: bash + working-directory: ./tests/Dfe.EarlyYearsQualification.E2ETests + env: + CI: true + run: npx playwright test + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 \ No newline at end of file diff --git a/.github/workflows/code-pr-check.yml b/.github/workflows/code-pr-check.yml index a636f6c2d..55e759fdc 100644 --- a/.github/workflows/code-pr-check.yml +++ b/.github/workflows/code-pr-check.yml @@ -1,6 +1,7 @@ name: Code PR Check on: + workflow_dispatch: push: branches: ["main"] paths: @@ -23,13 +24,13 @@ concurrency: env: DOTNET_VERSION: 8 SOLUTION_NAME: 'Dfe.EarlyYearsQualification.sln' - URL: http://127.0.0.1:5000 + URL: 'http://127.0.0.1:5000' jobs: build-app: name: Build, check and run tests - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Check out repository @@ -52,11 +53,8 @@ jobs: url: ${{ env.URL }} auth_secret: ${{ secrets.WEBAPP_E2E_ACCESS_KEY }} - - name: Run e2e tests - uses: ./.github/actions/run-e2e-tests - with: - url: ${{ env.URL }} - auth_secret: ${{ secrets.WEBAPP_E2E_ACCESS_KEY }} + - name: Run Playwright e2e tests + uses: ./.github/actions/run-playwright-e2e-tests - name: Run Accessibility tests uses: ./.github/actions/run-accessibility-tests diff --git a/.gitignore b/.gitignore index 171d9295f..73c9c1b3a 100644 --- a/.gitignore +++ b/.gitignore @@ -498,8 +498,9 @@ junit.xml build/ -# Cypress -tests/Dfe.EarlyYearsQualification.E2ETests/cypress/screenshots/ +# Playwright +tests/Dfe.EarlyYearsQualification.E2ETests/playwright-report/ + # Sonar .sonarqube/ diff --git a/README.md b/README.md index f4ced7d90..72512f471 100644 --- a/README.md +++ b/README.md @@ -61,3 +61,22 @@ dotnet test --collect:"XPlat Code Coverage" --settings coverlet.runsettings ``` This will pull in the exclusions such as the .cshtml files and will replicate coverage in the GitHub Actions. + +## End to end/Smoke testing + +End to end tests are ran using [Playwright](https://playwright.dev/). + +To run the tests, run the following commands: +- Navigate to the correct folder, be it: + - ``cd tests/Dfe.EarlyYearsQualification.E2ETests`` for the E2E tests. + - ``cd tests/Dfe.EarlyYearsQualification.SmokeTests/playwright`` for the smoke tests. +- Tell Node Version Manager that you want the latest version with: ``nvm use node --lts`` +- Run the tests with: ``npx playwright install`` (install all playwright browsers) +- Run the tests with: ``npx playwright test`` (add --ui to run the tests in playwrights UI) + +### Problems with Safari? +If you notice you are having issues with running Safari tests locally and them failing then there is a fix. + +This is happening due to because Safari strictly enforcing the `upgrade-insecure-requests` header. This is converting the HTTP requests to HTTPS. + +To fix this, comment out this line in the web app's [Program.cs](https://github.com/DFE-Digital/check-an-early-years-qualification/blob/main/src/Dfe.EarlyYearsQualification.Web/Program.cs#L138-L140). This will remove the header from all requests and should let Safari use HTTP. diff --git a/src/Dfe.EarlyYearsQualification.Web/Security/SecureHeaderConfiguration.cs b/src/Dfe.EarlyYearsQualification.Web/Security/SecureHeaderConfiguration.cs index da965197a..f92b4efc3 100644 --- a/src/Dfe.EarlyYearsQualification.Web/Security/SecureHeaderConfiguration.cs +++ b/src/Dfe.EarlyYearsQualification.Web/Security/SecureHeaderConfiguration.cs @@ -32,7 +32,7 @@ public static SecureHeadersMiddlewareConfiguration CustomConfiguration() var cookiesPageShaCspElement = new ContentSecurityPolicyElement { CommandType = CspCommandType.Directive, - DirectiveOrUri = "sha256-VAoCuOmBv4C4V/WthoGzlhYyYpWir44ETG7WKh+3kG8=" + DirectiveOrUri = "sha256-J9XqQhqN9DBC2a8DSiKQLF4w9PuSgEx4Vz/Fivcj0t4=" }; var windowLocationShaCspElement = new ContentSecurityPolicyElement @@ -84,7 +84,7 @@ public static SecureHeadersMiddlewareConfiguration CustomConfiguration() var challengePageShowPassword = new ContentSecurityPolicyElement { CommandType = CspCommandType.Directive, - DirectiveOrUri = "sha256-LBWtLNxa0f5+6KBUNLCp8JXVP7YuPtJtEt1Ku3cCKdY=" + DirectiveOrUri = "sha256-fWDhQI9vCzfKzPnyv9Rt3lgLpz8aTH7VYjbVc8OgTXY=" }; var clarityCspElement = new ContentSecurityPolicyElement diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/.env b/tests/Dfe.EarlyYearsQualification.E2ETests/.env new file mode 100644 index 000000000..875cbb257 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/.env @@ -0,0 +1,3 @@ +WEBAPP_URL='http://localhost:3000' +AUTH_SECRET=ABC +DOMAIN=localhost \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress.config.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress.config.js deleted file mode 100644 index 10e64fa05..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress.config.js +++ /dev/null @@ -1,19 +0,0 @@ -const { defineConfig } = require("cypress"); - -module.exports = defineConfig({ - env: { - auth_secret: 'CX' // dummy value: pass in using Cypress command line --env auth_secret=an-acceptable-secret-value - }, - e2e: { - baseUrl: "http://127.0.0.1:5025/", - setupNodeEvents(on, config) { - on('task', { - log(message) { - console.log(message) - return null - } - }) - // implement node event listeners here - } - }, -}); diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/back-button-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/back-button-spec.cy.js deleted file mode 100644 index c20b42207..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/back-button-spec.cy.js +++ /dev/null @@ -1,168 +0,0 @@ -describe('A spec used to test the main back button route through the journey', () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - cy.visit("/"); - cy.get('.govuk-button--start').should('exist'); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - it("back buttons should all navigate to the appropriate pages in the main journey", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - england selection moves us on - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#england').click(); - cy.get('button[id="question-submit"]').click(); - - // when-was-the-qualification-started page - valid date moves us on - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/when-was-the-qualification-started'); - }) - - cy.get('#date-started-month').type("6"); - cy.get('#date-started-year').type("2022"); - cy.get('button[id="question-submit"]').click(); - - // what-level-is-the-qualification page - valid level moves us on - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - cy.get('#3').click(); - cy.get('button[id="question-submit"]').click(); - - // what-is-the-awarding-organisation page - valid awarding organisation moves us on - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-is-the-awarding-organisation'); - }) - - cy.get('#awarding-organisation-select').select(1); // first no-default item in the list - cy.get('button[id="question-submit"]').click(); - - // qualifications page - click a qualification in the list to move us on - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications'); - }) - - cy.get('a[href="/confirm-qualification/EYQ-240"]').click(); - - // confirm qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/confirm-qualification/EYQ-240'); - }) - - cy.get('#yes').click(); - cy.get('button[id="confirm-qualification-button"]').click(); - - // check additional questions first page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-240/1'); - }) - - cy.get('#yes').click(); - cy.get('button[id="additional-requirement-button"]').click(); - - // check additional questions second page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-240/2'); - }) - - cy.get('#no').click(); - cy.get('button[id="additional-requirement-button"]').click(); - - // confirm answers page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-240/confirm-answers'); - }) - - cy.get("#confirm-answers").click(); - - // qualifications page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/qualification-details/EYQ-240'); - }) - - /// Time to go back through the journey! - cy.get('#back-button').click(); - - // confirm answers page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-240/confirm-answers'); - }) - - cy.get('#back-button').click(); - - cy.location().should((loc) => { - // answered additional questions, so back to additional questions page - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-240/2') - }) - - cy.get('#back-button').click(); - - cy.location().should((loc) => { - // answered additional questions, so back to additional questions page - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-240/1') - }) - - cy.get('#back-button').click(); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications'); - }) - - cy.get('#back-button').click(); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-is-the-awarding-organisation'); - }) - - cy.get('#back-button').click(); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - - cy.get('#back-button').click(); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/when-was-the-qualification-started'); - }) - - cy.get('#back-button').click(); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#back-button').click(); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/'); - }) - }) -}) - -describe('test that the back buttons work on all the secondary pages', () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - it('the back button on the accessibility statement page navigates back to the home page', () => { - cy.visit("/accessibility-statement"); - cy.get('#back-button').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/'); - }) - }); - - it('the back button on the cookies preference page navigates back to the home page', () => { - cy.visit("/cookies"); - cy.get('#back-button').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/'); - }) - }); -}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/date-missing-redirect-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/date-missing-redirect-spec.cy.js deleted file mode 100644 index 56cd751cb..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/date-missing-redirect-spec.cy.js +++ /dev/null @@ -1,19 +0,0 @@ -import { pagesThatRedirectIfDateMissing } from "../shared/urls-to-check"; - -describe('A spec used to check that if the user skips entering the date of the qual, then they are redirected back to the date selection page', () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }); - - pagesThatRedirectIfDateMissing.forEach((page) => { - it(`navigating to ${page} should redirect the user to the date selection page`, () => { - - cy.visit(page); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/when-was-the-qualification-started'); - }) - - }) - }) -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/deny-public-access.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/deny-public-access.cy.js deleted file mode 100644 index bc851f6e7..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/deny-public-access.cy.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('A spec used to check a new user is challenged to enter the secret', () => { - - it("should redirect the user to the challenge page", () => { - - cy.visit("/"); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/challenge'); - expect(loc.search).to.eq('?redirectAddress=%2F') - }) - - cy.get('#redirectAddress').should("have.value", '/'); - cy.get('#PasswordValue').should("be.empty"); - }) -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/journey-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/journey-spec.cy.js deleted file mode 100644 index 009e9ca57..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/journey/journey-spec.cy.js +++ /dev/null @@ -1,580 +0,0 @@ -describe('A spec used to test the various routes through the journey', () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - cy.visit("/"); - cy.get('.govuk-button--start').should('exist'); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - it("should redirect the user when they select qualification was awarded outside the UK", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#outside-uk').click(); - cy.get('button[id="question-submit"]').click(); - - // qualification-outside-the-united-kingdom page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/advice/qualification-outside-the-united-kingdom'); - }) - }) - - it("should redirect the user when they select qualification was awarded in Scotland", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#scotland').click(); - cy.get('button[id="question-submit"]').click(); - - // qualifications-achieved-in-scotland - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/advice/qualifications-achieved-in-scotland'); - }) - }) - - it("should redirect the user when they select qualification was awarded in Wales", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#wales').click(); - cy.get('button[id="question-submit"]').click(); - - // qualifications-achieved-in-wales - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/advice/qualifications-achieved-in-wales'); - }) - }) - - it("should redirect the user when they select qualification was awarded in Northern Ireland", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#northern-ireland').click(); - cy.get('button[id="question-submit"]').click(); - - // qualifications-achieved-in-scotland - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/advice/qualifications-achieved-in-northern-ireland'); - }) - }) - - it("should redirect the user when they select qualification was awarded in England", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#england').click(); - cy.get('button[id="question-submit"]').click(); - - // when-was-the-qualification-started page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/when-was-the-qualification-started'); - }) - - cy.get('#date-started-month').type("6"); - cy.get('#date-started-year').type("2022"); - cy.get('button[id="question-submit"]').click(); - - // what-level-is-the-qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - cy.get('#3').click(); - cy.get('button[id="question-submit"]').click(); - - // what-is-the-awarding-organisation page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-is-the-awarding-organisation'); - }) - - cy.get('#awarding-organisation-select').select(1); // first no-default item in the list - cy.get('button[id="question-submit"]').click(); - - // qualifications page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications'); - }) - - cy.get('a[href="/confirm-qualification/EYQ-240"]').click(); - - // confirm qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/confirm-qualification/EYQ-240'); - }) - - cy.get('#yes').click(); - cy.get('button[id="confirm-qualification-button"]').click(); - - // check additional questions first page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-240/1'); - }) - - cy.get('#yes').click(); - cy.get('button[id="additional-requirement-button"]').click(); - - // check additional questions seconf page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-240/2'); - }) - - cy.get('#yes').click(); - cy.get('button[id="additional-requirement-button"]').click(); - - // confirm answers page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-240/confirm-answers'); - }) - - cy.get("#confirm-answers").click(); - - // qualification details page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/qualification-details/EYQ-240'); - }) - }) - - it("Selecting the 'Qualification is not on the list' link on the qualification list page should navigate to the correct advice page", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#england').click(); - cy.get('button[id="question-submit"]').click(); - - // when-was-the-qualification-started page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/when-was-the-qualification-started'); - }) - - cy.get('#date-started-month').type("6"); - cy.get('#date-started-year').type("2022"); - cy.get('button[id="question-submit"]').click(); - - // what-level-is-the-qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - cy.get('#3').click(); - cy.get('button[id="question-submit"]').click(); - - // what-is-the-awarding-organisation page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-is-the-awarding-organisation'); - }) - - cy.get('#awarding-organisation-select').select(1); // first no-default item in the list - cy.get('button[id="question-submit"]').click(); - - // qualifications page (This is only a temporary page) - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications'); - }) - - // click not on the list link - cy.get('a[href="/advice/qualification-not-on-the-list"]').click(); - - // qualification not on the list page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/advice/qualification-not-on-the-list'); - }) - - cy.get('#advice-page-heading').should("contain.text", "This is the level 3 page"); - - // check back button goes back to the qualifications list page - cy.get('#back-button').click(); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications'); - }) - }) - - it("Selecting qualification level 7 started between 1 Sept 2014 and 31 August 2019 should navigate to the level 7 2014-2019 advice page", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#england').click(); - cy.get('button[id="question-submit"]').click(); - - // when-was-the-qualification-started page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/when-was-the-qualification-started'); - }) - - cy.get('#date-started-month').type("8"); - cy.get('#date-started-year').type("2015"); - cy.get('button[id="question-submit"]').click(); - - // what-level-is-the-qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - cy.get('#7').click(); - cy.get('button[id="question-submit"]').click(); - - // level 7 post 2014 advice page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/advice/level-7-qualifications-started-between-1-sept-2014-and-31-aug-2019'); - }) - - // check back button goes back to the what level is the qualification page - cy.get('#back-button').click(); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - }) - - - it("Selecting qualification level 7 started after 1 Sept 2019 should navigate to the level 7 post 2019 advice page", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#england').click(); - cy.get('button[id="question-submit"]').click(); - - // when-was-the-qualification-started page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/when-was-the-qualification-started'); - }) - - cy.get('#date-started-month').type("8"); - cy.get('#date-started-year').type("2020"); - cy.get('button[id="question-submit"]').click(); - - // what-level-is-the-qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - cy.get('#7').click(); - cy.get('button[id="question-submit"]').click(); - - // level 7 post 2014 advice page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/advice/level-7-qualification-after-aug-2019'); - }) - - // check back button goes back to the what level is the qualification page - cy.get('#back-button').click(); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - }) - - - it("should move the user back to the previous page when they click on the back button", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('.govuk-back-link').click(); - - // home page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/'); - }) - }) - - it("Should remove the search criteria when a user goes to the awarding organisation page and back again", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#england').click(); - cy.get('button[id="question-submit"]').click(); - - // when-was-the-qualification-started page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/when-was-the-qualification-started'); - }) - - cy.get('#date-started-month').type("6"); - cy.get('#date-started-year').type("2022"); - cy.get('button[id="question-submit"]').click(); - - // what-level-is-the-qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - cy.get('#3').click(); - cy.get('button[id="question-submit"]').click(); - - // what-is-the-awarding-organisation page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-is-the-awarding-organisation'); - }) - - cy.get('#awarding-organisation-select').select(1); // first no-default item in the list - cy.get('button[id="question-submit"]').click(); - - // Select a qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications'); - }) - - cy.get('#refineSearch').type('test'); - cy.get('#refineSearchButton').click(); - - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications'); - }) - - cy.get('#back-button').click(); - // what-is-the-awarding-organisation page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-is-the-awarding-organisation'); - }) - - cy.get('#awarding-organisation-select').select(1); // first no-default item in the list - cy.get('button[id="question-submit"]').click(); - - // Select a qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications'); - }) - - cy.get('#refineSearch').should('have.value', ''); - }) - - const testDates = [ - ['09', '2014'], - ['06', '2017'], - ['08', '2019'], - ]; - - testDates.forEach((date) => { - const [month, year] = date; - it(`should redirect when qualification is level 2 and startMonth is ${month} and startYear is ${year}`, () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#england').click(); - cy.get('button[id="question-submit"]').click(); - - // when-was-the-qualification-started page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/when-was-the-qualification-started'); - }) - - cy.get('#date-started-month').type(month); - cy.get('#date-started-year').type(year); - cy.get('button[id="question-submit"]').click(); - - // what-level-is-the-qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - cy.get('#2').click(); - cy.get('button[id="question-submit"]').click(); - - // level-2-qualifications-started-between-1-sept-2014-and-31-aug-2019 page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/advice/level-2-qualifications-started-between-1-sept-2014-and-31-aug-2019'); - }) - }) - }) - - it("should bypass remaining additional requirement question when answering yes to the Qts question", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#england').click(); - cy.get('button[id="question-submit"]').click(); - - // when-was-the-qualification-started page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/when-was-the-qualification-started'); - }) - - cy.get('#date-started-month').type("6"); - cy.get('#date-started-year').type("2022"); - cy.get('button[id="question-submit"]').click(); - - // what-level-is-the-qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - cy.get('#6').click(); - cy.get('button[id="question-submit"]').click(); - - // what-is-the-awarding-organisation page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-is-the-awarding-organisation'); - }) - - cy.get('#awarding-organisation-select').select(1); // first no-default item in the list - cy.get('button[id="question-submit"]').click(); - - // qualifications page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications'); - }) - - cy.get('a[href="/confirm-qualification/EYQ-108"]').click(); - - // confirm qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/confirm-qualification/EYQ-108'); - }) - - cy.get('#yes').click(); - cy.get('button[id="confirm-qualification-button"]').click(); - - // check additional questions first page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-108/1'); - }) - - cy.get('#yes').click(); - cy.get('button[id="additional-requirement-button"]').click(); - - // confirm answers page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-108/confirm-answers'); - }) - - cy.get("#confirm-answers").click(); - - // qualification details page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/qualification-details/EYQ-108'); - }) - }) - - it("should not bypass remaining additional requirement question when answering no to the Qts question", () => { - // home page - cy.get('.govuk-button--start').click(); - - // where-was-the-qualification-awarded page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/where-was-the-qualification-awarded'); - }) - - cy.get('#england').click(); - cy.get('button[id="question-submit"]').click(); - - // when-was-the-qualification-started page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/when-was-the-qualification-started'); - }) - - cy.get('#date-started-month').type("6"); - cy.get('#date-started-year').type("2022"); - cy.get('button[id="question-submit"]').click(); - - // what-level-is-the-qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-level-is-the-qualification'); - }) - cy.get('#6').click(); - cy.get('button[id="question-submit"]').click(); - - // what-is-the-awarding-organisation page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/questions/what-is-the-awarding-organisation'); - }) - - cy.get('#awarding-organisation-select').select(1); // first no-default item in the list - cy.get('button[id="question-submit"]').click(); - - // qualifications page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications'); - }) - - cy.get('a[href="/confirm-qualification/EYQ-108"]').click(); - - // confirm qualification page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/confirm-qualification/EYQ-108'); - }) - - cy.get('#yes').click(); - cy.get('button[id="confirm-qualification-button"]').click(); - - // check additional questions first page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-108/1'); - }) - - cy.get('#no').click(); - cy.get('button[id="additional-requirement-button"]').click(); - - // check second additional question - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-108/2'); - }) - - cy.get('#yes').click(); - cy.get('button[id="additional-requirement-button"]').click(); - - // confirm answers page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/check-additional-questions/EYQ-108/confirm-answers'); - }) - - cy.get("#confirm-answers").click(); - - // qualification details page - cy.location().should((loc) => { - expect(loc.pathname).to.eq('/qualifications/qualification-details/EYQ-108'); - }) - }) -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/accessibility-specification-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/accessibility-specification-spec.cy.js deleted file mode 100644 index f4775f405..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/accessibility-specification-spec.cy.js +++ /dev/null @@ -1,14 +0,0 @@ -describe("A spec that tests the accessibility statement page", () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - it("Checks the heading and content are present", () => { - cy.visit("/accessibility-statement"); - - - cy.get("#accessibility-statement-heading").should("contain.text", "Test Accessibility Statement Heading"); - cy.get("#accessibility-statement-body").should("contain.text", "Test Accessibility Statement Body"); - }) -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/advice-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/advice-spec.cy.js deleted file mode 100644 index a7a5daef7..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/advice-spec.cy.js +++ /dev/null @@ -1,114 +0,0 @@ -describe("A spec that tests advice pages", () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - it("Checks the Qualifications achieved outside the United Kingdom details are on the page", () => { - cy.visit("/advice/qualification-outside-the-united-kingdom"); - - cy.get("#advice-page-heading").should("contain.text", "Qualifications achieved outside the United Kingdom"); - cy.get("#advice-page-body").should("contain.text", "Test Advice Page Body"); - - cy.get(".govuk-notification-banner__title").eq(0).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(0).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(0).should("contain.text", "This is the body text"); - - cy.get(".govuk-notification-banner__title").eq(1).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(1).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(1).should("contain.text", "This is the body text"); - }) - - it("Checks the level 2 between 1 Sept 2014 and 31 Aug 2019 details are on the page", () => { - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D'); - cy.visit("/advice/level-2-qualifications-started-between-1-sept-2014-and-31-aug-2019"); - - cy.get("#advice-page-heading").should("contain.text", "Level 2 qualifications started between 1 September 2014 and 31 August 2019"); - cy.get("#advice-page-body").should("contain.text", "Test Advice Page Body"); - - cy.get(".govuk-notification-banner__title").eq(0).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(0).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(0).should("contain.text", "This is the body text"); - - cy.get(".govuk-notification-banner__title").eq(1).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(1).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(1).should("contain.text", "This is the body text"); - }) - - it("Checks the Qualifications achieved in Scotland details are on the page", () => { - cy.visit("/advice/qualifications-achieved-in-scotland"); - - cy.get("#advice-page-heading").should("contain.text", "Qualifications achieved in Scotland"); - cy.get("#advice-page-body").should("contain.text", "Test Advice Page Body"); - - cy.get(".govuk-notification-banner__title").eq(0).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(0).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(0).should("contain.text", "This is the body text"); - - cy.get(".govuk-notification-banner__title").eq(1).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(1).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(1).should("contain.text", "This is the body text"); - }) - - it("Checks the Qualifications achieved in Wales details are on the page", () => { - cy.visit("/advice/qualifications-achieved-in-wales"); - - cy.get("#advice-page-heading").should("contain.text", "Qualifications achieved in Wales"); - cy.get("#advice-page-body").should("contain.text", "Test Advice Page Body"); - - cy.get(".govuk-notification-banner__title").eq(0).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(0).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(0).should("contain.text", "This is the body text"); - - cy.get(".govuk-notification-banner__title").eq(1).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(1).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(1).should("contain.text", "This is the body text"); - }) - - it("Checks the Qualifications achieved in Northern Ireland details are on the page", () => { - cy.visit("/advice/qualifications-achieved-in-northern-ireland"); - - cy.get("#advice-page-heading").should("contain.text", "Qualifications achieved in Northern Ireland"); - cy.get("#advice-page-body").should("contain.text", "Test Advice Page Body"); - - cy.get(".govuk-notification-banner__title").eq(0).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(0).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(0).should("contain.text", "This is the body text"); - - cy.get(".govuk-notification-banner__title").eq(1).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(1).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(1).should("contain.text", "This is the body text"); - }) - - it("Checks the level 7 between 1 Sept 2014 and 31 Aug 2019 details are on the page", () => { - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D'); - cy.visit("/advice/level-7-qualifications-started-between-1-sept-2014-and-31-aug-2019"); - - cy.get("#advice-page-heading").should("contain.text", "Level 7 qualifications started between 1 September 2014 and 31 August 2019"); - cy.get("#advice-page-body").should("contain.text", "Test Advice Page Body"); - - cy.get(".govuk-notification-banner__title").eq(0).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(0).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(0).should("contain.text", "This is the body text"); - - cy.get(".govuk-notification-banner__title").eq(1).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(1).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(1).should("contain.text", "This is the body text"); - }) - - it("Checks the Level 7 qualification after aug 2019 details are on the page", () => { - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2020%22%7D'); - cy.visit("/advice/level-7-qualification-after-aug-2019"); - - cy.get("#advice-page-heading").should("contain.text", "Level 7 qualification after aug 2019"); - cy.get("#advice-page-body").should("contain.text", "Test Advice Page Body"); - - cy.get(".govuk-notification-banner__title").eq(0).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(0).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(0).should("contain.text", "This is the body text"); - - cy.get(".govuk-notification-banner__title").eq(1).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(1).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(1).should("contain.text", "This is the body text"); - }) -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/challenge-page-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/challenge-page-spec.cy.js deleted file mode 100644 index 6f82f9665..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/challenge-page-spec.cy.js +++ /dev/null @@ -1,42 +0,0 @@ -describe('A spec that tests the challenge page', () => { - beforeEach(() => { - cy.visit("/challenge"); - }); - - it("should show the missing password error when the user doesn't enter a password", () => { - - cy.get('#error-banner').should("not.exist"); - cy.get('#error-message').should("not.exist"); - - cy.get('#question-submit').click(); - - cy.get('#error-banner').should("exist"); - cy.get('#error-banner-link').should("contain.text", "Test Missing Password Text"); - cy.get('#error-message').should("contain.text", "Test Missing Password Text"); - }); - - it("should show the incorrect password error when the user enters an incorrect password", () => { - - cy.get('#error-banner').should("not.exist"); - cy.get('#error-message').should("not.exist"); - - cy.get('#PasswordValue').type("Some incorrect password"); - cy.get('#question-submit').click(); - - cy.get('#error-banner').should("exist"); - cy.get('#error-banner-link').should("contain.text", "Test Incorrect Password Text"); - cy.get('#error-message').should("contain.text", "Test Incorrect Password Text"); - }); - - it("clicking the show password button changes the password input to text, clicking it again turns it back", () => { - cy.get("#PasswordValue").should('have.attr', 'type', 'password'); - - cy.get("#togglePassword").click(); - - cy.get("#PasswordValue").should('have.attr', 'type', 'text'); - - cy.get("#togglePassword").click(); - - cy.get("#PasswordValue").should('have.attr', 'type', 'password'); - }); -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/check-additional-questions-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/check-additional-questions-spec.cy.js deleted file mode 100644 index 4edae2669..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/check-additional-questions-spec.cy.js +++ /dev/null @@ -1,49 +0,0 @@ -describe("A spec that tests the check additional questions page", () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D'); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - it("Checks the check additional questions details are on the first question page", () => { - cy.visit("/qualifications/check-additional-questions/eyq-240/1"); - - cy.get("#back-button").should("have.attr", "href").and("include", "/qualifications"); - - cy.get("#question").should("contain.text", "Test question"); - cy.get("#hint").should("contain.text", "This is the hint text"); - cy.get(".govuk-details__summary-text").should("contain.text", "This is the details heading"); - cy.get(".govuk-details__text").should("contain.text", "This is the details content"); - cy.get("Label[for='yes']").should("contain.text", "Yes"); - cy.get("Label[for='no']").should("contain.text", "No"); - - cy.get("#additional-requirement-button").should("contain.text", "Get result"); - }) - - it("Checks the check additional questions details are on the second question page", () => { - cy.visit("/qualifications/check-additional-questions/eyq-240/2"); - - cy.get("#back-button").should("have.attr", "href").and("include", "/qualifications/check-additional-questions"); - - cy.get("#question").should("contain.text", "Test question 2"); - cy.get("#hint").should("contain.text", "This is the hint text"); - cy.get(".govuk-details__summary-text").should("contain.text", "This is the details heading"); - cy.get(".govuk-details__text").should("contain.text", "This is the details content"); - cy.get("Label[for='yes']").should("contain.text", "Yes"); - cy.get("Label[for='no']").should("contain.text", "No"); - }) - - it("Shows errors if user does not select an option", () => { - cy.visit("/qualifications/check-additional-questions/eyq-240/1"); - - cy.get("#additional-requirement-button").click(); - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There was a problem"); - cy.get("#error-banner-link").should("contain.text", "This is a test error message"); - - cy.get("#option-error").should("be.visible"); - cy.get("#option-error").should("contain.text", "This is a test error message"); - cy.get(".govuk-form-group--error").should("be.visible"); - }); -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/confirm-additional-question-answers-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/confirm-additional-question-answers-spec.cy.js deleted file mode 100644 index 6cf2cb25b..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/confirm-additional-question-answers-spec.cy.js +++ /dev/null @@ -1,56 +0,0 @@ -describe("A spec used to test the check additional requirements answer page", () => { - - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - it("Checks the page contains the relevant components", () => { - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%2212%2F2022%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22%22%2C%22SelectedAwardingOrganisationNotOnTheList%22%3Atrue%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22yes%22%7D%2C%22QualificationWasSelectedFromList%22%3A1%7D') - - cy.visit("/qualifications/check-additional-questions/EYQ-240/confirm-answers"); - - // Full cookie set from running through the entire journey up to this page. - - cy.get(".govuk-heading-xl").should("contain.text", "Test page heading"); - - cy.get("#question-1-question").should("contain.text", "Test question"); - cy.get("#question-1-answer").should("contain.text", "Yes"); - cy.get("#question-1-change").should("contain.text", "Test change answer text"); - cy.get("#question-2-question").should("contain.text", "Test question"); - cy.get("#question-2-answer").should("contain.text", "Yes"); - cy.get("#question-2-change").should("contain.text", "Test change answer text"); - - cy.get('#warning-text-container').should("exist"); - cy.get(".govuk-warning-text__text").should("contain.text", "Test answer disclaimer text"); - - cy.get("#confirm-answers").should("contain.text", "Test button text"); - }) - - it("Navigates to the correct question page if the user clicks to change an answer", () => { - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%2212%2F2022%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22%22%2C%22SelectedAwardingOrganisationNotOnTheList%22%3Atrue%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22yes%22%7D%2C%22QualificationWasSelectedFromList%22%3A1%7D') - - cy.visit("/qualifications/check-additional-questions/EYQ-240/confirm-answers"); - - cy.get("#question-1-change a").click(); - - cy.url().should("include", "/qualifications/check-additional-questions/EYQ-240/1"); - - cy.get("#additional-requirement-button").click(); - cy.get("#additional-requirement-button").click(); - - cy.get("#question-2-change a").click(); - - cy.url().should("include", "/qualifications/check-additional-questions/EYQ-240/2"); - }) - - it("Navigates back to the last question when the back button is clicked", () => { - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%2212%2F2022%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22%22%2C%22SelectedAwardingOrganisationNotOnTheList%22%3Atrue%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22yes%22%7D%2C%22QualificationWasSelectedFromList%22%3A1%7D') - - cy.visit("/qualifications/check-additional-questions/EYQ-240/confirm-answers"); - - cy.get('#back-button').click(); - - cy.url().should("include", "/qualifications/check-additional-questions/EYQ-240/2"); - }) -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/confirm-qualification-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/confirm-qualification-spec.cy.js deleted file mode 100644 index 8610b7177..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/confirm-qualification-spec.cy.js +++ /dev/null @@ -1,61 +0,0 @@ -describe("A spec that tests the confirm qualification page", () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D'); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - - it("Checks the static page content is on the page", () => { - cy.visit("/confirm-qualification/eyq-240"); - - cy.get("#heading").should("contain.text", "Test heading"); - cy.get("#post-heading").should("contain.text", "The post heading content"); - cy.get("#qualification-name-row dt").should("contain.text", "Test qualification label"); - cy.get("#qualification-level-row dt").should("contain.text", "Test level label"); - cy.get("#qualification-org-row dt").should("contain.text", "Test awarding organisation label"); - cy.get("#various-ao-content").should("not.exist"); - cy.get("#radio-heading").should("contain.text", "Test radio heading"); - - cy.get('input[value="yes"]').should("exist"); - cy.get('input[value="no"]').should("exist"); - - cy.get('label[for="yes"]').should("contain.text", "yes"); - cy.get('label[for="no"]').should("contain.text", "no"); - - cy.get('#warning-text-container').should("not.exist"); - - cy.get("#confirm-qualification-button").should("contain.text", "Test button text"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#confirm-qualification-choice-error").should("not.exist"); - }); - - it("Checks the various content is on the page", () => { - cy.visit("/confirm-qualification/eyq-250"); - - cy.get('#various-ao-content').should("exist"); - cy.get('#various-ao-content').should("contain.text", "Various awarding organisation explanation text"); - }); - - it("Checks the warning content is on the page when the qualification has no additional requirement questions", () => { - cy.visit("/confirm-qualification/eyq-115"); - - cy.get('#warning-text-container').should("exist"); - cy.get('#warning-text-container').should("contain.text", "Answer disclaimer text"); - cy.get("#confirm-qualification-button").should("contain.text", "Get result"); - }); - - it("Shows errors if user does not select an option", () => { - cy.visit("/confirm-qualification/eyq-240"); - - cy.get("#confirm-qualification-button").click(); - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "Test error banner heading"); - cy.get("#error-banner-link").should("contain.text", "Test error banner link"); - - cy.get("#confirm-qualification-choice-error").should("contain.text", "Test error text"); - cy.get(".govuk-form-group--error").should("be.visible"); - }); -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/cookies-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/cookies-spec.cy.js deleted file mode 100644 index 1e3857e79..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/cookies-spec.cy.js +++ /dev/null @@ -1,56 +0,0 @@ -describe("A spec that tests the cookies page", () => { - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - cy.visit("/cookies"); - }); - - it("Checks the content is present", () => { - cy.get("#cookies-set-banner").should("not.exist"); - - cy.get("#cookies-heading").should("contain.text", "Test Cookies Heading"); - cy.get("#cookies-body").should("contain.text", "Test Cookies Page Body"); - - cy.get("#cookies-form-heading").should("contain.text", "Test Form Heading"); - - cy.get("#test-option-value-1").should("exist"); - cy.get("#test-option-value-2").should("exist"); - - cy.get("label[for='test-option-value-1']").should("contain.text", "Test Option Label 1"); - cy.get("label[for='test-option-value-2']").should("contain.text", "Test Option Label 2"); - - cy.get("#cookies-choice-error") - .should("not.be.visible") - .and("contain.text", "Test Error Text"); - - cy.get('button[id="cookies-button"]').should("contain.text", "Test Cookies Button"); - }); - - describe("Check the functionality of the page", () => { - it("Checks that the radio button validation is working", () => { - cy.get('button[id="cookies-button"]').click(); - - cy.get("#cookies-set-banner").should("not.exist"); - - cy.get("#cookies-choice-error").should("be.visible"); - }); - - ["test-option-value-1", "test-option-value-2"].forEach((option) => { - it(`Checks that selecting ${option} reveals success banner`, () => { - - cy.get(`#${option}`).click(); - - cy.get('button[id="cookies-button"]').click(); - - cy.get("#cookies-set-banner").should("be.visible"); - - // Seen as the success banner doesn't exist in the rendered HTML by default; we have to check the content once we expect the heading to be visible. - cy.get("#cookies-set-banner-heading").should("contain.text", "Test Success Banner Heading"); - cy.get("#cookies-set-banner-content").should("contain.text", "Test Success Banner Content"); - - cy.get("#cookies-choice-error").should("not.be.visible"); - }); - }); - }); -}); diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/home-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/home-spec.cy.js deleted file mode 100644 index 4d2030e55..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/home-spec.cy.js +++ /dev/null @@ -1,24 +0,0 @@ -describe("A spec used to test the home page", () => { - - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - it("Checks the page contains the relevant components", () => { - cy.visit("/"); - - cy.get(".govuk-heading-xl").should("contain.text", "Test Header"); - cy.get("#pre-cta-content p").should("contain.text", "This is the pre cta content"); - cy.get(".govuk-button--start").should("contain.text", "Start Button Text"); - cy.get("#post-cta-content p").should("contain.text", "This is the post cta content"); - cy.get("#right-hand-content-header").should("contain.text", "Related content"); - cy.get("#right-hand-content p").should("contain.text", "This is the right hand content"); - }) - - it("Checks Crown copyright link text", () => { - cy.visit("/"); - - cy.get(".govuk-footer__copyright-logo").first().should("contain.text", "Crown copyright") - }) -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/not-found-page-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/not-found-page-spec.cy.js deleted file mode 100644 index 0c2ec7b40..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/not-found-page-spec.cy.js +++ /dev/null @@ -1,32 +0,0 @@ -describe("A spec used to test the not found page", () => { - - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }); - - it("Checks the page contains the relevant components", () => { - cy.visit({ - url: "/error/404", - failOnStatusCode: false, - }); - - cy.get("#page-not-found-heading").should("contain.text", "Page not found"); - cy.get("#page-not-found-statement-body").should("contain.text", "If you typed out the web address, check it is correct."); - cy.get("#page-not-found-statement-body").should("contain.text", "If you pasted the web address, check you copied the entire address."); - cy.get("#page-not-found-statement-body").should("contain.text", "If the web address is correct or you selected a link or button, contact the check an early years qualification team by emailing techsupport.EARLY-YEARS-QUALS@education.gov.uk to report a fault with the service."); - - cy.get("#page-not-found-link").should("have.attr", "href", "mailto:techsupport.EARLY-YEARS-QUALS@education.gov.uk"); - - }); - - it("Check that visiting a URL that doesn't exist shows this page without altering the URL", () => { - cy.visit({ - url: "/does-not-exist", - failOnStatusCode: false, - }); - - cy.url().should("include", "/does-not-exist"); - - cy.get("#page-not-found-heading").should("contain.text", "Page not found"); - }); -}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/problem-with-the-service-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/problem-with-the-service-spec.cy.js deleted file mode 100644 index e4b2a49ca..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/problem-with-the-service-spec.cy.js +++ /dev/null @@ -1,14 +0,0 @@ -describe("A spec used to test the not found page", () => { - - it("Checks the page contains the relevant components", () => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - - cy.visit("/error"); - - cy.get("#problem-with-service-heading").should("contain.text", "Sorry, there is a problem with the service"); - cy.get("#problem-with-service-body").should("contain.text", "Please try again later."); - cy.get("#problem-with-service-body").should("contain.text", "In the meantime, you can download the early years qualifications list (EYQL) spreadsheet. This document is regularly updated by DfE to add new or updated qualifications as they become approved. You should refresh the page before downloading the EYQL spreadsheet to be sure that you are using the latest version."); - - cy.get("#problem-with-service-link").should("have.attr", "href", "https://www.gov.uk/government/publications/early-years-qualifications-achieved-in-england"); - }); -}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-details-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-details-spec.cy.js deleted file mode 100644 index a471109c2..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-details-spec.cy.js +++ /dev/null @@ -1,191 +0,0 @@ -describe("A spec used to test the qualification details page", () => { - - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - it("Checks the qualification details are on the page", () => { - // Value is '{"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"7/2015","LevelOfQualification":"3","WhatIsTheAwardingOrganisation":"NCFE","SearchCriteria":"","AdditionalQuestionsAnswers":{"Test question":"yes","Test question 2":"no"}}' encoded - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22no%22%7D%7D'); - cy.visit("/qualifications/qualification-details/eyq-240"); - - cy.get("#page-header").should("contain.text", "Test Main Heading"); - cy.get("#qualification-details-header").should("contain.text", "Qualification details"); - cy.get("#qualification-name-label").should("contain.text", "Qualification"); - cy.get("#qualification-name-value").should("contain.text", "T Level Technical Qualification in Education and Childcare (Specialism - Early Years Educator)"); - cy.get("#awarding-organisation-label").should("contain.text", "Awarding Org Label"); - cy.get("#awarding-organisation-value").should("contain.text", "NCFE"); - cy.get("#qualification-level-label").should("contain.text", "Test Level Label"); - cy.get("#qualification-level-value").should("contain.text", "3"); - cy.get("#date-started-date-label").should("contain.text", "Qualification start date"); - cy.get("#date-started-date-value").should("contain.text", "July 2015"); - - // Check that the additional requirements and the answers are present - cy.get("#additional-requirement-0-label").should("contain.text", "This is the confirmation statement 1"); - cy.get("#additional-requirement-0-value").should("contain.text", "Yes"); - cy.get("#additional-requirement-1-label").should("contain.text", "This is the confirmation statement 2"); - cy.get("#additional-requirement-1-value").should("contain.text", "No"); - - cy.get("#date-of-check-label").should("contain.text", "Test Date Of Check Label"); - - cy.get("#ratio-heading").should("contain.text", "Test ratio heading"); - cy.get("#ratio-heading + p[class='govuk-body']").should("contain.text", "This is the ratio text"); - - cy.get("#requirements-heading").should("contain.text", "Test requirements heading"); - cy.get("#requirements-heading + p[class='govuk-body']").should("contain.text", "This is the requirements text"); - - cy.get("#check-another-qualification-link").should("contain.text", "Check another qualification"); - - cy.get(".govuk-notification-banner__title").eq(0).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(0).should("contain.text", "Test heading"); - cy.get(".govuk-notification-banner__content").eq(0).should("contain.text", "Test body"); - - cy.get(".govuk-notification-banner__title").eq(1).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(1).should("contain.text", "Test heading"); - cy.get(".govuk-notification-banner__content").eq(1).should("contain.text", "Test body"); - }) - - it("Checks the order of the ratios for a level 6 qualification when a user answers yes to the Qts Question", () => { - // Value is '{"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"7/2015","LevelOfQualification":"6","WhatIsTheAwardingOrganisation":"NCFE","SearchCriteria":"","AdditionalQuestionsAnswers":{"This is the Qts question":"yes"}}' encoded - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%226%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22This%20is%20the%20Qts%20question%22%3A%22yes%22%7D%7D'); - cy.visit("/qualifications/qualification-details/eyq-108"); - - cy.get(".ratio-row").should('have.length', 4); - cy.get(".ratio-heading").eq(0).should("contain.text", "Level 6"); - cy.get(".ratio-heading").eq(1).should("contain.text", "Level 3"); - cy.get(".ratio-heading").eq(2).should("contain.text", "Level 2"); - cy.get(".ratio-heading").eq(3).should("contain.text", "Unqualified"); - - - // Phase Banner uses govuk-tag also hence index starting at 1 - cy.get(".govuk-tag").eq(1).should("contain.text", "Approved"); - cy.get(".govuk-tag").eq(2).should("contain.text", "Approved"); - cy.get(".govuk-tag").eq(3).should("contain.text", "Approved"); - cy.get(".govuk-tag").eq(4).should("contain.text", "Approved"); - - cy.get(".govuk-tag").eq(1).should("have.class", "govuk-tag--green"); - cy.get(".govuk-tag").eq(2).should("have.class", "govuk-tag--green"); - cy.get(".govuk-tag").eq(3).should("have.class", "govuk-tag--green"); - cy.get(".govuk-tag").eq(4).should("have.class", "govuk-tag--green"); - }) - - it("Checks the order of the ratios for a level 6 qualification when a user answers no to the Qts Question but yes to the remaining question", () => { - // Value is '{"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"7/2015","LevelOfQualification":"6","WhatIsTheAwardingOrganisation":"NCFE","SearchCriteria":"","AdditionalQuestionsAnswers":{"This is the Qts question":"no","Test question 2":"yes"}}' encoded - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%226%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22This%20is%20the%20Qts%20question%22%3A%22no%22%2C%22Test%20question%202%22%3A%22yes%22%7D%7D'); - cy.visit("/qualifications/qualification-details/eyq-108"); - - cy.get(".ratio-row").should('have.length', 4); - cy.get(".ratio-heading").eq(0).should("contain.text", "Level 3"); - cy.get(".ratio-heading").eq(1).should("contain.text", "Level 2"); - cy.get(".ratio-heading").eq(2).should("contain.text", "Unqualified"); - cy.get(".ratio-heading").eq(3).should("contain.text", "Level 6"); - - // Phase Banner uses govuk-tag also hence index starting at 1 - cy.get(".govuk-tag").eq(1).should("contain.text", "Approved"); - cy.get(".govuk-tag").eq(2).should("contain.text", "Approved"); - cy.get(".govuk-tag").eq(3).should("contain.text", "Approved"); - cy.get(".govuk-tag").eq(4).should("contain.text", "Not approved"); - - cy.get(".govuk-tag").eq(1).should("have.class", "govuk-tag--green"); - cy.get(".govuk-tag").eq(2).should("have.class", "govuk-tag--green"); - cy.get(".govuk-tag").eq(3).should("have.class", "govuk-tag--green"); - cy.get(".govuk-tag").eq(4).should("have.class", "govuk-tag--red"); - }) - - it("Checks the order of the ratios on the page when a user answers additional requirement questions indicating full and relevant", () => { - // Value is '{"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"7/2015","LevelOfQualification":"3","WhatIsTheAwardingOrganisation":"NCFE","SearchCriteria":"","AdditionalQuestionsAnswers":{"Test question":"yes","Test question 2":"no"}}' encoded - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22no%22%7D%7D'); - cy.visit("/qualifications/qualification-details/eyq-240"); - - cy.get(".ratio-row").should('have.length', 4); - cy.get(".ratio-heading").eq(0).should("contain.text", "Level 3"); - cy.get(".ratio-heading").eq(1).should("contain.text", "Level 2"); - cy.get(".ratio-heading").eq(2).should("contain.text", "Unqualified"); - cy.get(".ratio-heading").eq(3).should("contain.text", "Level 6"); - - // Phase Banner uses govuk-tag also hence index starting at 1 - cy.get(".govuk-tag").eq(1).should("contain.text", "Approved"); - cy.get(".govuk-tag").eq(2).should("contain.text", "Approved"); - cy.get(".govuk-tag").eq(3).should("contain.text", "Approved"); - cy.get(".govuk-tag").eq(4).should("contain.text", "Not approved"); - - cy.get(".govuk-tag").eq(1).should("have.class", "govuk-tag--green"); - cy.get(".govuk-tag").eq(2).should("have.class", "govuk-tag--green"); - cy.get(".govuk-tag").eq(3).should("have.class", "govuk-tag--green"); - cy.get(".govuk-tag").eq(4).should("have.class", "govuk-tag--red"); - }) - - it("Checks the staff ratio text shows correctly when not full and relevant for a L3+ qualification started between Sep14 & Aug19", () => { - // Value is '{"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"7/2015","LevelOfQualification":"3","WhatIsTheAwardingOrganisation":"NCFE","SearchCriteria":"","AdditionalQuestionsAnswers":{"Test question":"yes","Test question 2":"yes"}}' encoded - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22yes%22%7D%7D'); - cy.visit("/qualifications/qualification-details/eyq-240"); - - cy.get("#ratio-heading").should("contain.text", "Test ratio heading"); - cy.get("#ratio-heading + p[class='govuk-body']").should("contain.text", "This is not F&R for L3 between Sep14 & Aug19"); - }) - - it("Checks the staff ratio text shows correctly when not full and relevant for a L3+ qualification started after Sep19", () => { - // Value is '{"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"10/2019","LevelOfQualification":"3","WhatIsTheAwardingOrganisation":"NCFE","SearchCriteria":"","AdditionalQuestionsAnswers":{"Test question":"yes","Test question 2":"yes"}}' encoded - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%2210%2F2019%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22yes%22%7D%7D'); - cy.visit("/qualifications/qualification-details/eyq-240"); - - cy.get("#ratio-heading").should("contain.text", "Test ratio heading"); - cy.get("#ratio-heading + p[class='govuk-body']").should("contain.text", "This is not F&R"); - }) - - it("Checks the order of the ratios on the page when a user answers an additional requirement question indicating not full and relevant", () => { - // Value is '{"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"7/2015","LevelOfQualification":"3","WhatIsTheAwardingOrganisation":"NCFE","SearchCriteria":"","AdditionalQuestionsAnswers":{"Test question":"yes","Test question 2":"yes"}}' encoded - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22yes%22%7D%7D'); - cy.visit("/qualifications/qualification-details/eyq-241"); - - cy.get(".ratio-row").should('have.length', 4); - cy.get(".ratio-heading").eq(0).should("contain.text", "Unqualified"); - cy.get(".ratio-heading").eq(1).should("contain.text", "Level 2"); - cy.get(".ratio-heading").eq(2).should("contain.text", "Level 3"); - cy.get(".ratio-heading").eq(3).should("contain.text", "Level 6"); - - // Phase Banner uses govuk-tag also hence index starting at 1 - cy.get(".govuk-tag").eq(1).should("contain.text", "Approved"); - cy.get(".govuk-tag").eq(2).should("contain.text", "Not approved"); - cy.get(".govuk-tag").eq(3).should("contain.text", "Not approved"); - cy.get(".govuk-tag").eq(4).should("contain.text", "Not approved"); - - cy.get(".govuk-tag").eq(1).should("have.class", "govuk-tag--green"); - cy.get(".govuk-tag").eq(2).should("have.class", "govuk-tag--red"); - cy.get(".govuk-tag").eq(3).should("have.class", "govuk-tag--red"); - cy.get(".govuk-tag").eq(4).should("have.class", "govuk-tag--red"); - }) - - it("Clicking the print button brings up the print dialog", () => { - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22no%22%7D%7D'); - cy.visit("/qualifications/qualification-details/eyq-240"); - - var printStub; - - cy.window().then(win => { - printStub = cy.stub(win, 'print') - }) - - cy.get("#print-button").click(); - cy.window().then(win => { - expect(printStub).to.be.calledOnce - }) - }); - - it("When the user selects a qualification that is above a level 2, started between Sept 2014 and Aug 2019, and is not full and relevant with no questions, they see the level 2 qualification markes as 'Further action required'", () => { - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%226%2F2016%22%2C%22LevelOfQualification%22%3A%225%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SelectedAwardingOrganisationNotOnTheList%22%3Afalse%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%7D%2C%22QualificationWasSelectedFromList%22%3A1%7D'); - cy.visit("/qualifications/qualification-details/eyq-114"); - - cy.get("#ratio-Level2-tag").should("contain.text", "Further action required"); - cy.get("#ratio-Level2-additional-info").should("contain.text", "Level 2 further action required text"); - }); - - it("When the user selects a qualification that is above a level 2, started between Sept 2014 and Aug 2019, and is not full and relevant due to their answers, they see the level 2 qualification markes as 'Further action required'", () => { - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%2212%2F2016%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22%22%2C%22SelectedAwardingOrganisationNotOnTheList%22%3Atrue%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22no%22%2C%22Test%20question%202%22%3A%22yes%22%7D%2C%22QualificationWasSelectedFromList%22%3A1%7D'); - cy.visit("/qualifications/qualification-details/eyq-240"); - - cy.get("#ratio-Level2-tag").should("contain.text", "Further action required"); - cy.get("#ratio-Level2-additional-info").should("contain.text", "Level 2 further action required text"); - }); -}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-list-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-list-spec.cy.js deleted file mode 100644 index 2d9e43ebb..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-list-spec.cy.js +++ /dev/null @@ -1,48 +0,0 @@ -describe("A spec used to test the qualification list page", () => { - - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - it("Checks the details are showing on the page", () => { - // Value is '{"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"6/2022","LevelOfQualification":"3","WhatIsTheAwardingOrganisation":"NCFE"}' encoded - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%226%2F2022%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%7D'); - - cy.visit("/qualifications"); - - cy.get("#your-search-header").should("contain.text", "Your search"); - cy.get("#filter-country").should("contain.text", "England"); - cy.get("#filter-start-date").should("contain.text", "June 2022"); - cy.get("#filter-level").should("contain.text", "Level 3"); - cy.get("#filter-org").should("contain.text", "NCFE"); - - cy.get("#heading").should("contain.text", "Test Header"); - cy.get("#found-heading").should("contain.text", "3 qualifications found"); - - cy.get("#pre-search-content").should("contain.text", "Pre search box content"); - cy.get("#post-list-content").should("contain.text", "Link to not on list advice page"); - cy.get("#post-filter-content").should("contain.text", "Post search criteria content"); - - cy.get("#clear-search").should("contain.text", "Clear search"); - cy.get("#no-result-content").should("not.exist"); - }) - - it("Shows the default headings when any level and no awarding organisation selected", () => { - // Value is '{"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"6/2022","LevelOfQualification":"0","WhatIsTheAwardingOrganisation":""}' encoded - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%226%2F2022%22%2C%22LevelOfQualification%22%3A%220%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22%22%7D'); - cy.visit("/qualifications"); - - cy.get("#filter-level").should("contain.text", "Any level"); - cy.get("#filter-org").should("contain.text", "Various awarding organisations"); - }) - - it("Shows the correct no results content when there are no results in the search", () => { - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%226%2F2022%22%2C%22LevelOfQualification%22%3A%220%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22%22%7D'); - - cy.visit("/qualifications"); - - cy.get("#found-heading").should("contain.text", "No qualifications found"); - cy.get("#no-result-content").should("contain.text", "Test no qualifications text"); - }) -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-not-on-list-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-not-on-list-spec.cy.js deleted file mode 100644 index c51482011..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/qualification-not-on-list-spec.cy.js +++ /dev/null @@ -1,57 +0,0 @@ -describe("A spec that tests the qualification not on list page", () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - it("Checks content renders for the level 3 specific qualification not on the list page", () => { - // Encoded cookie value is: {"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"7/2015","LevelOfQualification":"3"} - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%7D'); - cy.visit("/advice/qualification-not-on-the-list"); - - cy.get("#advice-page-heading").should("contain.text", "This is the level 3 page"); - cy.get("#advice-page-body").should("contain.text", "This is the body text"); - - cy.get(".govuk-notification-banner__title").eq(0).should("contain.text", "Banner title"); - cy.get(".govuk-notification-banner__heading").eq(0).should("contain.text", "Feedback banner heading"); - cy.get(".govuk-notification-banner__content").eq(0).should("contain.text", "Banner body text"); - - cy.get(".govuk-notification-banner__title").eq(1).should("contain.text", "Banner title"); - cy.get(".govuk-notification-banner__heading").eq(1).should("contain.text", "Feedback banner heading"); - cy.get(".govuk-notification-banner__content").eq(1).should("contain.text", "Banner body text"); - }) - - it("Checks content renders for the level 4 specific qualification not on the list page", () => { - // Encoded cookie value is: {"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"7/2015","LevelOfQualification":"4"} - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%224%22%7D'); - cy.visit("/advice/qualification-not-on-the-list"); - - cy.get("#advice-page-heading").should("contain.text", "This is the level 4 page"); - cy.get("#advice-page-body").should("contain.text", "This is the body text"); - - cy.get(".govuk-notification-banner__title").eq(0).should("contain.text", "Banner title"); - cy.get(".govuk-notification-banner__heading").eq(0).should("contain.text", "Feedback banner heading"); - cy.get(".govuk-notification-banner__content").eq(0).should("contain.text", "Banner body text"); - - cy.get(".govuk-notification-banner__title").eq(1).should("contain.text", "Banner title"); - cy.get(".govuk-notification-banner__heading").eq(1).should("contain.text", "Feedback banner heading"); - cy.get(".govuk-notification-banner__content").eq(1).should("contain.text", "Banner body text"); - }) - - it("Checks default content renders when no specific qualification not on the list page exists", () => { - // Encoded cookie value is: {"WhereWasQualificationAwarded":"england","WhenWasQualificationStarted":"7/2015","LevelOfQualification":"5"} - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%225%22%7D'); - cy.visit("/advice/qualification-not-on-the-list"); - - cy.get("#advice-page-heading").should("contain.text", "Qualification not on the list"); - cy.get("#advice-page-body").should("contain.text", "Test Advice Page Body"); - - cy.get(".govuk-notification-banner__title").eq(0).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(0).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(0).should("contain.text", "This is the body text"); - - cy.get(".govuk-notification-banner__title").eq(1).should("contain.text", "Test banner title"); - cy.get(".govuk-notification-banner__heading").eq(1).should("contain.text", "Feedback heading"); - cy.get(".govuk-notification-banner__content").eq(1).should("contain.text", "This is the body text"); - }) -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/question-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/question-spec.cy.js deleted file mode 100644 index 90c06d8a9..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/pages/question-spec.cy.js +++ /dev/null @@ -1,394 +0,0 @@ -describe("A spec that tests question pages", () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - - /// Where was the qualification awarded page tests - it("Checks the content on where-was-the-qualification-awarded page", () => { - cy.visit("/questions/where-was-the-qualification-awarded"); - - cy.get("#question").should("contain.text", "Where was the qualification awarded?"); - cy.get("#england").should("exist"); - cy.get("#scotland").should("exist"); - cy.get("#wales").should("exist"); - cy.get("#northern-ireland").should("exist"); - cy.get(".govuk-radios__divider").should("contain.text", "or"); - cy.get("#outside-uk").should("exist"); - }) - - it("Checks additional information on the where-was-the-qualification-awarded page", () => { - cy.visit("/questions/where-was-the-qualification-awarded"); - - cy.get(".govuk-details").should("not.have.attr", "open"); - cy.get(".govuk-details__summary-text").should("contain.text", "This is the additional information header"); - cy.get(".govuk-details__text").should("contain.text", "This is the additional information body"); - - cy.get(".govuk-details__summary-text").click(); - cy.get(".govuk-details").should("have.attr", "open"); - }) - - it("shows an error message when a user doesnt select an option on the where-was-the-qualification-awarded page", () => { - cy.visit("/questions/where-was-the-qualification-awarded"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#option-error").should("not.exist"); - cy.get(".govuk-form-group").should("not.have.class", "govuk-form-group--error"); - - cy.get('button[id="question-submit"]').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq("/questions/where-was-the-qualification-awarded"); - }) - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There is a problem"); - cy.get("#error-banner-link").should("contain.text", "Test error banner link text"); - - cy.get('#option-error').should("exist"); - cy.get('#option-error').should("contain.text", "Test error message"); - cy.get(".govuk-form-group").should("have.class", "govuk-form-group--error"); - }) - - /// When was the qualification awarded page tests - it("Checks the content on when-was-the-qualification-started page", () => { - cy.visit("/questions/when-was-the-qualification-started"); - - cy.get("#question").should("contain.text", "Test Date Question"); - - cy.get("#date-started-month").should("exist"); - cy.get("#date-started-year").should("exist"); - }) - - it("Checks additional information on the when-was-the-qualification-started page", () => { - cy.visit("/questions/when-was-the-qualification-started"); - - cy.get(".govuk-details").should("not.have.attr", "open"); - cy.get(".govuk-details__summary-text").should("contain.text", "This is the additional information header"); - cy.get(".govuk-details__text").should("contain.text", "This is the additional information body"); - - cy.get(".govuk-details__summary-text").click(); - cy.get(".govuk-details").should("have.attr", "open"); - }) - - it("shows the month and year missing error message when a user doesnt type a date on the when-was-the-qualification-started page", () => { - cy.visit("/questions/when-was-the-qualification-started"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#date-error").should("not.exist"); - cy.get(".govuk-form-group").should("not.have.class", "govuk-form-group--error"); - - cy.get('button[id="question-submit"]').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq("/questions/when-was-the-qualification-started"); - }) - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There is a problem"); - cy.get("#error-banner-link").should("contain.text", "Test error banner link text"); - - cy.get('#date-error').should("exist"); - cy.get('#date-error').should("contain.text", "Test Error Message"); - cy.get(".govuk-form-group").should("have.class", "govuk-form-group--error"); - cy.get("#date-started-month").should("have.class", "govuk-input--error"); - cy.get("#date-started-year").should("have.class", "govuk-input--error"); - }) - - it("shows the month missing error message when a user doesnt type a month on the when-was-the-qualification-started page", () => { - cy.visit("/questions/when-was-the-qualification-started"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#date-error").should("not.exist"); - cy.get(".govuk-form-group").should("not.have.class", "govuk-form-group--error"); - - cy.get('#date-started-year').type(2024); - - cy.get('button[id="question-submit"]').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq("/questions/when-was-the-qualification-started"); - }) - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There is a problem"); - cy.get("#error-banner-link").should("contain.text", "Missing Month Banner Link Text"); - - cy.get('#date-error').should("exist"); - cy.get('#date-error').should("contain.text", "Missing Month Error Message"); - cy.get(".govuk-form-group").should("have.class", "govuk-form-group--error"); - cy.get("#date-started-month").should("have.class", "govuk-input--error"); - cy.get("#date-started-year").should("not.have.class", "govuk-input--error"); - }) - - it("shows the year missing error message when a user doesnt type a month on the when-was-the-qualification-started page", () => { - cy.visit("/questions/when-was-the-qualification-started"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#date-error").should("not.exist"); - cy.get(".govuk-form-group").should("not.have.class", "govuk-form-group--error"); - - cy.get('#date-started-month').type(10); - - cy.get('button[id="question-submit"]').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq("/questions/when-was-the-qualification-started"); - }) - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There is a problem"); - cy.get("#error-banner-link").should("contain.text", "Missing Year Banner Link Text"); - - cy.get('#date-error').should("exist"); - cy.get('#date-error').should("contain.text", "Missing Year Error Message"); - cy.get(".govuk-form-group").should("have.class", "govuk-form-group--error"); - cy.get("#date-started-month").should("not.have.class", "govuk-input--error"); - cy.get("#date-started-year").should("have.class", "govuk-input--error"); - }) - - describe("When the month selected on the when-was-the-qualification-started page ", () => { - - const invalidMonthsToTest = [ - 0, - -1, - 13, - 99 - ] - - invalidMonthsToTest.forEach((value) => { - it(`is ${value} then it shows the month out of bounds error message`, () => { - cy.visit("/questions/when-was-the-qualification-started"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#date-error").should("not.exist"); - cy.get(".govuk-form-group").should("not.have.class", "govuk-form-group--error"); - - cy.get('#date-started-month').type(value); - cy.get('#date-started-year').type(2024); - - cy.get('button[id="question-submit"]').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq("/questions/when-was-the-qualification-started"); - }) - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There is a problem"); - cy.get("#error-banner-link").should("contain.text", "Month Out Of Bounds Error Link Text"); - - cy.get('#date-error').should("exist"); - cy.get('#date-error').should("contain.text", "Month Out Of Bounds Error Message"); - cy.get(".govuk-form-group").should("have.class", "govuk-form-group--error"); - cy.get("#date-started-month").should("have.class", "govuk-input--error"); - cy.get("#date-started-year").should("not.have.class", "govuk-input--error"); - }) - }) - }) - - describe("When the year selected on the when-was-the-qualification-started page ", () => { - - var invalidYearsToTest = [ - 0, - 1899, - 3000 - ] - - invalidYearsToTest.forEach((value) => { - it(`is ${value} then it shows the incorrect year format error message`, () => { - cy.visit("/questions/when-was-the-qualification-started"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#date-error").should("not.exist"); - cy.get(".govuk-form-group").should("not.have.class", "govuk-form-group--error"); - - cy.get('#date-started-month').type(1); - cy.get('#date-started-year').type(value); - - cy.get('button[id="question-submit"]').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq("/questions/when-was-the-qualification-started"); - }) - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There is a problem"); - cy.get("#error-banner-link").should("contain.text", "Year Out Of Bounds Error Link Text"); - - cy.get('#date-error').should("exist"); - cy.get('#date-error').should("contain.text", "Year Out Of Bounds Error Message"); - cy.get(".govuk-form-group").should("have.class", "govuk-form-group--error"); - cy.get("#date-started-month").should("not.have.class", "govuk-input--error"); - cy.get("#date-started-year").should("have.class", "govuk-input--error"); - }) - }) - }) - - it("shows the month out of bound error message and the year out of bounds error message when a user types an invalid month and year on the when-was-the-qualification-started page", () => { - cy.visit("/questions/when-was-the-qualification-started"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#date-error").should("not.exist"); - cy.get(".govuk-form-group").should("not.have.class", "govuk-form-group--error"); - - cy.get('#date-started-month').type(0); - cy.get('#date-started-year').type(20); - - cy.get('button[id="question-submit"]').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq("/questions/when-was-the-qualification-started"); - }) - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There is a problem"); - - cy.get("#error-banner-link").should("contain.text", "Month Out Of Bounds Error Link TextYear Out Of Bounds Error Link Text"); - - cy.get('#date-error').should("exist"); - cy.get('#date-error').should("contain.text", "Month Out Of Bounds Error MessageYear Out Of Bounds Error Message"); - cy.get(".govuk-form-group").should("have.class", "govuk-form-group--error"); - cy.get("#date-started-month").should("have.class", "govuk-input--error"); - cy.get("#date-started-year").should("have.class", "govuk-input--error"); - }) - - it("shows the month out of bound error message and the year missing error message when a user types an invalid month and doesnt type a year on the when-was-the-qualification-started page", () => { - cy.visit("/questions/when-was-the-qualification-started"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#date-error").should("not.exist"); - cy.get(".govuk-form-group").should("not.have.class", "govuk-form-group--error"); - - cy.get('#date-started-month').type(0); - - cy.get('button[id="question-submit"]').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq("/questions/when-was-the-qualification-started"); - }) - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There is a problem"); - - cy.get("#error-banner-link").should("contain.text", "Month Out Of Bounds Error Link TextMissing Year Banner Link Text"); - - cy.get('#date-error').should("exist"); - cy.get('#date-error').should("contain.text", "Month Out Of Bounds Error MessageMissing Year Error Message"); - cy.get(".govuk-form-group").should("have.class", "govuk-form-group--error"); - cy.get("#date-started-month").should("have.class", "govuk-input--error"); - cy.get("#date-started-year").should("have.class", "govuk-input--error"); - }) - - it("shows the month missing error message and the year out of bounds error message when a user doesnt type a year and types an invalid month on the when-was-the-qualification-started page", () => { - cy.visit("/questions/when-was-the-qualification-started"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#date-error").should("not.exist"); - cy.get(".govuk-form-group").should("not.have.class", "govuk-form-group--error"); - - cy.get('#date-started-year').type(20); - - cy.get('button[id="question-submit"]').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq("/questions/when-was-the-qualification-started"); - }) - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There is a problem"); - - cy.get("#error-banner-link").should("contain.text", "Missing Month Banner Link TextYear Out Of Bounds Error Link Text"); - - cy.get('#date-error').should("exist"); - cy.get('#date-error').should("contain.text", "Missing Month Error MessageYear Out Of Bounds Error Message"); - cy.get(".govuk-form-group").should("have.class", "govuk-form-group--error"); - cy.get("#date-started-month").should("have.class", "govuk-input--error"); - cy.get("#date-started-year").should("have.class", "govuk-input--error"); - }) - - /// What level is the qualification page - it("Checks the content on what-level-is-the-qualification page", () => { - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D'); - cy.visit("/questions/what-level-is-the-qualification"); - - cy.get("#question").should("contain.text", "What level is the qualification?"); - cy.get("#2").should("exist"); - cy.get("#3").should("exist"); - cy.get("#6").should("exist"); - cy.get("#6_hint").should("exist"); - cy.get("#6_hint").should("contain.text", "Some hint text"); - cy.get("#7").should("exist"); - }) - - it("Checks additional information on the what-level-is-the-qualification page", () => { - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D'); - cy.visit("/questions/what-level-is-the-qualification"); - - cy.get(".govuk-details").should("not.have.attr", "open"); - cy.get(".govuk-details__summary-text").should("contain.text", "This is the additional information header"); - cy.get(".govuk-details__text").should("contain.text", "This is the additional information body"); - - cy.get(".govuk-details__summary-text").click(); - cy.get(".govuk-details").should("have.attr", "open"); - }) - - it("shows an error message when a user doesnt select an option on the what-level-is-the-qualification page", () => { - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D'); - cy.visit("/questions/what-level-is-the-qualification"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#option-error").should("not.exist"); - cy.get(".govuk-form-group").should("not.have.class", "govuk-form-group--error"); - - cy.get('button[id="question-submit"]').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq("/questions/what-level-is-the-qualification"); - }) - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There is a problem"); - cy.get("#error-banner-link").should("contain.text", "Test error banner link text"); - - cy.get('#option-error').should("exist"); - cy.get('#option-error').should("contain.text", "Test error message"); - cy.get(".govuk-form-group").should("have.class", "govuk-form-group--error"); - }) - - /// What is the awarding organisation page - it("Checks the content on what-is-the-awarding-organisation page", () => { - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D'); - cy.visit("/questions/what-is-the-awarding-organisation"); - - cy.get("#question").should("contain.text", "Test Dropdown Question"); - cy.get("#awarding-organisation-select").should("exist"); - cy.get("#awarding-organisation-not-in-list").should("exist"); - cy.get('button[id="question-submit"]').should("exist"); - }) - - it("Checks additional information on the what-is-the-awarding-organisation page", () => { - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D'); - cy.visit("/questions/what-is-the-awarding-organisation"); - - cy.get(".govuk-details").should("not.have.attr", "open"); - cy.get(".govuk-details__summary-text").should("contain.text", "This is the additional information header"); - cy.get(".govuk-details__text").should("contain.text", "This is the additional information body"); - - cy.get(".govuk-details__summary-text").click(); - cy.get(".govuk-details").should("have.attr", "open"); - }) - - it("shows an error message when a user doesnt select an option from the dropdown list" + - "and also does not check 'not in the list' on the what-is-the-awarding-organisation", () => { - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D'); - cy.visit("/questions/what-is-the-awarding-organisation"); - - cy.get(".govuk-error-summary").should("not.exist"); - cy.get("#dropdown-error").should("not.exist"); - cy.get("#awarding-organisation-select").should("not.have.class", "govuk-select--error"); - - cy.get('button[id="question-submit"]').click(); - cy.location().should((loc) => { - expect(loc.pathname).to.eq("/questions/what-is-the-awarding-organisation"); - }) - - cy.get(".govuk-error-summary").should("be.visible"); - cy.get(".govuk-error-summary__title").should("contain.text", "There is a problem"); - cy.get("#error-banner-link").should("contain.text", "Test error banner link text"); - - cy.get('#dropdown-error').should("exist"); - cy.get('#dropdown-error').should("contain.text", "Test Error Message"); - cy.get("#awarding-organisation-select").should("have.class", "govuk-select--error"); - }) -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/shared/cookies-banner-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/shared/cookies-banner-spec.cy.js deleted file mode 100644 index 5ea37c5ae..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/shared/cookies-banner-spec.cy.js +++ /dev/null @@ -1,100 +0,0 @@ -import { pages } from "./urls-to-check"; - -describe("A spec that tests that the cookies banner shows on all pages", () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - pages.forEach((option) => { - it(`Checks that the cookies banner is present at the URL: ${option}`, () => { - - cy.visit(option); - - cy.get("#choose-cookies-preference").should("be.visible"); - cy.get("#cookies-preference-chosen").should("not.exist"); - - cy.get(".govuk-cookie-banner__heading").should("contain.text", "Test Cookies Banner Title"); - cy.get(".govuk-cookie-banner__content").should("contain.text", "This is the cookies banner content"); - }); - - it(`Accepting the cookies shows the accept message at the URL: ${option}, then clicking to hide the banner should hide the banner`, () => { - cy.visit(option); - - cy.get('button[id="accept-cookies-button"]').click(); - - cy.get("#choose-cookies-preference").should("not.exist"); - cy.get("#cookies-preference-chosen").should("be.visible"); - - cy.getCookie('cookies_preferences_set') - .should('have.property', 'value', "%7B%22HasApproved%22%3Atrue%2C%22IsVisible%22%3Atrue%2C%22IsRejected%22%3Afalse%7D"); - - cy.get("#cookies-banner-pref-chosen-content").should("contain.text", "This is the accepted cookie content"); - - cy.get('button[id="hide-cookie-banner-button"]').click(); - - cy.get("#choose-cookies-preference").should("not.exist"); - cy.get("#cookies-preference-chosen").should("not.exist"); - - cy.getCookie('cookies_preferences_set') - .should('have.property', 'value', "%7B%22HasApproved%22%3Atrue%2C%22IsVisible%22%3Afalse%2C%22IsRejected%22%3Afalse%7D"); - }); - - it(`Rejecting the cookies shows the reject message at the URL: ${option}, then clicking to hide the banner should hide the banner`, () => { - cy.visit(option); - - cy.get('button[id="reject-cookies-button"]').click(); - - cy.get("#choose-cookies-preference").should("not.exist"); - cy.get("#cookies-preference-chosen").should("be.visible"); - - cy.getCookie('cookies_preferences_set') - .should('have.property', 'value', "%7B%22HasApproved%22%3Afalse%2C%22IsVisible%22%3Atrue%2C%22IsRejected%22%3Atrue%7D"); - - cy.get("#cookies-banner-pref-chosen-content").should("contain.text", "This is the rejected cookie content"); - - cy.get('button[id="hide-cookie-banner-button"]').click(); - - cy.get("#choose-cookies-preference").should("not.exist"); - cy.get("#cookies-preference-chosen").should("not.exist"); - - cy.getCookie('cookies_preferences_set') - .should('have.property', 'value', "%7B%22HasApproved%22%3Afalse%2C%22IsVisible%22%3Afalse%2C%22IsRejected%22%3Atrue%7D"); - }); - }); - - const badUrls = [ - 'some-url', - 'https://google.co.uk' - ]; - - badUrls.forEach((url) => { - it(`Manually changing the redirect Url value to ${url} invalid redirects to the cookies page on action`, () => { - cy.visit("/"); - - cy.get("#returnUrl").then(elem => { - elem.val(url); - }); - - cy.get('button[id="accept-cookies-button"]').click(); - - cy.url().should('include', '/cookies'); - }); - }); - - const urlsNotToShowBanner = [ - '/challenge', - '/Challenge', - '/challenge/post', - '/Challenge/Post' - ]; - - urlsNotToShowBanner.forEach((url) => { - it(`Does not show the cookie banner on the ${url} view`, () => { - cy.visit("/challenge"); - - cy.get("#choose-cookies-preference").should("not.exist"); - cy.get("#cookies-preference-chosen").should("not.exist"); - }); - }); -}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/shared/phase-banner-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/shared/phase-banner-spec.cy.js deleted file mode 100644 index 3e5742013..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/shared/phase-banner-spec.cy.js +++ /dev/null @@ -1,22 +0,0 @@ -import { pages } from "./urls-to-check"; - -describe("A spec that tests the phase banner is showing on all pages", () => { - - // Mock details found in Dfe.EarlyYearsQualification.Mock.Content.MockContentfulService. - - pages.forEach((option) => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - it(`Checks that the phase banner is present at the URL: ${option}`, () => { - - cy.visit(option); - - cy.get(".govuk-phase-banner").should("be.visible"); - - cy.get(".govuk-phase-banner__content__tag").should("contain.text", "Test phase banner name"); - cy.get(".govuk-phase-banner__text").should("contain.text", "Some Text"); - }); - }); -}) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/shared/security-header-spec.cy.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/shared/security-header-spec.cy.js deleted file mode 100644 index c1f178be0..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/shared/security-header-spec.cy.js +++ /dev/null @@ -1,203 +0,0 @@ -import { pagesWithForms, pagesWithoutFormsOrRedirects, pagesWithoutFormsWithRedirects } from "./urls-to-check"; - -describe("A spec that checks for security headers in the response", () => { - beforeEach(() => { - cy.setCookie('auth-secret', Cypress.env('auth_secret')); - }) - - pagesWithForms.forEach((page) => { - it(`pages with forms and no cookie banner - ${page} contains the expected response headers`, () => { - - // Set cookie preference to hide banner - cy.setCookie( - "cookies_preferences_set", - "%7B%22HasApproved%22%3Atrue%2C%22IsVisible%22%3Afalse%2C%22IsRejected%22%3Afalse%7D" - ); - - cy.request("GET", page).then((response) => { - expect(response.headers).to.have.property( - "cache-control", - "no-store,no-cache" - ); - expect(response.headers).to.have.property( - "content-security-policy", - "script-src 'self' 'sha256-2eCA8tPChvVMeSRvRNqlmBco1wRmAKXWVzJ8Vpb9S6Y=' 'sha256-VAoCuOmBv4C4V/WthoGzlhYyYpWir44ETG7WKh+3kG8=' 'sha256-Om9RNNoMrdmIZzT4Oo7KaozVNUg6zYxVQuq3CPld2Ms=' 'unsafe-hashes' 'sha256-GUQ5ad8JK5KmEWmROf3LZd9ge94daqNvd8xy9YS1iDw=' 'sha256-l5MP+9OapFXGxjKMNj/89ExAW2TvAFFoADrbsmtSJXo=' 'sha256-lD2YLKoqlgPJ6bMRB0gZKeUdZqwszfrRSmAnzX0TSls=' 'sha256-1f+6vEGZewP7dkvrYIBD4bqMLOhumfg10mwfKd2jU7I=' 'sha256-LBWtLNxa0f5+6KBUNLCp8JXVP7YuPtJtEt1Ku3cCKdY=' https://www.googletagmanager.com/gtm.js https://www.googletagmanager.com/gtag/js https://www.clarity.ms/ https://c.bing.com;object-src 'self';frame-ancestors https://app.contentful.com;connect-src *.google-analytics.com https://*.clarity.ms/collect;block-all-mixed-content;upgrade-insecure-requests;" - ); - expect(response.headers).to.have.property( - "cross-origin-resource-policy", - "same-origin" - ); - expect(response.headers).to.have.property( - "referrer-policy", - "no-referrer" - ); - expect(response.headers).to.have.property( - "strict-transport-security", - "max-age=31536000;includeSubDomains" - ); - expect(response.headers).to.have.property( - "x-content-type-options", - "nosniff" - ); - expect(response.headers).to.have.property("x-frame-options", "deny"); - expect(response.headers).to.have.property("x-xss-protection", "0"); - expect(response.headers).not.to.have.property("server"); - }); - }); - }); - - pagesWithoutFormsOrRedirects.forEach((page) => { - it(`pages without forms that will not redirect if no date - no cookie banner - ${page} contains the expected response headers`, () => { - - // Set cookie preference to hide banner - cy.setCookie( - "cookies_preferences_set", - "%7B%22HasApproved%22%3Atrue%2C%22IsVisible%22%3Afalse%2C%22IsRejected%22%3Afalse%7D" - ); - - cy.request("GET", page).then((response) => { - expect(response.headers).to.have.property( - "cache-control", - "no-store,no-cache" - ); - expect(response.headers).to.have.property( - "content-security-policy", - "script-src 'self' 'sha256-2eCA8tPChvVMeSRvRNqlmBco1wRmAKXWVzJ8Vpb9S6Y=' 'sha256-VAoCuOmBv4C4V/WthoGzlhYyYpWir44ETG7WKh+3kG8=' 'sha256-Om9RNNoMrdmIZzT4Oo7KaozVNUg6zYxVQuq3CPld2Ms=' 'unsafe-hashes' 'sha256-GUQ5ad8JK5KmEWmROf3LZd9ge94daqNvd8xy9YS1iDw=' 'sha256-l5MP+9OapFXGxjKMNj/89ExAW2TvAFFoADrbsmtSJXo=' 'sha256-lD2YLKoqlgPJ6bMRB0gZKeUdZqwszfrRSmAnzX0TSls=' 'sha256-1f+6vEGZewP7dkvrYIBD4bqMLOhumfg10mwfKd2jU7I=' 'sha256-LBWtLNxa0f5+6KBUNLCp8JXVP7YuPtJtEt1Ku3cCKdY=' https://www.googletagmanager.com/gtm.js https://www.googletagmanager.com/gtag/js https://www.clarity.ms/ https://c.bing.com;object-src 'self';frame-ancestors https://app.contentful.com;connect-src *.google-analytics.com https://*.clarity.ms/collect;block-all-mixed-content;upgrade-insecure-requests;" - ); - expect(response.headers).to.have.property( - "cross-origin-resource-policy", - "same-origin" - ); - expect(response.headers).to.have.property( - "referrer-policy", - "no-referrer" - ); - expect(response.headers).to.have.property( - "strict-transport-security", - "max-age=31536000;includeSubDomains" - ); - expect(response.headers).to.have.property( - "x-content-type-options", - "nosniff" - ); - expect(response.headers).to.have.property("x-frame-options", "deny"); - expect(response.headers).to.have.property("x-xss-protection", "0"); - expect(response.headers).not.to.have.property("server"); - }); - }); - }); - - pagesWithoutFormsOrRedirects.forEach((page) => { - it(`pages without forms that will not redirect if no date - cookie banner showing - ${page} contains the expected response headers`, () => { - cy.request("GET", page).then((response) => { - expect(response.headers).to.have.property( - "cache-control", - "no-store,no-cache" - ); - expect(response.headers).to.have.property( - "content-security-policy", - "script-src 'self' 'sha256-2eCA8tPChvVMeSRvRNqlmBco1wRmAKXWVzJ8Vpb9S6Y=' 'sha256-VAoCuOmBv4C4V/WthoGzlhYyYpWir44ETG7WKh+3kG8=' 'sha256-Om9RNNoMrdmIZzT4Oo7KaozVNUg6zYxVQuq3CPld2Ms=' 'unsafe-hashes' 'sha256-GUQ5ad8JK5KmEWmROf3LZd9ge94daqNvd8xy9YS1iDw=' 'sha256-l5MP+9OapFXGxjKMNj/89ExAW2TvAFFoADrbsmtSJXo=' 'sha256-lD2YLKoqlgPJ6bMRB0gZKeUdZqwszfrRSmAnzX0TSls=' 'sha256-1f+6vEGZewP7dkvrYIBD4bqMLOhumfg10mwfKd2jU7I=' 'sha256-LBWtLNxa0f5+6KBUNLCp8JXVP7YuPtJtEt1Ku3cCKdY=' https://www.googletagmanager.com/gtm.js https://www.googletagmanager.com/gtag/js https://www.clarity.ms/ https://c.bing.com;object-src 'self';frame-ancestors https://app.contentful.com;connect-src *.google-analytics.com https://*.clarity.ms/collect;block-all-mixed-content;upgrade-insecure-requests;" - ); - expect(response.headers).to.have.property( - "cross-origin-resource-policy", - "same-origin" - ); - expect(response.headers).to.have.property( - "referrer-policy", - "no-referrer" - ); - expect(response.headers).to.have.property( - "strict-transport-security", - "max-age=31536000;includeSubDomains" - ); - expect(response.headers).to.have.property( - "x-content-type-options", - "nosniff" - ); - expect(response.headers).to.have.property("x-frame-options", "deny"); - expect(response.headers).to.have.property("x-xss-protection", "0"); - expect(response.headers).not.to.have.property("server"); - }); - }); - }); - - pagesWithoutFormsWithRedirects.forEach((page) => { - it(`pages without forms that will redirect if no date - no cookie banner - ${page} contains the expected response headers`, () => { - - cy.setCookie('user_journey', '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22yes%22%7D%7D'); - - // Set cookie preference to hide banner - cy.setCookie( - "cookies_preferences_set", - "%7B%22HasApproved%22%3Atrue%2C%22IsVisible%22%3Afalse%2C%22IsRejected%22%3Afalse%7D" - ); - - cy.request("GET", page).then((response) => { - expect(response.headers).to.have.property( - "cache-control", - "no-store,no-cache" - ); - expect(response.headers).to.have.property( - "content-security-policy", - "script-src 'self' 'sha256-2eCA8tPChvVMeSRvRNqlmBco1wRmAKXWVzJ8Vpb9S6Y=' 'sha256-VAoCuOmBv4C4V/WthoGzlhYyYpWir44ETG7WKh+3kG8=' 'sha256-Om9RNNoMrdmIZzT4Oo7KaozVNUg6zYxVQuq3CPld2Ms=' 'unsafe-hashes' 'sha256-GUQ5ad8JK5KmEWmROf3LZd9ge94daqNvd8xy9YS1iDw=' 'sha256-l5MP+9OapFXGxjKMNj/89ExAW2TvAFFoADrbsmtSJXo=' 'sha256-lD2YLKoqlgPJ6bMRB0gZKeUdZqwszfrRSmAnzX0TSls=' 'sha256-1f+6vEGZewP7dkvrYIBD4bqMLOhumfg10mwfKd2jU7I=' 'sha256-LBWtLNxa0f5+6KBUNLCp8JXVP7YuPtJtEt1Ku3cCKdY=' https://www.googletagmanager.com/gtm.js https://www.googletagmanager.com/gtag/js https://www.clarity.ms/ https://c.bing.com;object-src 'self';frame-ancestors https://app.contentful.com;connect-src *.google-analytics.com https://*.clarity.ms/collect;block-all-mixed-content;upgrade-insecure-requests;" - ); - expect(response.headers).to.have.property( - "cross-origin-resource-policy", - "same-origin" - ); - expect(response.headers).to.have.property( - "referrer-policy", - "no-referrer" - ); - expect(response.headers).to.have.property( - "strict-transport-security", - "max-age=31536000;includeSubDomains" - ); - expect(response.headers).to.have.property( - "x-content-type-options", - "nosniff" - ); - expect(response.headers).to.have.property("x-frame-options", "deny"); - expect(response.headers).to.have.property("x-xss-protection", "0"); - expect(response.headers).not.to.have.property("server"); - }); - }); - }); - - pagesWithoutFormsWithRedirects.forEach((page) => { - it(`pages without forms that will redirect if no date - cookie banner showing - ${page} contains the expected response headers`, () => { - - cy.setCookie('user_journey', '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D'); - - cy.request("GET", page).then((response) => { - expect(response.headers).to.have.property( - "cache-control", - "no-store,no-cache" - ); - expect(response.headers).to.have.property( - "content-security-policy", - "script-src 'self' 'sha256-2eCA8tPChvVMeSRvRNqlmBco1wRmAKXWVzJ8Vpb9S6Y=' 'sha256-VAoCuOmBv4C4V/WthoGzlhYyYpWir44ETG7WKh+3kG8=' 'sha256-Om9RNNoMrdmIZzT4Oo7KaozVNUg6zYxVQuq3CPld2Ms=' 'unsafe-hashes' 'sha256-GUQ5ad8JK5KmEWmROf3LZd9ge94daqNvd8xy9YS1iDw=' 'sha256-l5MP+9OapFXGxjKMNj/89ExAW2TvAFFoADrbsmtSJXo=' 'sha256-lD2YLKoqlgPJ6bMRB0gZKeUdZqwszfrRSmAnzX0TSls=' 'sha256-1f+6vEGZewP7dkvrYIBD4bqMLOhumfg10mwfKd2jU7I=' 'sha256-LBWtLNxa0f5+6KBUNLCp8JXVP7YuPtJtEt1Ku3cCKdY=' https://www.googletagmanager.com/gtm.js https://www.googletagmanager.com/gtag/js https://www.clarity.ms/ https://c.bing.com;object-src 'self';frame-ancestors https://app.contentful.com;connect-src *.google-analytics.com https://*.clarity.ms/collect;block-all-mixed-content;upgrade-insecure-requests;" - ); - expect(response.headers).to.have.property( - "cross-origin-resource-policy", - "same-origin" - ); - expect(response.headers).to.have.property( - "referrer-policy", - "no-referrer" - ); - expect(response.headers).to.have.property( - "strict-transport-security", - "max-age=31536000;includeSubDomains" - ); - expect(response.headers).to.have.property( - "x-content-type-options", - "nosniff" - ); - expect(response.headers).to.have.property("x-frame-options", "deny"); - expect(response.headers).to.have.property("x-xss-protection", "0"); - expect(response.headers).not.to.have.property("server"); - }); - }); - }); -}); diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/fixtures/example.json b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/fixtures/example.json deleted file mode 100644 index 02e425437..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/support/commands.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/support/commands.js deleted file mode 100644 index 66ea16ef0..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/support/commands.js +++ /dev/null @@ -1,25 +0,0 @@ -// *********************************************** -// This example commands.js shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/support/e2e.js b/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/support/e2e.js deleted file mode 100644 index 0e7290a13..000000000 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/support/e2e.js +++ /dev/null @@ -1,20 +0,0 @@ -// *********************************************************** -// This example support/e2e.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import './commands' - -// Alternatively you can use CommonJS syntax: -// require('./commands') \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/package-lock.json b/tests/Dfe.EarlyYearsQualification.E2ETests/package-lock.json index c244e6520..ad3b9a042 100644 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/package-lock.json +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/package-lock.json @@ -9,1937 +9,103 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "cypress": "^13.13.3" + "@playwright/test": "^1.49.0", + "@types/node": "^22.10.1", + "dotenv": "^16.4.7" } }, - "node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/@cypress/request": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", - "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", - "dev": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "http-signature": "~1.3.6", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "performance-now": "^2.1.0", - "qs": "6.10.4", - "safe-buffer": "^5.1.2", - "tough-cookie": "^4.1.3", - "tunnel-agent": "^0.6.0", - "uuid": "^8.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@cypress/xvfb": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", - "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", - "dev": true, - "dependencies": { - "debug": "^3.1.0", - "lodash.once": "^4.1.1" - } - }, - "node_modules/@cypress/xvfb/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/@types/node": { - "version": "20.11.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.5.tgz", - "integrity": "sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==", - "dev": true, - "optional": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/@types/sinonjs__fake-timers": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz", - "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", - "dev": true - }, - "node_modules/@types/sizzle": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", - "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", - "dev": true - }, - "node_modules/@types/yauzl": { - "version": "2.10.3", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", - "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", - "dev": true, - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/arch": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", - "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dev": true, - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/async": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", - "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", - "dev": true - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", - "dev": true - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dev": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, - "node_modules/blob-util": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", - "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", - "dev": true - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/cachedir": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", - "integrity": "sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/call-bind": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", - "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chalk/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/check-more-types": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", - "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "dependencies": { - "restore-cursor": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cli-table3": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", - "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0" - }, - "engines": { - "node": "10.* || >= 12.*" - }, - "optionalDependencies": { - "@colors/colors": "1.5.0" - } - }, - "node_modules/cli-truncate": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", - "dev": true, - "dependencies": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/common-tags": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", - "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/cypress": { - "version": "13.13.3", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.13.3.tgz", - "integrity": "sha512-hUxPrdbJXhUOTzuML+y9Av7CKoYznbD83pt8g3klgpioEha0emfx4WNIuVRx0C76r0xV2MIwAW9WYiXfVJYFQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "@cypress/request": "^3.0.1", - "@cypress/xvfb": "^1.2.4", - "@types/sinonjs__fake-timers": "8.1.1", - "@types/sizzle": "^2.3.2", - "arch": "^2.2.0", - "blob-util": "^2.0.2", - "bluebird": "^3.7.2", - "buffer": "^5.7.1", - "cachedir": "^2.3.0", - "chalk": "^4.1.0", - "check-more-types": "^2.24.0", - "cli-cursor": "^3.1.0", - "cli-table3": "~0.6.1", - "commander": "^6.2.1", - "common-tags": "^1.8.0", - "dayjs": "^1.10.4", - "debug": "^4.3.4", - "enquirer": "^2.3.6", - "eventemitter2": "6.4.7", - "execa": "4.1.0", - "executable": "^4.1.1", - "extract-zip": "2.0.1", - "figures": "^3.2.0", - "fs-extra": "^9.1.0", - "getos": "^3.2.1", - "is-ci": "^3.0.1", - "is-installed-globally": "~0.4.0", - "lazy-ass": "^1.6.0", - "listr2": "^3.8.3", - "lodash": "^4.17.21", - "log-symbols": "^4.0.0", - "minimist": "^1.2.8", - "ospath": "^1.2.2", - "pretty-bytes": "^5.6.0", - "process": "^0.11.10", - "proxy-from-env": "1.0.0", - "request-progress": "^3.0.0", - "semver": "^7.5.3", - "supports-color": "^8.1.1", - "tmp": "~0.2.3", - "untildify": "^4.0.0", - "yauzl": "^2.10.0" - }, - "bin": { - "cypress": "bin/cypress" - }, - "engines": { - "node": "^16.0.0 || ^18.0.0 || >=20.0.0" - } - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/dayjs": { - "version": "1.11.10", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", - "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==", - "dev": true - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/define-data-property": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", - "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "dev": true, - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/enquirer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", - "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/eventemitter2": { - "version": "6.4.7", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", - "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", - "dev": true - }, - "node_modules/execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/executable": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", - "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", - "dev": true, - "dependencies": { - "pify": "^2.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "node_modules/extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "bin": { - "extract-zip": "cli.js" - }, - "engines": { - "node": ">= 10.17.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" - } - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "dev": true, - "engines": [ - "node >=0.6.0" - ] - }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, - "dependencies": { - "pend": "~1.2.0" - } - }, - "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", - "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/getos": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", - "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", - "dev": true, - "dependencies": { - "async": "^3.2.0" - } - }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - } - }, - "node_modules/global-dirs": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", - "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", - "dev": true, - "dependencies": { - "ini": "2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", - "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-signature": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.3.6.tgz", - "integrity": "sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^2.0.2", - "sshpk": "^1.14.1" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", - "dev": true, - "engines": { - "node": ">=8.12.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-installed-globally": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", - "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", - "dev": true, - "dependencies": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true - }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true - }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/jsprim": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz", - "integrity": "sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - } - }, - "node_modules/lazy-ass": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", - "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", - "dev": true, - "engines": { - "node": "> 0.8" - } - }, - "node_modules/listr2": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", - "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", - "dev": true, - "dependencies": { - "cli-truncate": "^2.1.0", - "colorette": "^2.0.16", - "log-update": "^4.0.0", - "p-map": "^4.0.0", - "rfdc": "^1.3.0", - "rxjs": "^7.5.1", - "through": "^2.3.8", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "enquirer": ">= 2.3.0 < 3" - }, - "peerDependenciesMeta": { - "enquirer": { - "optional": true - } - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "dev": true - }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-update": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", - "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", - "dev": true, - "dependencies": { - "ansi-escapes": "^4.3.0", - "cli-cursor": "^3.1.0", - "slice-ansi": "^4.0.0", - "wrap-ansi": "^6.2.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-update/node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/log-update/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ospath": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", - "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", - "dev": true - }, - "node_modules/p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dev": true, - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true - }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pretty-bytes": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", - "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/proxy-from-env": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", - "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", - "dev": true - }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/qs": { - "version": "6.10.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.4.tgz", - "integrity": "sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true - }, - "node_modules/request-progress": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", - "integrity": "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==", - "dev": true, - "dependencies": { - "throttleit": "^1.0.0" - } - }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, - "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/rfdc": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", - "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", - "dev": true - }, - "node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dev": true, - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/set-function-length": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.0.tgz", - "integrity": "sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.1", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.2", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, - "node_modules/slice-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/sshpk": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "node_modules/@playwright/test": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.49.0.tgz", + "integrity": "sha512-DMulbwQURa8rNIQrf94+jPJQ4FmOVdpE5ZppRNvWVjvhC+6sOeo28r8MgIpQRYouXRtt/FCCXU7zn20jnHR4Qw==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" + "playwright": "1.49.0" }, "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "playwright": "cli.js" }, "engines": { - "node": ">=8" + "node": ">=18" } }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/@types/node": { + "version": "22.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", + "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, - "engines": { - "node": ">=6" + "undici-types": "~6.20.0" } }, - "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, + "license": "BSD-2-Clause", "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/throttleit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", - "integrity": "sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://dotenvx.com" } }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true - }, - "node_modules/tmp": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", - "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, + "hasInstallScript": true, "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14.14" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "node_modules/playwright": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.0.tgz", + "integrity": "sha512-eKpmys0UFDnfNb3vfsf8Vx2LEOtflgRebl0Im2eQQnYMA4Aqd+Zw8bEOB+7ZKvN76901mRnqdsiOGKxzVTbi7A==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" + "playwright-core": "1.49.0" }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tough-cookie/node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.0.1" + "bin": { + "playwright": "cli.js" }, "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true - }, - "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "engines": { - "node": ">=10" + "node": ">=18" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true, - "optional": true - }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/untildify": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", - "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" + "optionalDependencies": { + "fsevents": "2.3.2" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "node_modules/playwright-core": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.0.tgz", + "integrity": "sha512-R+3KKTQF3npy5GTiKH/T+kdhoJfJojjHESR1YEWhYuEKRVfVaxH3+4+GvXE5xyCngCxhxnykk0Vlah9v8fs3jA==", "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, + "license": "Apache-2.0", "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "playwright-core": "cli.js" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "node": ">=18" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true, - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } + "license": "MIT" } } } diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/package.json b/tests/Dfe.EarlyYearsQualification.E2ETests/package.json index e9c3d8b7d..0a84a4ac1 100644 --- a/tests/Dfe.EarlyYearsQualification.E2ETests/package.json +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/package.json @@ -1,16 +1,15 @@ { "name": "dfe.earlyyearsqualification.e2etests", "version": "1.0.0", - "description": "", "main": "index.js", - "scripts": { - "cypress:open": "cypress open", - "test": "cypress run", - "test:specific": "cypress run --spec 'cypress/e2e/pages/qualification-details-spec.cy.js'" - }, + "scripts": {}, + "keywords": [], "author": "", "license": "ISC", + "description": "", "devDependencies": { - "cypress": "^13.13.3" + "@playwright/test": "^1.49.0", + "@types/node": "^22.10.1", + "dotenv": "^16.4.7" } } diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/playwright.config.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/playwright.config.ts new file mode 100644 index 000000000..95ae29917 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/playwright.config.ts @@ -0,0 +1,81 @@ +import {defineConfig, devices} from '@playwright/test'; + +/** + * Read environment variables from file. + * https://github.com/motdotla/dotenv + */ +// import dotenv from 'dotenv'; +// import path from 'path'; +// dotenv.config({ path: path.resolve(__dirname, '.env') }); + +/** + * See https://playwright.dev/docs/test-configuration. + */ +require('dotenv').config(); + +export default defineConfig({ + testDir: './tests', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: 'html', + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL: process.env.WEBAPP_URL, + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', + + ignoreHTTPSErrors: true, + }, + /* Configure projects for major browsers */ + projects: [ + { + name: 'chromium', + use: {...devices['Desktop Chrome']}, + }, + { + name: 'firefox', + use: {...devices['Desktop Firefox']}, + }, + /* + { + name: 'webkit', + use: {...devices['Desktop Safari']}, + }, + */ + /* Test against mobile viewports. */ + // { + // name: 'Mobile Chrome', + // use: { ...devices['Pixel 5'] }, + // }, + // { + // name: 'Mobile Safari', + // use: { ...devices['iPhone 12'] }, + // }, + + /* Test against branded browsers. */ + // { + // name: 'Microsoft Edge', + // use: { ...devices['Desktop Edge'], channel: 'msedge' }, + // }, + // { + // name: 'Google Chrome', + // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, + // }, + ], + + /* Run your local dev server before starting the tests */ + webServer: { + command: `cd ../../src/Dfe.EarlyYearsQualification.Web && dotnet run --urls "${process.env.WEBAPP_URL}" --project ./Dfe.EarlyYearsQualification.Web.csproj --UseMockContentful=true --ServiceAccess:Keys:0="${process.env.AUTH_SECRET}"`, + url: process.env.WEBAPP_URL, + reuseExistingServer: !process.env.CI, + }, +}); diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/back-button.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/back-button.spec.ts new file mode 100644 index 000000000..c77e3a2d1 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/back-button.spec.ts @@ -0,0 +1,67 @@ +import {test} from '@playwright/test'; +import { + startJourney, + checkUrl, + clickBackButton, + whereWasTheQualificationAwarded, + whenWasQualificationStarted, + whatLevelIsTheQualification, + whatIsTheAwardingOrganisation, + selectQualification, + confirmQualificiation, + processAdditionalRequirement, + confirmAdditonalRequirementsAnswers, + checkDetailsPage +} from '../shared/playwrightWrapper'; + +test.describe("A spec used to test the main back button route through the journey", () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + }); + test("back buttons should all navigate to the appropriate pages in the main journey", async ({page}) => { + + await whereWasTheQualificationAwarded(page, "#england"); + await whenWasQualificationStarted(page, "6", "2022"); + await whatLevelIsTheQualification(page, 3); + await whatIsTheAwardingOrganisation(page, 1); + await selectQualification(page, "EYQ-240"); + await confirmQualificiation(page, "#yes"); + await processAdditionalRequirement(page, "EYQ-240", 1, "#yes"); + await processAdditionalRequirement(page, "EYQ-240", 2, "#no"); + await confirmAdditonalRequirementsAnswers(page, "EYQ-240"); + await checkDetailsPage(page, "EYQ-240"); + + await clickBackButton(page); + await checkUrl(page, "/qualifications/check-additional-questions/EYQ-240/confirm-answers"); + await clickBackButton(page); + await checkUrl(page, "/qualifications/check-additional-questions/EYQ-240/2"); + await clickBackButton(page); + await checkUrl(page, "/qualifications/check-additional-questions/EYQ-240/1"); + await clickBackButton(page); + await checkUrl(page, "/qualifications"); + await clickBackButton(page); + await checkUrl(page, "/questions/what-is-the-awarding-organisation"); + await clickBackButton(page); + await checkUrl(page, "/questions/what-level-is-the-qualification"); + await clickBackButton(page); + await checkUrl(page, "/questions/when-was-the-qualification-started"); + await clickBackButton(page); + await checkUrl(page, "/questions/where-was-the-qualification-awarded"); + await clickBackButton(page); + await checkUrl(page, process.env.WEBAPP_URL + "/"); + }); + + test.describe("back buttons should all navigate to the appropriate pages in the main journey", async () => { + test("the back button on the accessibility statement page navigates back to the home page", async ({page}) => { + await page.goto("/accessibility-statement"); + await clickBackButton(page); + await checkUrl(page, process.env.WEBAPP_URL + "/"); + }); + + test("the back button on the cookies preference page navigates back to the home page", async ({page}) => { + await page.goto("/cookies"); + await clickBackButton(page); + await checkUrl(page, process.env.WEBAPP_URL + "/"); + }); + }); +}); diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/date-missing-redirect.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/date-missing-redirect.spec.ts new file mode 100644 index 000000000..475a681bb --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/date-missing-redirect.spec.ts @@ -0,0 +1,17 @@ +import {test} from '@playwright/test'; +import {pagesThatRedirectIfDateMissing} from "../shared/urls-to-check"; +import {startJourney, checkUrl} from '../shared/playwrightWrapper'; + +test.describe('A spec used to check that if the user skips entering the date of the qual, then they are redirected back to the date selection page', () => { + + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + }); + + pagesThatRedirectIfDateMissing.forEach((url) => { + test(`navigating to ${url} should redirect the user to the date selection page`, async ({page}) => { + await page.goto(url); + await checkUrl(page, "/questions/when-was-the-qualification-started"); + }) + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/deny-public-access.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/deny-public-access.spec.ts new file mode 100644 index 000000000..32f2211e3 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/deny-public-access.spec.ts @@ -0,0 +1,11 @@ +import {test} from '@playwright/test'; +import {checkUrl, checkValue} from '../shared/playwrightWrapper'; + +test.describe('A spec used to check a new user is challenged to enter the secret', () => { + test("should redirect the user to the challenge page", async ({page}) => { + await page.goto("/"); + await checkUrl(page, "/challenge?redirectAddress=%2F"); + await checkValue(page, "#redirectAddress", "/"); + await checkValue(page, "#PasswordValue", ''); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/journey.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/journey.spec.ts new file mode 100644 index 000000000..0e6ae81aa --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/journey/journey.spec.ts @@ -0,0 +1,155 @@ +import {test} from '@playwright/test'; +import { + startJourney, + checkUrl, + checkText, + clickBackButton, + refineQualificationSearch, + whereWasTheQualificationAwarded, + whenWasQualificationStarted, + whatLevelIsTheQualification, + whatIsTheAwardingOrganisation, + selectQualification, + confirmQualificiation, + processAdditionalRequirement, + confirmAdditonalRequirementsAnswers, + checkDetailsPage, + checkEmptyValue, + checkValue +} from '../shared/playwrightWrapper'; + +test.describe('A spec used to test the various routes through the journey', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + }); + + test("should redirect the user when they select qualification was awarded outside the UK", async ({page}) => { + await whereWasTheQualificationAwarded(page, "#outside-uk"); + await checkUrl(page, "/advice/qualification-outside-the-united-kingdom"); + }); + + test("should redirect the user when they select qualification was awarded in Scotland", async ({page}) => { + await whereWasTheQualificationAwarded(page, "#scotland"); + await checkUrl(page, "/advice/qualifications-achieved-in-scotland"); + }); + + test("should redirect the user when they select qualification was awarded in Wales", async ({page}) => { + await whereWasTheQualificationAwarded(page, "#wales"); + await checkUrl(page, "/advice/qualifications-achieved-in-wales"); + }); + + test("should redirect the user when they select qualification was awarded in Northern Ireland", async ({page}) => { + await whereWasTheQualificationAwarded(page, "#northern-ireland"); + await checkUrl(page, "/advice/qualifications-achieved-in-northern-ireland"); + }); + + test("should redirect the user when they select qualification was awarded in England", async ({page}) => { + await whereWasTheQualificationAwarded(page, "#england"); + await whenWasQualificationStarted(page, "6", "2022"); + await whatLevelIsTheQualification(page, 3); + await whatIsTheAwardingOrganisation(page, 1); + await selectQualification(page, "EYQ-240"); + await confirmQualificiation(page, "#yes"); + await processAdditionalRequirement(page, "EYQ-240", 1, "#yes"); + await processAdditionalRequirement(page, "EYQ-240", 2, "#yes"); + await confirmAdditonalRequirementsAnswers(page, "EYQ-240"); + await checkDetailsPage(page, "EYQ-240"); + }); + + test("Selecting the 'Qualification is not on the list' link on the qualification list page should navigate to the correct advice page", async ({page}) => { + await whereWasTheQualificationAwarded(page, "#england"); + await whenWasQualificationStarted(page, "6", "2022"); + await whatLevelIsTheQualification(page, 3); + await whatIsTheAwardingOrganisation(page, 1); + + // qualifications page - click a qualification in the list to move us on + await checkUrl(page, "/qualifications"); + + // click not on the list link + await page.locator('a[href="/advice/qualification-not-on-the-list"]').click(); + + // qualification not on the list page + await checkUrl(page, "/advice/qualification-not-on-the-list"); + await checkText(page, "#advice-page-heading", "This is the level 3 page"); + + // check back button goes back to the qualifications list page + await clickBackButton(page); + await checkUrl(page, "/qualifications"); + }); + + test("Selecting qualification level 7 started after 1 Sept 2014 should navigate to the level 7 post 2014 advice page", async ({page}) => { + await whereWasTheQualificationAwarded(page, "#england"); + await whenWasQualificationStarted(page, "8", "2015"); + await whatLevelIsTheQualification(page, 7); + await checkUrl(page, "/advice/level-7-qualifications-started-between-1-sept-2014-and-31-aug-2019"); + await clickBackButton(page); + await checkUrl(page, "/questions/what-level-is-the-qualification"); + }); + + + test("Selecting qualification level 7 started after 1 Sept 2019 should navigate to the level 7 post 2019 advice page", async ({page}) => { + + await checkUrl(page, "/questions/where-was-the-qualification-awarded"); + await whereWasTheQualificationAwarded(page, "#england"); + await whenWasQualificationStarted(page, "8", "2020"); + await whatLevelIsTheQualification(page, 7); + await checkUrl(page, '/advice/level-7-qualification-after-aug-2019'); + await clickBackButton(page); + await checkUrl(page, "/questions/what-level-is-the-qualification"); + }) + + + test("Should remove the search criteria when a user goes to the awarding organisation page and back again", async ({page}) => { + await whereWasTheQualificationAwarded(page, "#england"); + await whenWasQualificationStarted(page, "6", "2022"); + await whatLevelIsTheQualification(page, 3); + await whatIsTheAwardingOrganisation(page, 1); + await checkUrl(page, "/qualifications"); + await refineQualificationSearch(page, 'test'); + await checkUrl(page, "/qualifications"); + await clickBackButton(page); + await whatIsTheAwardingOrganisation(page, 1); + await checkUrl(page, "/qualifications"); + await checkEmptyValue(page, "#refineSearch"); + }); + + [ + ['09', '2014'], + ['06', '2017'], + ['08', '2019'], + ].forEach((date) => { + const [month, year] = date; + + test(`should redirect when qualification is level 2 and startMonth is ${month} and startYear is ${year}`, async ({page}) => { + await whereWasTheQualificationAwarded(page, "#england"); + await whenWasQualificationStarted(page, month, year); + await whatLevelIsTheQualification(page, 2); + await checkUrl(page, "/advice/level-2-qualifications-started-between-1-sept-2014-and-31-aug-2019"); + }); + }); + + test("should bypass remaining additional requirement question when answering yes to the Qts question", async ({page}) => { + await whereWasTheQualificationAwarded(page, "#england"); + await whenWasQualificationStarted(page, "6", "2022"); + await whatLevelIsTheQualification(page, 6); + await whatIsTheAwardingOrganisation(page, 1); + await selectQualification(page, "EYQ-108"); + await confirmQualificiation(page, "#yes"); + await processAdditionalRequirement(page, "EYQ-108", 1, "#yes"); + await confirmAdditonalRequirementsAnswers(page, "EYQ-108"); + await checkDetailsPage(page, "EYQ-108"); + }); + + test("should not bypass remaining additional requirement question when answering no to the Qts question", async ({page}) => { + await whereWasTheQualificationAwarded(page, "#england"); + await whenWasQualificationStarted(page, "6", "2022"); + await whatLevelIsTheQualification(page, 6); + await whatIsTheAwardingOrganisation(page, 1); + await selectQualification(page, "EYQ-108"); + await confirmQualificiation(page, "#yes"); + await processAdditionalRequirement(page, "EYQ-108", 1, "#no"); + await processAdditionalRequirement(page, "EYQ-108", 2, "#yes"); + await confirmAdditonalRequirementsAnswers(page, "EYQ-108"); + await checkDetailsPage(page, "EYQ-108"); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/accessibility-specification.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/accessibility-specification.spec.ts new file mode 100644 index 000000000..731bbdf01 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/accessibility-specification.spec.ts @@ -0,0 +1,14 @@ +import {test} from '@playwright/test'; +import {startJourney, checkText} from '../shared/playwrightWrapper'; + +test.describe('A spec that tests the accessibility statement page', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + }); + + test("Checks the heading and content are present", async ({page}) => { + await page.goto("/accessibility-statement"); + await checkText(page, "#accessibility-statement-heading", "Test Accessibility Statement Heading"); + await checkText(page, "#accessibility-statement-body", "Test Accessibility Statement Body"); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/advice.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/advice.spec.ts new file mode 100644 index 000000000..a15e45f83 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/advice.spec.ts @@ -0,0 +1,83 @@ +import {Page, test} from '@playwright/test'; +import {startJourney, checkText, setCookie, journeyCookieName} from '../shared/playwrightWrapper'; + +async function checkFeedbackBanners(page: Page) { + await checkText(page, ".govuk-notification-banner__title", "Test banner title", 0); + await checkText(page, ".govuk-notification-banner__heading", "Feedback heading", 0); + await checkText(page, ".govuk-notification-banner__content", "This is the body text", 0); + + await checkText(page, ".govuk-notification-banner__title", "Test banner title", 1); + await checkText(page, ".govuk-notification-banner__heading", "Feedback heading", 1); + await checkText(page, ".govuk-notification-banner__content", "This is the body text", 1); +} + +test.describe('A spec that tests advice pages', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + }); + + test("Checks the Qualifications achieved outside the United Kingdom details are on the page", async ({page}) => { + await page.goto("/advice/qualification-outside-the-united-kingdom"); + await checkText(page, "#advice-page-heading", "Qualifications achieved outside the United Kingdom"); + await checkText(page, "#advice-page-body", "Test Advice Page Body"); + + await checkFeedbackBanners(page); + }); + + test("Checks the level 2 between 1 Sept 2014 and 31 Aug 2019 details are on the page", async ({page, context}) => { + + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + await page.goto("/advice/level-2-qualifications-started-between-1-sept-2014-and-31-aug-2019"); + await checkText(page, "#advice-page-heading", "Level 2 qualifications started between 1 September 2014 and 31 August 2019"); + await checkText(page, "#advice-page-body", "Test Advice Page Body"); + + await checkFeedbackBanners(page); + }); + + test("Checks the Qualifications achieved in Scotland details are on the page", async ({page}) => { + + await page.goto("/advice/qualifications-achieved-in-scotland"); + await checkText(page, "#advice-page-heading", "Qualifications achieved in Scotland"); + await checkText(page, "#advice-page-body", "Test Advice Page Body"); + + await checkFeedbackBanners(page); + }); + + test("Checks the Qualifications achieved in Wales details are on the page", async ({page}) => { + + await page.goto("/advice/qualifications-achieved-in-wales"); + await checkText(page, "#advice-page-heading", "Qualifications achieved in Wales"); + await checkText(page, "#advice-page-body", "Test Advice Page Body"); + + await checkFeedbackBanners(page); + }); + + test("Checks the Qualifications achieved in Northern Ireland details are on the page", async ({page}) => { + + await page.goto("advice/qualifications-achieved-in-northern-ireland"); + await checkText(page, "#advice-page-heading", "Qualifications achieved in Northern Ireland"); + await checkText(page, "#advice-page-body", "Test Advice Page Body"); + + await checkFeedbackBanners(page); + }); + + test("Checks the level 7 between 1 Sept 2014 and 31 Aug 2019 details are on the page", async ({page, context}) => { + + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + await page.goto("/advice/level-7-qualifications-started-between-1-sept-2014-and-31-aug-2019"); + await checkText(page, "#advice-page-heading", "Level 7 qualifications started between 1 September 2014 and 31 August 2019"); + await checkText(page, "#advice-page-body", "Test Advice Page Body"); + + await checkFeedbackBanners(page); + }); + + test("Checks the Level 7 qualification after aug 2019 details are on the page", async ({page, context}) => { + + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2020%22%7D', journeyCookieName); + await page.goto("/advice/level-7-qualification-after-aug-2019"); + await checkText(page, "#advice-page-heading", "Level 7 qualification after aug 2019"); + await checkText(page, "#advice-page-body", "Test Advice Page Body"); + + await checkFeedbackBanners(page); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/challenge-page.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/challenge-page.spec.ts new file mode 100644 index 000000000..94f564812 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/challenge-page.spec.ts @@ -0,0 +1,41 @@ +import {test} from '@playwright/test'; +import {startJourney, checkText, doesNotExist, exists, hasAttribute} from '../shared/playwrightWrapper'; + +test.describe('A spec that tests the challenge page', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + await page.goto("/challenge"); + }); + + test("should show the missing password error when the user doesn't enter a password", async ({page}) => { + await doesNotExist(page, "#error-banner"); + await doesNotExist(page, "#error-message"); + + await page.locator("#question-submit").click(); + + await exists(page, "#error-banner"); + await checkText(page, '#error-banner-link', "Test Missing Password Text"); + await checkText(page, '#error-message', "Test Missing Password Text"); + }); + + test("should show the incorrect password error when the user enters an incorrect password", async ({page}) => { + await doesNotExist(page, "#error-banner"); + await doesNotExist(page, "#error-message"); + + await page.locator("#PasswordValue").fill("Some incorrect password"); + await page.locator("#question-submit").click(); + + await exists(page, "#error-banner"); + await checkText(page, '#error-banner-link', "Test Incorrect Password Text"); + await checkText(page, '#error-message', "Test Incorrect Password Text"); + }); + + test("clicking the show password button changes the password input to text, clicking it again turns it back", async ({page}) => { + await page.locator("#PasswordValue").fill("password"); + await hasAttribute(page, "#PasswordValue", 'type', 'password'); + await page.locator("#togglePassword").click(); + await hasAttribute(page, "#PasswordValue", 'type', 'text'); + await page.locator("#togglePassword").click(); + await hasAttribute(page, "#PasswordValue", 'type', 'password'); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/check-additional-questions.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/check-additional-questions.spec.ts new file mode 100644 index 000000000..9f1a6a881 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/check-additional-questions.spec.ts @@ -0,0 +1,60 @@ +import {test} from '@playwright/test'; +import { + startJourney, + checkText, + setCookie, + journeyCookieName, + isVisible, + hasAttribute, + attributeContains +} from '../shared/playwrightWrapper'; + +test.describe('A spec that tests the check additional questions page', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + }); + + test("Checks the check additional questions details are on the first question page", async ({page}) => { + await page.goto(`/qualifications/check-additional-questions/eyq-240/1`); + + await hasAttribute(page, "#back-button", 'href'); + await attributeContains(page, "#back-button", 'href', '/qualifications'); + + await checkText(page, '#question', 'Test question'); + await checkText(page, '#hint', 'This is the hint text'); + await checkText(page, ".govuk-details__summary-text", "This is the details heading"); + await checkText(page, ".govuk-details__text", "This is the details content"); + await checkText(page, "Label[for='yes']", "Yes"); + await checkText(page, "Label[for='no']", "No"); + await checkText(page, "#additional-requirement-button", "Get result"); + }); + + test("Checks the check additional questions details are on the second question page", async ({page}) => { + await page.goto(`/qualifications/check-additional-questions/eyq-240/2`); + + await hasAttribute(page, "#back-button", 'href'); + await attributeContains(page, "#back-button", 'href', '/qualifications/check-additional-questions'); + + await checkText(page, '#question', 'Test question 2'); + await checkText(page, '#hint', 'This is the hint text'); + await checkText(page, ".govuk-details__summary-text", "This is the details heading"); + await checkText(page, ".govuk-details__text", "This is the details content"); + await checkText(page, "Label[for='yes']", "Yes"); + await checkText(page, "Label[for='no']", "No"); + await checkText(page, "#additional-requirement-button", "Get result"); + }); + + test("Shows errors if user does not select an option", async ({page}) => { + await page.goto(`/qualifications/check-additional-questions/eyq-240/1`); + + await page.click("#additional-requirement-button"); + + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There was a problem"); + await checkText(page, "#error-banner-link", "This is a test error message"); + await isVisible(page, "#option-error"); + await checkText(page, "#option-error", "This is a test error message"); + await isVisible(page, ".govuk-form-group--error"); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/confirm-additional-question-answer.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/confirm-additional-question-answer.spec.ts new file mode 100644 index 000000000..6662221d9 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/confirm-additional-question-answer.spec.ts @@ -0,0 +1,49 @@ +import {test} from '@playwright/test'; +import { + startJourney, + checkText, + setCookie, + journeyCookieName, + checkUrl, + clickBackButton, + exists +} from '../shared/playwrightWrapper'; + +test.describe('A spec used to test the check additional requirements answer page', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%2212%2F2022%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22%22%2C%22SelectedAwardingOrganisationNotOnTheList%22%3Atrue%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22yes%22%7D%2C%22QualificationWasSelectedFromList%22%3A1%7D', journeyCookieName); + }); + + test("Checks the check additional questions details are on the first question page", async ({page}) => { + await page.goto("/qualifications/check-additional-questions/EYQ-240/confirm-answers"); + + await checkText(page, ".govuk-heading-xl", "Test page heading"); + await checkText(page, "#question-1-question", "Test question"); + await checkText(page, "#question-1-answer", "Yes"); + await checkText(page, "#question-1-change", "Test change answer text"); + await checkText(page, "#question-2-question", "Test question"); + await checkText(page, "#question-2-answer", "Yes"); + await checkText(page, "#question-2-change", "Test change answer text"); + await exists(page, '#warning-text-container'); + await checkText(page, ".govuk-warning-text__text", "Test answer disclaimer text"); + await checkText(page, "#confirm-answers", "Test button text"); + }); + + test("Navigates to the correct question page if the user clicks to change an answer", async ({page}) => { + await page.goto("/qualifications/check-additional-questions/EYQ-240/confirm-answers"); + + await page.click("#question-1-change a"); + await checkUrl(page, "/qualifications/check-additional-questions/EYQ-240/1"); + await page.click("#additional-requirement-button"); + await page.click("#additional-requirement-button"); + await page.click("#question-2-change a"); + await checkUrl(page, "/qualifications/check-additional-questions/EYQ-240/2"); + }); + + test("Navigates back to the last question when the back button is clicked", async ({page}) => { + await page.goto("/qualifications/check-additional-questions/EYQ-240/confirm-answers"); + await clickBackButton(page); + await checkUrl(page, "/qualifications/check-additional-questions/EYQ-240/2"); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/confirm-qualification.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/confirm-qualification.spec.ts new file mode 100644 index 000000000..b8f34a886 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/confirm-qualification.spec.ts @@ -0,0 +1,63 @@ +import {test} from '@playwright/test'; +import { + startJourney, + checkText, + setCookie, + journeyCookieName, + doesNotExist, + exists, + isVisible +} from '../shared/playwrightWrapper'; + +test.describe('A spec that tests the confirm qualification page', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + }); + + test("Checks the static page content is on the page", async ({page}) => { + await page.goto("/confirm-qualification/eyq-240"); + + await checkText(page, "#heading", "Test heading"); + await checkText(page, "#post-heading", "The post heading content"); + await checkText(page, "#qualification-name-row dt", "Test qualification label"); + await checkText(page, "#qualification-level-row dt", "Test level label"); + await checkText(page, "#qualification-org-row dt", "Test awarding organisation label"); + await doesNotExist(page, "#various-ao-content"); + await checkText(page, "#radio-heading", "Test radio heading"); + await exists(page, 'input[value="yes"]'); + await exists(page, 'input[value="no"]'); + await checkText(page, 'label[for="yes"]', "yes"); + await checkText(page, 'label[for="no"]', "no"); + await doesNotExist(page, '#warning-text-container'); + await checkText(page, "#confirm-qualification-button", "Test button text"); + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#confirm-qualification-choice-error"); + }); + + test("Checks the various content is on the page", async ({page}) => { + await page.goto("/confirm-qualification/eyq-250"); + + await exists(page, '#various-ao-content'); + await checkText(page, '#various-ao-content', "Various awarding organisation explanation text"); + }); + + test("Checks the warning content is on the page when the qualification has no additional requirement questions", async ({page}) => { + await page.goto("/confirm-qualification/eyq-115"); + + await exists(page, '#warning-text-container'); + await checkText(page, '#warning-text-container', "Answer disclaimer text"); + await checkText(page, "#confirm-qualification-button", "Get result"); + }); + + test("Shows errors if user does not select an option", async ({page}) => { + await page.goto("/confirm-qualification/eyq-240"); + + await page.click("#confirm-qualification-button"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "Test error banner heading"); + await checkText(page, "#error-banner-link", "Test error banner link"); + await checkText(page, "#confirm-qualification-choice-error", "Test error text"); + await isVisible(page, ".govuk-form-group--error"); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/cookies.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/cookies.spec.ts new file mode 100644 index 000000000..4a01bb714 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/cookies.spec.ts @@ -0,0 +1,44 @@ +import {test} from '@playwright/test'; +import {startJourney, checkText, doesNotExist, exists, isVisible, isNotVisible} from '../shared/playwrightWrapper'; + +test.describe("A spec that tests the cookies page", () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + await page.goto("/cookies"); + }); + + test("Checks the content is present", async ({page}) => { + await doesNotExist(page, "#cookies-set-banner"); + await checkText(page, "#cookies-heading", "Test Cookies Heading"); + await checkText(page, "#cookies-body", "Test Cookies Page Body"); + await checkText(page, "#cookies-form-heading", "Test Form Heading"); + await exists(page, "#test-option-value-1"); + await exists(page, "#test-option-value-2"); + await checkText(page, "label[for='test-option-value-1']", "Test Option Label 1"); + await checkText(page, "label[for='test-option-value-2']", "Test Option Label 2"); + await isNotVisible(page, "#cookies-choice-error"); + await checkText(page, "#cookies-choice-error", "Test Error Text"); + await checkText(page, 'button[id="cookies-button"]', "Test Cookies Button"); + }); + + test.describe("Check the functionality of the page", () => { + test("Checks that the radio button validation is working", async ({page}) => { + + await page.click('#cookies-button'); + await doesNotExist(page, "#cookies-set-banner"); + await isVisible(page, "#cookies-choice-error"); + }); + + ["test-option-value-1", "test-option-value-2"].forEach((option) => { + test(`Checks that selecting ${option} reveals success banner`, async ({page}) => { + + await page.click(`#${option}`); + await page.click('#cookies-button'); + await isVisible(page, "#cookies-set-banner"); + await checkText(page, "#cookies-set-banner-heading", "Test Success Banner Heading"); + await checkText(page, "#cookies-set-banner-content", "Test Success Banner Content"); + await isNotVisible(page, "#cookies-choice-error"); + }); + }); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/home.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/home.spec.ts new file mode 100644 index 000000000..2eb871f69 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/home.spec.ts @@ -0,0 +1,25 @@ +import {test} from '@playwright/test'; +import {startJourney, checkText} from '../shared/playwrightWrapper'; + +test.describe('A spec used to test the home page', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + }); + + test("Checks the page contains the relevant components", async ({page}) => { + await page.goto("/"); + + await checkText(page, ".govuk-heading-xl", "Test Header"); + await checkText(page, "#pre-cta-content p", "This is the pre cta content"); + await checkText(page, ".govuk-button--start", "Start Button Text"); + await checkText(page, "#post-cta-content p", "This is the post cta content"); + await checkText(page, "#right-hand-content-header", "Related content"); + await checkText(page, "#right-hand-content p", "This is the right hand content"); + }); + + test("Checks Crown copyright link text", async ({page}) => { + await page.goto("/"); + + await checkText(page, ".govuk-footer__copyright-logo", "Crown copyright", 0); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/not-found-page.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/not-found-page.spec.ts new file mode 100644 index 000000000..625b5b4af --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/not-found-page.spec.ts @@ -0,0 +1,26 @@ +import {test} from '@playwright/test'; +import {startJourney, checkText, checkUrl, attributeContains} from '../shared/playwrightWrapper'; + +test.describe('A spec used to test the not found page', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + }); + + test("Checks the page contains the relevant components", async ({page}) => { + await page.goto("/error/404"); + + await checkText(page, "#page-not-found-heading", "Page not found"); + await checkText(page, "#page-not-found-statement-body", "If you typed out the web address, check it is correct."); + await checkText(page, "#page-not-found-statement-body", "If you pasted the web address, check you copied the entire address."); + await checkText(page, "#page-not-found-statement-body", "If the web address is correct or you selected a link or button, contact the check an early years qualification team by emailing techsupport.EARLY-YEARS-QUALS@education.gov.uk to report a fault with the service."); + + await attributeContains(page, "#page-not-found-link", "href", "mailto:techsupport.EARLY-YEARS-QUALS@education.gov.uk"); + }); + + test("Check that visiting a URL that doesn't exist shows this page without altering the URL", async ({page}) => { + await page.goto("/does-not-exist"); + + await checkUrl(page, "/does-not-exist"); + await checkText(page, "#page-not-found-heading", "Page not found"); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/problem-with-the-service.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/problem-with-the-service.spec.ts new file mode 100644 index 000000000..f62cb02c5 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/problem-with-the-service.spec.ts @@ -0,0 +1,17 @@ +import {test} from '@playwright/test'; +import {startJourney, checkText, hasAttribute} from '../shared/playwrightWrapper'; + +test.describe('A spec used to test the not found page', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + }); + + test("Checks the page contains the relevant components", async ({page}) => { + await page.goto("/error"); + + await checkText(page, "#problem-with-service-heading", "Sorry, there is a problem with the service"); + await checkText(page, "#problem-with-service-body", "Please try again later."); + await checkText(page, "#problem-with-service-body", "In the meantime, you can download the early years qualifications list (EYQL) spreadsheet. This document is regularly updated by DfE to add new or updated qualifications as they become approved. You should refresh the page before downloading the EYQL spreadsheet to be sure that you are using the latest version."); + await hasAttribute(page, "#problem-with-service-link", "href", "https://www.gov.uk/government/publications/early-years-qualifications-achieved-in-england"); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/qualification-details.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/qualification-details.spec.ts new file mode 100644 index 000000000..345ef7d2e --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/qualification-details.spec.ts @@ -0,0 +1,185 @@ +import {test} from '@playwright/test'; +import {startJourney, checkText, setCookie, journeyCookieName, hasClass, hasCount} from '../shared/playwrightWrapper'; + +test.describe("A spec used to test the qualification details page", () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + }); + + test("Checks the qualification details are on the page", async ({page, context}) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22no%22%7D%7D', journeyCookieName); + await page.goto("/qualifications/qualification-details/eyq-240"); + + await checkText(page, "#page-header", "Test Main Heading"); + await checkText(page, "#qualification-details-header", "Qualification details"); + await checkText(page, "#qualification-name-label", "Qualification"); + await checkText(page, "#qualification-name-value", "T Level Technical Qualification in Education and Childcare (Specialism - Early Years Educator)"); + await checkText(page, "#awarding-organisation-label", "Awarding Org Label"); + await checkText(page, "#awarding-organisation-value", "NCFE"); + await checkText(page, "#qualification-level-label", "Test Level Label"); + await checkText(page, "#qualification-level-value", "3"); + await checkText(page, "#date-started-date-label", "Qualification start date"); + await checkText(page, "#date-started-date-value", "July 2015"); + await checkText(page, "#additional-requirement-0-label", "This is the confirmation statement 1"); + await checkText(page, "#additional-requirement-0-value", "Yes"); + await checkText(page, "#additional-requirement-1-label", "This is the confirmation statement 2"); + await checkText(page, "#additional-requirement-1-value", "No"); + await checkText(page, "#date-of-check-label", "Test Date Of Check Label"); + await checkText(page, "#ratio-heading", "Test ratio heading"); + await checkText(page, "#ratio-heading + p[class='govuk-body']", "This is the ratio text"); + await checkText(page, "#requirements-heading", "Test requirements heading"); + await checkText(page, "#requirements-heading + p[class='govuk-body']", "This is the requirements text"); + await checkText(page, "#check-another-qualification-link", "Check another qualification"); + await checkText(page, ".govuk-notification-banner__title", "Test banner title", 0); + await checkText(page, ".govuk-notification-banner__heading", "Test heading", 0); + await checkText(page, ".govuk-notification-banner__content", "Test body", 0); + await checkText(page, ".govuk-notification-banner__title", "Test banner title", 1); + await checkText(page, ".govuk-notification-banner__heading", "Test heading", 1); + await checkText(page, ".govuk-notification-banner__content", "Test body", 1); + }); + + test("Checks the order of the ratios for a level 6 qualification when a user answers yes to the Qts Question", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%226%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22This%20is%20the%20Qts%20question%22%3A%22yes%22%7D%7D', journeyCookieName); + await page.goto("/qualifications/qualification-details/eyq-108"); + + await hasCount(page,".ratio-row", 4); + await checkText(page, ".ratio-heading", "Level 6", 0); + await checkText(page, ".ratio-heading", "Level 3", 1); + await checkText(page, ".ratio-heading", "Level 2", 2); + await checkText(page, ".ratio-heading", "Unqualified", 3); + await checkText(page, ".govuk-tag", "Approved", 1); + await checkText(page, ".govuk-tag", "Approved", 2); + await checkText(page, ".govuk-tag", "Approved", 3); + await checkText(page, ".govuk-tag", "Approved", 4); + await hasClass(page, ".govuk-tag", /govuk-tag--green/, 1); + await hasClass(page, ".govuk-tag", /govuk-tag--green/, 2); + await hasClass(page, ".govuk-tag", /govuk-tag--green/, 3); + await hasClass(page, ".govuk-tag", /govuk-tag--green/, 4); + }); + + test("Checks the order of the ratios for a level 6 qualification when a user answers no to the Qts Question but yes to the remaining question", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%226%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22This%20is%20the%20Qts%20question%22%3A%22no%22%2C%22Test%20question%202%22%3A%22yes%22%7D%7D', journeyCookieName); + await page.goto("/qualifications/qualification-details/eyq-108"); + + await hasCount(page,".ratio-row", 4); + await checkText(page, ".ratio-heading", "Level 3", 0); + await checkText(page, ".ratio-heading", "Level 2", 1); + await checkText(page, ".ratio-heading", "Unqualified", 2); + await checkText(page, ".ratio-heading", "Level 6", 3); + await checkText(page, ".govuk-tag", "Approved", 1); + await checkText(page, ".govuk-tag", "Approved", 2); + await checkText(page, ".govuk-tag", "Approved", 3); + await checkText(page, ".govuk-tag", "Not approved", 4); + await hasClass(page, ".govuk-tag", /govuk-tag--green/, 1); + await hasClass(page, ".govuk-tag", /govuk-tag--green/, 2); + await hasClass(page, ".govuk-tag", /govuk-tag--green/, 3); + await hasClass(page, ".govuk-tag", /govuk-tag--red/, 4); + }); + + test("Checks the order of the ratios on the page when a user answers additional requirement questions indicating full and relevant", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22no%22%7D%7D', journeyCookieName); + await page.goto("/qualifications/qualification-details/eyq-240"); + + await hasCount(page,".ratio-row", 4); + await checkText(page, ".ratio-heading", "Level 3", 0); + await checkText(page, ".ratio-heading", "Level 2", 1); + await checkText(page, ".ratio-heading", "Unqualified", 2); + await checkText(page, ".ratio-heading", "Level 6", 3); + await checkText(page, ".govuk-tag", "Approved", 1); + await checkText(page, ".govuk-tag", "Approved", 2); + await checkText(page, ".govuk-tag", "Approved", 3); + await checkText(page, ".govuk-tag", "Not approved", 4); + await hasClass(page, ".govuk-tag", /govuk-tag--green/, 1); + await hasClass(page, ".govuk-tag", /govuk-tag--green/, 2); + await hasClass(page, ".govuk-tag", /govuk-tag--green/, 3); + await hasClass(page, ".govuk-tag", /govuk-tag--red/, 4); + }); + + test("Checks the order of the ratios on the page when a user answers an additional requirement question indicating not full and relevant", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22yes%22%7D%7D', journeyCookieName); + await page.goto("/qualifications/qualification-details/eyq-241"); + + await hasCount(page,".ratio-row", 4); + await checkText(page, ".ratio-heading", "Unqualified", 0); + await checkText(page, ".ratio-heading", "Level 2", 1); + await checkText(page, ".ratio-heading", "Level 3", 2); + await checkText(page, ".ratio-heading", "Level 6", 3); + await checkText(page, ".govuk-tag", "Approved", 1); + await checkText(page, ".govuk-tag", "Not approved", 2); + await checkText(page, ".govuk-tag", "Not approved", 3); + await checkText(page, ".govuk-tag", "Not approved", 4); + await hasClass(page, ".govuk-tag", /govuk-tag--green/, 1); + await hasClass(page, ".govuk-tag", /govuk-tag--red/, 2); + await hasClass(page, ".govuk-tag", /govuk-tag--red/, 3); + await hasClass(page, ".govuk-tag", /govuk-tag--red/, 4); + }); + + test("Checks the staff ratio text shows correctly when not full and relevant for a L3+ qualification started between Sep14 & Aug19", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22yes%22%7D%7D', journeyCookieName); + await page.goto("/qualifications/qualification-details/eyq-240"); + + await checkText(page, "#ratio-heading", "Test ratio heading"); + await checkText(page, "#ratio-heading + p[class='govuk-body']", "This is not F&R for L3 between Sep14 & Aug19"); + }); + + test("Checks the staff ratio text shows correctly when not full and relevant for a L3+ qualification started after Sep19", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%2210%2F2019%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22yes%22%7D%7D', journeyCookieName); + await page.goto("/qualifications/qualification-details/eyq-240"); + + await checkText(page, "#ratio-heading", "Test ratio heading"); + await checkText(page, "#ratio-heading + p[class='govuk-body']", "This is not F&R"); + }); + + test("When the user selects a qualification that is above a level 2, started between Sept 2014 and Aug 2019, and is not full and relevant with no questions, they see the level 2 qualification markes as 'Further action required'", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%226%2F2016%22%2C%22LevelOfQualification%22%3A%225%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SelectedAwardingOrganisationNotOnTheList%22%3Afalse%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%7D%2C%22QualificationWasSelectedFromList%22%3A1%7D', journeyCookieName); + await page.goto("/qualifications/qualification-details/eyq-114"); + + await checkText(page, "#ratio-Level2-tag", "Further action required"); + await checkText(page, "#ratio-Level2-additional-info", "Level 2 further action required text"); + }); + + test("When the user selects a qualification that is above a level 2, started between Sept 2014 and Aug 2019, and is not full and relevant due to their answers, they see the level 2 qualification markes as 'Further action required'", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%2212%2F2016%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22%22%2C%22SelectedAwardingOrganisationNotOnTheList%22%3Atrue%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22no%22%2C%22Test%20question%202%22%3A%22yes%22%7D%2C%22QualificationWasSelectedFromList%22%3A1%7D', journeyCookieName); + await page.goto("/qualifications/qualification-details/eyq-240"); + + await checkText(page, "#ratio-Level2-tag", "Further action required"); + await checkText(page, "#ratio-Level2-additional-info", "Level 2 further action required text"); + }); + + test("Clicking the print button brings up the print dialog", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%2C%22SearchCriteria%22%3A%22%22%2C%22AdditionalQuestionsAnswers%22%3A%7B%22Test%20question%22%3A%22yes%22%2C%22Test%20question%202%22%3A%22no%22%7D%7D', journeyCookieName); + await page.goto("/qualifications/qualification-details/eyq-240"); + + await page.evaluate('(() => {window.waitForPrintDialog = new Promise(f => window.print = f);})()'); + await page.click('#print-button'); + await page.waitForFunction('window.waitForPrintDialog'); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/qualification-list.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/qualification-list.spec.ts new file mode 100644 index 000000000..16eeca468 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/qualification-list.spec.ts @@ -0,0 +1,48 @@ +import {test} from '@playwright/test'; +import {startJourney, checkText, setCookie, journeyCookieName, doesNotExist} from '../shared/playwrightWrapper'; + +test.describe('A spec used to test the qualification list page', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + }); + + test("Checks the details are showing on the page", async ({page, context}) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%226%2F2022%22%2C%22LevelOfQualification%22%3A%223%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22NCFE%22%7D', journeyCookieName); + await page.goto("/qualifications"); + + await checkText(page, "#your-search-header", "Your search"); + await checkText(page, "#filter-country", "England"); + await checkText(page, "#filter-start-date", "June 2022"); + await checkText(page, "#filter-level", "Level 3"); + await checkText(page, "#filter-org", "NCFE"); + await checkText(page, "#heading", "Test Header"); + await checkText(page, "#found-heading", "3 qualifications found"); + await checkText(page, "#pre-search-content", "Pre search box content"); + await checkText(page, "#post-list-content", "Link to not on list advice page"); + await checkText(page, "#post-filter-content", "Post search criteria content"); + await checkText(page, "#clear-search", "Clear search"); + await doesNotExist(page, "#no-result-content"); + }); + + test("Shows the default headings when any level and no awarding organisation selected", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%226%2F2022%22%2C%22LevelOfQualification%22%3A%220%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22%22%7D', journeyCookieName); + await page.goto("/qualifications"); + + await checkText(page, "#filter-level", "Any level"); + await checkText(page, "#filter-org", "Various awarding organisations"); + }); + + test("Shows the correct no results content when there are no results in the search", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%226%2F2022%22%2C%22LevelOfQualification%22%3A%220%22%2C%22WhatIsTheAwardingOrganisation%22%3A%22%22%7D', journeyCookieName); + await page.goto("/qualifications"); + + await checkText(page, "#found-heading", "No qualifications found"); + await checkText(page, "#no-result-content", "Test no qualifications text"); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/qualification-not-on-list.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/qualification-not-on-list.spec.ts new file mode 100644 index 000000000..524d7f51a --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/qualification-not-on-list.spec.ts @@ -0,0 +1,65 @@ +import {test} from '@playwright/test'; +import {startJourney, checkText, setCookie, journeyCookieName} from '../shared/playwrightWrapper'; + +test.describe('A spec that tests the qualification not on list page', () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + }); + + test("Checks content renders for the level 3 specific qualification not on the list page", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%223%22%7D', journeyCookieName); + await page.goto("/advice/qualification-not-on-the-list"); + + await checkText(page, "#advice-page-heading", "This is the level 3 page"); + await checkText(page, "#advice-page-body", "This is the body text"); + + await checkText(page, ".govuk-notification-banner__title", "Banner title", 0); + await checkText(page, ".govuk-notification-banner__heading", "Feedback banner heading", 0); + await checkText(page, ".govuk-notification-banner__content", "Banner body text", 0); + + await checkText(page, ".govuk-notification-banner__title", "Banner title", 1); + await checkText(page, ".govuk-notification-banner__heading", "Feedback banner heading", 1); + await checkText(page, ".govuk-notification-banner__content", "Banner body text", 1); + }); + + test("Checks content renders for the level 4 specific qualification not on the list page", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%224%22%7D', journeyCookieName); + await page.goto("/advice/qualification-not-on-the-list"); + + await checkText(page, "#advice-page-heading", "This is the level 4 page"); + await checkText(page, "#advice-page-body", "This is the body text"); + + await checkText(page, ".govuk-notification-banner__title", "Banner title", 0); + await checkText(page, ".govuk-notification-banner__heading", "Feedback banner heading", 0); + await checkText(page, ".govuk-notification-banner__content", "Banner body text", 0); + + await checkText(page, ".govuk-notification-banner__title", "Banner title", 1); + await checkText(page, ".govuk-notification-banner__heading", "Feedback banner heading", 1); + await checkText(page, ".govuk-notification-banner__content", "Banner body text", 1); + }); + + test("Checks default content renders when no specific qualification not on the list page exists", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhereWasQualificationAwarded%22%3A%22england%22%2C%22WhenWasQualificationStarted%22%3A%227%2F2015%22%2C%22LevelOfQualification%22%3A%225%22%7D', journeyCookieName); + await page.goto("/advice/qualification-not-on-the-list"); + + await checkText(page, "#advice-page-heading", "Qualification not on the list"); + await checkText(page, "#advice-page-body", "Test Advice Page Body"); + + await checkText(page, ".govuk-notification-banner__title", "Test banner title", 0); + await checkText(page, ".govuk-notification-banner__heading", "Feedback heading", 0); + await checkText(page, ".govuk-notification-banner__content", "This is the body text", 0); + + await checkText(page, ".govuk-notification-banner__title", "Test banner title", 1); + await checkText(page, ".govuk-notification-banner__heading", "Feedback heading", 1); + await checkText(page, ".govuk-notification-banner__content", "This is the body text", 1); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/question.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/question.spec.ts new file mode 100644 index 000000000..8c00c6043 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/pages/question.spec.ts @@ -0,0 +1,325 @@ +import {test} from '@playwright/test'; +import { + startJourney, + checkText, + checkUrl, + setCookie, + journeyCookieName, + exists, + doesNotExist, + hasClass, + doesNotHaveClass, + isVisible, + hasAttribute, + doesNotHaveAttribute +} from '../shared/playwrightWrapper'; + +test.describe("A spec that tests question pages", () => { + test.beforeEach(async ({page, context}) => { + await startJourney(page, context); + }); + + test("Checks the content on where-was-the-qualification-awarded page", async ({page}) => { + await page.goto("/questions/where-was-the-qualification-awarded"); + + await checkText(page, "#question", "Where was the qualification awarded?"); + await exists(page, "#england"); + await exists(page, "#scotland"); + await exists(page, "#wales"); + await exists(page, "#northern-ireland"); + await checkText(page, ".govuk-radios__divider", "or") + await exists(page, "#outside-uk"); + }); + + test("Checks additional information on the where-was-the-qualification-awarded page", async ({page}) => { + await page.goto("/questions/where-was-the-qualification-awarded"); + await doesNotHaveAttribute(page, ".govuk-details", "open"); + await checkText(page, ".govuk-details__summary-text", "This is the additional information header"); + await checkText(page, ".govuk-details__text", "This is the additional information body"); + await page.click(".govuk-details__summary-text"); + await hasAttribute(page, ".govuk-details", "open"); + }); + + test("shows an error message when a user doesnt select an option on the where-was-the-qualification-awarded page", async ({page}) => { + await page.goto("/questions/where-was-the-qualification-awarded"); + + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#option-error"); + await doesNotHaveClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await page.click("#question-submit"); + await checkUrl(page, "/questions/where-was-the-qualification-awarded"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There is a problem"); + await checkText(page, "#error-banner-link", "Test error banner link text"); + await exists(page, "#option-error"); + await checkText(page, '#option-error', "Test error message"); + await hasClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + }); + + test("Checks the content on when-was-the-qualification-started page", async ({page}) => { + await page.goto("/questions/when-was-the-qualification-started"); + + await checkText(page, "#question", "Test Date Question"); + await exists(page, "#date-started-month"); + await exists(page, "#date-started-year"); + }); + + test("Checks additional information on the when-was-the-qualification-started page", async ({page}) => { + await page.goto("/questions/when-was-the-qualification-started"); + + await doesNotHaveAttribute(page, ".govuk-details", "open"); + + await checkText(page, ".govuk-details__summary-text", "This is the additional information header"); + await checkText(page, ".govuk-details__text", "This is the additional information body"); + await page.click(".govuk-details__summary-text"); + await hasAttribute(page, ".govuk-details", "open"); + }); + + test("shows the month and year missing error message when a user doesnt type a date on the when-was-the-qualification-started page", async ({page}) => { + await page.goto("/questions/when-was-the-qualification-started"); + + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#date-error"); + await doesNotHaveClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await page.click("#question-submit"); + await checkUrl(page, "/questions/when-was-the-qualification-started"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There is a problem"); + await checkText(page, "#error-banner-link", "Test error banner link text"); + await exists(page, '#date-error'); + await checkText(page, '#date-error', "Test Error Message"); + await hasClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await hasClass(page, "#date-started-month", /govuk-input--error/); + await hasClass(page, "#date-started-year", /govuk-input--error/); + }); + + test("shows the month missing error message when a user doesnt type a month on the when-was-the-qualification-started page", async ({page}) => { + await page.goto("/questions/when-was-the-qualification-started"); + + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#date-error"); + await doesNotHaveClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await page.fill('#date-started-year', '2024'); + await page.click("#question-submit"); + await checkUrl(page, "/questions/when-was-the-qualification-started"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There is a problem"); + await checkText(page, "#error-banner-link", "Missing Month Banner Link Text"); + await exists(page, '#date-error'); + await checkText(page, '#date-error', "Missing Month Error Message"); + await hasClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await hasClass(page, "#date-started-month", /govuk-input--error/); + await doesNotHaveClass(page, "#date-started-year", /govuk-input--error/); + }); + + test("shows the year missing error message when a user doesnt type a month on the when-was-the-qualification-started page", async ({page}) => { + await page.goto("/questions/when-was-the-qualification-started"); + + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#date-error"); + await doesNotHaveClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await page.fill('#date-started-month', '10'); + await page.click("#question-submit"); + await checkUrl(page, "/questions/when-was-the-qualification-started"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There is a problem"); + await checkText(page, "#error-banner-link", "Missing Year Banner Link Text"); + await exists(page, '#date-error'); + await checkText(page, '#date-error', "Missing Year Error Message"); + await hasClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await doesNotHaveClass(page, "#date-started-month", /govuk-input--error/); + await hasClass(page, "#date-started-year", /govuk-input--error/); + }); + + test.describe("When the month selected on the when-was-the-qualification-started page", () => { + ['0', '-1', '13', '99'].forEach((value) => { + test(`is ${value} then it shows the month out of bounds error message`, async ({page}) => { + await page.goto("/questions/when-was-the-qualification-started"); + + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#date-error"); + await doesNotHaveClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await page.fill('#date-started-month', value); + await page.fill('#date-started-year', '2024'); + await page.click("#question-submit"); + await checkUrl(page, "/questions/when-was-the-qualification-started"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There is a problem"); + await checkText(page, "#error-banner-link", "Month Out Of Bounds Error Link Text"); + await exists(page, '#date-error'); + await checkText(page, '#date-error', "Month Out Of Bounds Error Message"); + await hasClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await hasClass(page, "#date-started-month", /govuk-input--error/); + await doesNotHaveClass(page, "#date-started-year", /govuk-input--error/); + }); + }); + }); + + test.describe("When the year selected on the when-was-the-qualification-started page", () => { + ['0', '1899', '3000'].forEach((value) => { + test(`is ${value} then it shows the incorrect year format error message`, async ({page}) => { + await page.goto("/questions/when-was-the-qualification-started"); + + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#date-error"); + await doesNotHaveClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await page.fill('#date-started-month', '1'); + await page.fill('#date-started-year', value); + await page.click("#question-submit"); + await checkUrl(page, "/questions/when-was-the-qualification-started"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There is a problem"); + await checkText(page, "#error-banner-link", "Year Out Of Bounds Error Link Text"); + await exists(page, '#date-error'); + await checkText(page, '#date-error', "Year Out Of Bounds Error Message"); + await hasClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await doesNotHaveClass(page, "#date-started-month", /govuk-input--error/); + await hasClass(page, "#date-started-year", /govuk-input--error/); + }); + }); + }); + + test("shows the month out of bound error message and the year out of bounds error message when a user types an invalid month and year on the when-was-the-qualification-started page", async ({page}) => { + await page.goto("/questions/when-was-the-qualification-started"); + + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#date-error"); + await doesNotHaveClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await page.fill('#date-started-month', '0'); + await page.fill('#date-started-year', '20'); + await page.click("#question-submit"); + await checkUrl(page, "/questions/when-was-the-qualification-started"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There is a problem"); + await checkText(page, "#error-banner-link", "Month Out Of Bounds Error Link TextYear Out Of Bounds Error Link Text"); + await exists(page, '#date-error'); + await checkText(page, '#date-error', "Month Out Of Bounds Error MessageYear Out Of Bounds Error Message"); + await hasClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await hasClass(page, "#date-started-month", /govuk-input--error/); + await hasClass(page, "#date-started-year", /govuk-input--error/); + }); + + test("shows the month out of bound error message and the year missing error message when a user types an invalid month and doesnt type a year on the when-was-the-qualification-started page", async ({page}) => { + await page.goto("/questions/when-was-the-qualification-started"); + + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#date-error"); + await doesNotHaveClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await page.fill('#date-started-month', '0'); + await page.click("#question-submit"); + await checkUrl(page, "/questions/when-was-the-qualification-started"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There is a problem"); + await checkText(page, "#error-banner-link", "Month Out Of Bounds Error Link TextMissing Year Banner Link Text"); + await exists(page, '#date-error'); + await checkText(page, '#date-error', "Month Out Of Bounds Error MessageMissing Year Error Message"); + await hasClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await hasClass(page, "#date-started-month", /govuk-input--error/); + await hasClass(page, "#date-started-year", /govuk-input--error/); + }); + + test("shows the month missing error message and the year out of bounds error message when a user doesnt type a year and types an invalid month on the when-was-the-qualification-started page", async ({page}) => { + await page.goto("/questions/when-was-the-qualification-started"); + + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#date-error"); + await doesNotHaveClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await page.fill('#date-started-year', '20'); + await page.click("#question-submit"); + await checkUrl(page, "/questions/when-was-the-qualification-started"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There is a problem"); + await checkText(page, "#error-banner-link", "Missing Month Banner Link TextYear Out Of Bounds Error Link Text"); + await exists(page, '#date-error'); + await checkText(page, '#date-error', "Missing Month Error MessageYear Out Of Bounds Error Message"); + await hasClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await hasClass(page, "#date-started-month", /govuk-input--error/); + await hasClass(page, "#date-started-year", /govuk-input--error/); + }); + + test("Checks the content on what-level-is-the-qualification page", async ({page, context}) => { + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + await page.goto("/questions/what-level-is-the-qualification"); + + await checkText(page, "#question", "What level is the qualification?"); + await exists(page, 'input[id="2"]'); + await exists(page, 'input[id="3"]'); + await exists(page, 'input[id="6"]'); + await exists(page, 'label[for="6"]'); + await checkText(page, 'div[id="6_hint"]', "Some hint text"); + await exists(page, 'input[id="7"]'); + }); + + test("Checks additional information on the what-level-is-the-qualification page", async ({page, context}) => { + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + await page.goto("/questions/what-level-is-the-qualification"); + + await doesNotHaveAttribute(page, ".govuk-details", "open"); + await checkText(page, ".govuk-details__summary-text", "This is the additional information header"); + await checkText(page, ".govuk-details__text", "This is the additional information body"); + await page.click(".govuk-details__summary-text"); + await hasAttribute(page, ".govuk-details", "open"); + }); + + test("shows an error message when a user doesnt select an option on the what-level-is-the-qualification page", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + await page.goto("/questions/what-level-is-the-qualification"); + + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#option-error"); + await doesNotHaveClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + await page.click("#question-submit"); + await checkUrl(page, "/questions/what-level-is-the-qualification"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There is a problem"); + await checkText(page, "#error-banner-link", "Test error banner link text"); + await exists(page, "#option-error"); + await checkText(page, '#option-error', "Test error message"); + await hasClass(page, ".govuk-form-group", /govuk-form-group--error/, 0); + }); + + test("Checks the content on what-is-the-awarding-organisation page", async ({page, context}) => { + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + await page.goto("/questions/what-is-the-awarding-organisation"); + + await checkText(page, '#question', "Test Dropdown Question"); + await exists(page, "#awarding-organisation-select"); + await exists(page, "#awarding-organisation-not-in-list"); + await exists(page, '#question-submit'); + }); + + test("Checks additional information on the what-is-the-awarding-organisation page", async ({page, context}) => { + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + await page.goto("/questions/what-is-the-awarding-organisation"); + + await doesNotHaveAttribute(page, ".govuk-details", "open"); + await checkText(page, ".govuk-details__summary-text", "This is the additional information header"); + await checkText(page, ".govuk-details__text", "This is the additional information body"); + await page.click(".govuk-details__summary-text"); + await hasAttribute(page, ".govuk-details", "open"); + }); + + test("shows an error message when a user doesnt select an option from the dropdown list" + + "and also does not check 'not in the list' on the what-is-the-awarding-organisation", async ({ + page, + context + }) => { + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + await page.goto("/questions/what-is-the-awarding-organisation"); + + await doesNotExist(page, ".govuk-error-summary"); + await doesNotExist(page, "#dropdown-error"); + await doesNotHaveClass(page, "#awarding-organisation-select", /govuk-select--error/); + await page.click("#question-submit"); + await checkUrl(page, "/questions/what-is-the-awarding-organisation"); + await isVisible(page, ".govuk-error-summary"); + await checkText(page, ".govuk-error-summary__title", "There is a problem"); + await checkText(page, "#error-banner-link", "Test error banner link text"); + await exists(page, "#dropdown-error"); + await checkText(page, '#dropdown-error', "Test Error Message"); + await hasClass(page, "#awarding-organisation-select", /govuk-select--error/); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/cookies-banner.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/cookies-banner.spec.ts new file mode 100644 index 000000000..0c842a87a --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/cookies-banner.spec.ts @@ -0,0 +1,53 @@ +import {test} from '@playwright/test'; +import {pages} from "../shared/urls-to-check"; +import {authorise, checkText, checkCookieValue, isVisible, doesNotExist} from './playwrightWrapper'; + +test.describe('A spec that tests that the cookies banner shows on all pages', () => { + + test.beforeEach(async ({context}) => { + await authorise(context); + }); + + pages.forEach((url) => { + test(`Checks that the cookies banner is present at the URL: ${url}`, async ({page}) => { + await page.goto(url); + + await isVisible(page, "#choose-cookies-preference"); + await doesNotExist(page, "#cookies-preference-chosen"); + await checkText(page, ".govuk-cookie-banner__heading", "Test Cookies Banner Title"); + await checkText(page, ".govuk-cookie-banner__content", "This is the cookies banner content"); + }); + + test(`Accepting the cookies shows the accept message at the URL: ${url}, then clicking to hide the banner should hide the banner`, async ({ + page, + context + }) => { + await page.goto(url); + await page.locator("#accept-cookies-button").click(); + await doesNotExist(page, "#choose-cookies-preference"); + await isVisible(page, "#cookies-preference-chosen"); + await checkCookieValue(context, "%7B%22HasApproved%22%3Atrue%2C%22IsVisible%22%3Atrue%2C%22IsRejected%22%3Afalse%7D"); + await checkText(page, "#cookies-banner-pref-chosen-content", "This is the accepted cookie content"); + await page.locator("#hide-cookie-banner-button").click(); + await doesNotExist(page, "#choose-cookies-preference"); + await doesNotExist(page, "#cookies-preference-chosen"); + await checkCookieValue(context, "%7B%22HasApproved%22%3Atrue%2C%22IsVisible%22%3Afalse%2C%22IsRejected%22%3Afalse%7D"); + }); + + test(`Rejecting the cookies shows the reject message at the URL: ${url}, then clicking to hide the banner should hide the banner`, async ({ + page, + context + }) => { + await page.goto(url); + await page.locator("#reject-cookies-button").click(); + await doesNotExist(page, "#choose-cookies-preference"); + await isVisible(page, "#cookies-preference-chosen"); + await checkCookieValue(context, "%7B%22HasApproved%22%3Afalse%2C%22IsVisible%22%3Atrue%2C%22IsRejected%22%3Atrue%7D"); + await checkText(page, "#cookies-banner-pref-chosen-content", "This is the rejected cookie content"); + await page.locator("#hide-cookie-banner-button").click(); + await doesNotExist(page, "#choose-cookies-preference"); + await doesNotExist(page, "#cookies-preference-chosen"); + await checkCookieValue(context, "%7B%22HasApproved%22%3Afalse%2C%22IsVisible%22%3Afalse%2C%22IsRejected%22%3Atrue%7D"); + }); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/phase-banner.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/phase-banner.spec.ts new file mode 100644 index 000000000..36a7b1065 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/phase-banner.spec.ts @@ -0,0 +1,20 @@ +import {test} from '@playwright/test'; +import {pages} from "../shared/urls-to-check"; +import {authorise, checkText, isVisible} from './playwrightWrapper'; + +test.describe('A spec that tests the phase banner is showing on all pages', () => { + + test.beforeEach(async ({context}) => { + await authorise(context); + }); + + pages.forEach((url) => { + test(`Checks that the phase banner is present at the URL: ${url}`, async ({page}) => { + await page.goto(url); + + await isVisible(page, ".govuk-phase-banner"); + await checkText(page, ".govuk-phase-banner__content__tag", "Test phase banner name"); + await checkText(page, ".govuk-phase-banner__text", "Some TextLink Text"); + }) + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/playwrightWrapper.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/playwrightWrapper.ts new file mode 100644 index 000000000..b95731ed3 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/playwrightWrapper.ts @@ -0,0 +1,182 @@ +import {BrowserContext, Page, expect, APIResponse} from "@playwright/test"; + +export const cookiePreferencesCookieName = "cookies_preferences_set"; +export const journeyCookieName = 'user_journey'; + +export async function authorise(context: BrowserContext) { + await setCookie(context, process.env.AUTH_SECRET, 'auth-secret'); +} + +export async function startJourney(page: Page, context: BrowserContext) { + await authorise(context); + await page.goto("/", {waitUntil: 'domcontentloaded'}); + await page.waitForFunction(() => document.title === "Start - Check an Early Years qualification") + await expect(page.locator("#start-now-button")).toBeVisible(); + await page.locator("#start-now-button").click(); +} + +export async function checkUrl(page: Page, expectedUrl: string) { + await page.waitForLoadState("domcontentloaded"); + expect(page.url()).toContain(expectedUrl); +} + +export async function checkText(page: Page, locator: string, expectedText: string, nth: number = null) { + await page.waitForLoadState("domcontentloaded"); + var element = page.locator(locator); + if (nth != null) { + element = element.nth(nth); + } + await expect(element).toContainText(expectedText); +} + +export async function checkValue(page: Page, locator: string, expectedValue: any) { + await page.waitForLoadState("domcontentloaded"); + await expect(page.locator(locator)).toHaveValue(expectedValue); +} + +export async function checkEmptyValue(page: Page, locator: string) { + await page.waitForLoadState("domcontentloaded"); + await expect(page.locator(locator).first()).toBeEmpty(); +} + +export async function clickBackButton(page: Page) { + await page.locator("#back-button").click(); +} + +export async function checkCookieValue(context: BrowserContext, value: string) { + var cookies = await context.cookies(); + var cookie = cookies.find((c) => c.name === cookiePreferencesCookieName); + + expect(cookie.value).toBe(value); +} + +export async function setCookie(context: BrowserContext, value: string, cookieName: string) { + await context.addCookies([ + { + name: cookieName, + value: value, + path: '/', + domain: process.env.DOMAIN + } + ]); +} + +export function checkHeaderValue(response: APIResponse, headerName: string, headerValue: string) { + expect(response.headers()[headerName]).toBe(headerValue); +} + +export function checkHeaderExists(response: APIResponse, headerName: string) { + expect(response.headers()[headerName]).toBeUndefined(); +} + +export async function exists(page: Page, locator: string) { + await hasCount(page, locator, 1); +} + +export async function doesNotExist(page: Page, locator: string) { + await hasCount(page, locator, 0); +} + +export async function hasCount(page: Page, locator: string, count: number) { + await expect(page.locator(locator)).toHaveCount(count); +} + +export async function isVisible(page: Page, locator: string) { + await expect(page.locator(locator)).toBeVisible(); +} + +export async function isNotVisible(page: Page, locator: string) { + await expect(page.locator(locator)).not.toBeVisible(); +} + +export async function hasAttribute(page: Page, locator: string, attribute: string, value?: string) { + await expect(page.locator(locator)).toHaveAttribute(attribute, value); +} + +export async function doesNotHaveAttribute(page: Page, locator: string, attribute: string) { + await expect(page.locator(locator)).not.toHaveAttribute(attribute); +} + +export async function attributeContains(page: Page, locator: string, attribute: string, value: string) { + expect(await page.locator(locator).getAttribute(attribute)).toContain(value); +} + +export async function hasClass(page: Page, locator: string, expectedClass: string | RegExp, nth: number = null) { + var element = page.locator(locator); + if (nth != null) { + element = element.nth(nth); + } + await expect(element).toHaveClass(expectedClass); +} + +export async function doesNotHaveClass(page: Page, locator: string, expectedClass: string | RegExp, nth: number = null) { + var element = page.locator(locator); + if (nth != null) { + element = element.nth(nth); + } + await expect(element).not.toHaveClass(expectedClass); +} + +export async function whereWasTheQualificationAwarded(page: Page, location: string) { + checkUrl(page, "/questions/where-was-the-qualification-awarded"); + await page.locator(location).click(); + await page.locator("#question-submit").click(); +} + +export async function whenWasQualificationStarted(page: Page, month: string, year: string) { + checkUrl(page, '/questions/when-was-the-qualification-started'); + await page.locator("#date-started-month").fill(month); + await page.locator("#date-started-year").fill(year); + await page.locator("#question-submit").click(); +} + +export async function whatLevelIsTheQualification(page: Page, level: number) { + // what-level-is-the-qualification page - valid level moves us on + checkUrl(page, "/questions/what-level-is-the-qualification"); + await page.locator('input[id="' + level + '"]').click(); + await page.locator("#question-submit").click(); +} + +export async function whatIsTheAwardingOrganisation(page: Page, dropdownIndex: number) { + // what-is-the-awarding-organisation page - valid awarding organisation moves us on + checkUrl(page, "/questions/what-is-the-awarding-organisation"); + await page.locator("#awarding-organisation-select").selectOption({index: dropdownIndex}); + await page.locator("#question-submit").click(); +} + +export async function selectQualification(page: Page, qualificationId: string) { + // qualifications page - click a qualification in the list to move us on + checkUrl(page, "/qualifications"); + await page.locator("a[href=\"/confirm-qualification/" + qualificationId + "\"]").click(); + checkUrl(page, "/confirm-qualification/" + qualificationId); +} + +export async function confirmQualificiation(page: Page, answer: string) { + // confirm qualification page + await page.locator(answer).click(); + await page.locator('#confirm-qualification-button').click(); + +} + +export async function processAdditionalRequirement(page: Page, qualificationId: string, additionalRequirementIndex: number, answer: string) { + // check additional questions first page + checkUrl(page, "/qualifications/check-additional-questions/" + qualificationId + "/" + additionalRequirementIndex); + await page.locator(answer).click(); + await page.locator("#additional-requirement-button").click(); + +} + +export async function confirmAdditonalRequirementsAnswers(page: Page, qualificationId: string) { + checkUrl(page, "/qualifications/check-additional-questions/" + qualificationId + "/confirm-answers"); + await page.locator("#confirm-answers").click(); +} + +export async function checkDetailsPage(page: Page, qualificationId: string) { + await checkUrl(page, "/qualifications/qualification-details/" + qualificationId); +} + +export async function refineQualificationSearch(page: Page, searchTerm: string) { + await page.locator("#refineSearch").fill(searchTerm); + checkValue(page, "#refineSearch", searchTerm); + await page.locator("#refineSearchButton").click(); +} diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/security-header.spec.ts b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/security-header.spec.ts new file mode 100644 index 000000000..da869a4ae --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/security-header.spec.ts @@ -0,0 +1,111 @@ +import {test} from '@playwright/test'; +import {pagesWithForms, pagesWithoutFormsOrRedirects, pagesWithoutFormsWithRedirects} from "./urls-to-check"; +import { + cookiePreferencesCookieName, + journeyCookieName, + authorise, + setCookie, + checkHeaderValue, + checkHeaderExists +} from "./playwrightWrapper"; + +var expectedContentSecurityPolicyHeader = "script-src 'self' 'sha256-2eCA8tPChvVMeSRvRNqlmBco1wRmAKXWVzJ8Vpb9S6Y=' 'sha256-J9XqQhqN9DBC2a8DSiKQLF4w9PuSgEx4Vz/Fivcj0t4=' 'sha256-Om9RNNoMrdmIZzT4Oo7KaozVNUg6zYxVQuq3CPld2Ms=' 'unsafe-hashes' 'sha256-GUQ5ad8JK5KmEWmROf3LZd9ge94daqNvd8xy9YS1iDw=' 'sha256-l5MP+9OapFXGxjKMNj/89ExAW2TvAFFoADrbsmtSJXo=' 'sha256-lD2YLKoqlgPJ6bMRB0gZKeUdZqwszfrRSmAnzX0TSls=' 'sha256-1f+6vEGZewP7dkvrYIBD4bqMLOhumfg10mwfKd2jU7I=' 'sha256-fWDhQI9vCzfKzPnyv9Rt3lgLpz8aTH7VYjbVc8OgTXY=' https://www.googletagmanager.com/gtm.js https://www.googletagmanager.com/gtag/js https://www.clarity.ms/ https://c.bing.com;object-src 'self';frame-ancestors https://app.contentful.com;connect-src *.google-analytics.com https://*.clarity.ms/collect;block-all-mixed-content;upgrade-insecure-requests;" +test.describe('A spec that checks for security headers in the response', () => { + + test.beforeEach(async ({context}) => { + await authorise(context); + }); + + + pagesWithForms.forEach((url) => { + test(`pages with forms and no cookie banner - ${url} contains the expected response headers`, async ({ + context, + request + }) => { + await setCookie(context, "%7B%22HasApproved%22%3Atrue%2C%22IsVisible%22%3Afalse%2C%22IsRejected%22%3Afalse%7D", cookiePreferencesCookieName); + + var response = await request.get(url); + checkHeaderValue(response, "cache-control", "no-store,no-cache"); + checkHeaderValue(response, "content-security-policy", expectedContentSecurityPolicyHeader); + checkHeaderValue(response, "cross-origin-resource-policy", "same-origin"); + checkHeaderValue(response, "referrer-policy", "no-referrer"); + checkHeaderValue(response, "strict-transport-security", "max-age=31536000;includeSubDomains"); + checkHeaderValue(response, "x-content-type-options", "nosniff"); + checkHeaderValue(response, "x-frame-options", "deny"); + checkHeaderValue(response, "x-xss-protection", "0"); + checkHeaderExists(response, "server"); + }); + }); + + pagesWithoutFormsOrRedirects.forEach((url) => { + test(`pages without forms that will not redirect if no date - no cookie banner - ${url} contains the expected response headers`, async ({ + context, + request + }) => { + + await setCookie(context, "%7B%22HasApproved%22%3Atrue%2C%22IsVisible%22%3Afalse%2C%22IsRejected%22%3Afalse%7D", cookiePreferencesCookieName); + + var response = await request.get(url); + checkHeaderValue(response, "cache-control", "no-store,no-cache"); + checkHeaderValue(response, "content-security-policy", expectedContentSecurityPolicyHeader); + checkHeaderValue(response, "cross-origin-resource-policy", "same-origin"); + checkHeaderValue(response, "referrer-policy", "no-referrer"); + checkHeaderValue(response, "strict-transport-security", "max-age=31536000;includeSubDomains"); + checkHeaderValue(response, "x-content-type-options", "nosniff"); + checkHeaderValue(response, "x-frame-options", "deny"); + checkHeaderValue(response, "x-xss-protection", "0"); + checkHeaderExists(response, "server"); + }); + + test(`pages without forms that will not redirect if no date - cookie banner showing - ${url} contains the expected response headers`, async ({request}) => { + var response = await request.get(url); + checkHeaderValue(response, "cache-control", "no-store,no-cache"); + checkHeaderValue(response, "content-security-policy", expectedContentSecurityPolicyHeader); + checkHeaderValue(response, "cross-origin-resource-policy", "same-origin"); + checkHeaderValue(response, "referrer-policy", "no-referrer"); + checkHeaderValue(response, "strict-transport-security", "max-age=31536000;includeSubDomains"); + checkHeaderValue(response, "x-content-type-options", "nosniff"); + checkHeaderValue(response, "x-frame-options", "deny"); + checkHeaderValue(response, "x-xss-protection", "0"); + checkHeaderExists(response, "server"); + }); + }); + + pagesWithoutFormsWithRedirects.forEach((url) => { + test(`pages without forms that will redirect if no date - no cookie banner - ${url} contains the expected response headers`, async ({ + context, + request + }) => { + await setCookie(context, "%7B%22HasApproved%22%3Atrue%2C%22IsVisible%22%3Afalse%2C%22IsRejected%22%3Afalse%7D", cookiePreferencesCookieName); + + var response = await request.get(url); + checkHeaderValue(response, "cache-control", "no-store,no-cache"); + checkHeaderValue(response, "content-security-policy", expectedContentSecurityPolicyHeader); + checkHeaderValue(response, "cross-origin-resource-policy", "same-origin"); + checkHeaderValue(response, "referrer-policy", "no-referrer"); + checkHeaderValue(response, "strict-transport-security", "max-age=31536000;includeSubDomains"); + checkHeaderValue(response, "x-content-type-options", "nosniff"); + checkHeaderValue(response, "x-frame-options", "deny"); + checkHeaderValue(response, "x-xss-protection", "0"); + checkHeaderExists(response, "server"); + }); + + test(`pages without forms that will redirect if no date - cookie banner showing - ${url} contains the expected response headers`, async ({ + context, + request + }) => { + await setCookie(context, '%7B%22WhenWasQualificationStarted%22%3A%227%2F2015%22%7D', journeyCookieName); + + var response = await request.get(url); + checkHeaderValue(response, "cache-control", "no-store,no-cache"); + checkHeaderValue(response, "content-security-policy", expectedContentSecurityPolicyHeader); + checkHeaderValue(response, "cross-origin-resource-policy", "same-origin"); + checkHeaderValue(response, "referrer-policy", "no-referrer"); + checkHeaderValue(response, "strict-transport-security", "max-age=31536000;includeSubDomains"); + checkHeaderValue(response, "x-content-type-options", "nosniff"); + checkHeaderValue(response, "x-frame-options", "deny"); + checkHeaderValue(response, "x-xss-protection", "0"); + checkHeaderExists(response, "server"); + }); + }); +}); \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/shared/urls-to-check.js b/tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/urls-to-check.ts similarity index 100% rename from tests/Dfe.EarlyYearsQualification.E2ETests/cypress/e2e/shared/urls-to-check.js rename to tests/Dfe.EarlyYearsQualification.E2ETests/tests/shared/urls-to-check.ts diff --git a/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/.env b/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/.env new file mode 100644 index 000000000..041b038f5 --- /dev/null +++ b/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/.env @@ -0,0 +1,3 @@ +WEBAPP_URL={URL OF THE HOME PAGE} +AUTH_SECRET={PASSWORD FOR ENVIRONMENT} +DOMAIN={DOMAIN FOR COOKIE TO BE ADDED TO (when local: localhost)} \ No newline at end of file diff --git a/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/package-lock.json b/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/package-lock.json index e24e4cf9d..d4b91a6e5 100644 --- a/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/package-lock.json +++ b/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/package-lock.json @@ -10,7 +10,8 @@ "license": "ISC", "devDependencies": { "@playwright/test": "^1.48.2", - "@types/node": "^22.9.0" + "@types/node": "^22.9.0", + "dotenv": "^16.4.7" } }, "node_modules/@playwright/test": { @@ -39,6 +40,19 @@ "undici-types": "~6.19.8" } }, + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", diff --git a/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/package.json b/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/package.json index ac4d7f851..ed1621744 100644 --- a/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/package.json +++ b/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/package.json @@ -9,6 +9,7 @@ "description": "", "devDependencies": { "@playwright/test": "^1.48.2", - "@types/node": "^22.9.0" + "@types/node": "^22.9.0", + "dotenv": "^16.4.7" } } diff --git a/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/playwright.config.ts b/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/playwright.config.ts index 11a608a65..423f82edf 100644 --- a/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/playwright.config.ts +++ b/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/playwright.config.ts @@ -8,6 +8,7 @@ import { defineConfig, devices } from '@playwright/test'; /** * See https://playwright.dev/docs/test-configuration. */ +require('dotenv').config(); export default defineConfig({ testDir: './tests', /* Run tests in files in parallel */ @@ -41,10 +42,10 @@ export default defineConfig({ use: { ...devices['Desktop Firefox'] }, }, - // { - // name: 'webkit', - // use: { ...devices['Desktop Safari'] }, - // }, + { + name: 'webkit', + use: { ...devices['Desktop Safari'] }, + }, /* Test against mobile viewports. */ // { diff --git a/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/tests/smoke-tests.spec.ts b/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/tests/smoke-tests.spec.ts index f2379031a..dc09606ff 100644 --- a/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/tests/smoke-tests.spec.ts +++ b/tests/Dfe.EarlyYearsQualification.SmokeTests/playwright/tests/smoke-tests.spec.ts @@ -2,48 +2,48 @@ import { test, expect } from '@playwright/test'; test.describe("A spec used to smoke test the environment once a deployment has happened", () => { test("should return search results", async ({ page, context }) => { - + // attempt to set cookie and navigate to start page - await context.addCookies([ - { name: 'auth-secret', value: process.env.AUTH_SECRET, path: '/', domain: process.env.WEBAPP_URL } - ]); - + await context.addCookies([ + { name: 'auth-secret', value: process.env.AUTH_SECRET, path: '/', domain: process.env.DOMAIN } + ]); + await page.goto("/"); - + //if we end up navigated to the challenge page, then fill in the password and continue if (page.url().includes("challenge")) { - await page.locator("#PasswordValue").type(process.env.AUTH_SECRET); + await page.locator("#PasswordValue").fill(process.env.AUTH_SECRET); await page.locator("#question-submit").click(); await page.waitForURL("/"); } - + // home page await expect(page.locator("#start-now-button")).toBeVisible(); await page.locator("#start-now-button").click(); // where-was-the-qualification-awarded page - await expect(page.url()).toContain("/questions/where-was-the-qualification-awarded"); + expect(page.url()).toContain("/questions/where-was-the-qualification-awarded"); await page.locator("#england").click(); await page.locator("#question-submit").click(); // when-was-the-qualification-started page - await expect(page.url()).toContain("/questions/when-was-the-qualification-started"); - await page.locator("#date-started-month").type("7"); - await page.locator("#date-started-year").type("2015"); + expect(page.url()).toContain("/questions/when-was-the-qualification-started"); + await page.locator("#date-started-month").fill("7"); + await page.locator("#date-started-year").fill("2015"); await page.locator("#question-submit").click(); // what-level-is-the-qualification page - await expect(page.url()).toContain("/questions/what-level-is-the-qualification"); + expect(page.url()).toContain("/questions/what-level-is-the-qualification"); await page.locator('input[id="0"]').click(); await page.locator("#question-submit").click(); // what-is-the-awarding-organisation page - await expect(page.url()).toContain("/questions/what-is-the-awarding-organisation"); + expect(page.url()).toContain("/questions/what-is-the-awarding-organisation"); await page.locator("#awarding-organisation-not-in-list").click(); await page.locator("#question-submit").click(); // qualifications page - await expect(page.url()).toContain("/qualifications"); + expect(page.url()).toContain("/qualifications"); // If this shows then no qualifications are getting returned indicating possible issue await expect(page.locator("#no-result-content")).not.toBeVisible(); });