Skip to content

Commit

Permalink
Merge pull request #1924 from alphagov/reorganise-and-fix-plugin-tests
Browse files Browse the repository at this point in the history
Reorganise and fix plugin tests
  • Loading branch information
BenSurgisonGDS authored Jan 23, 2023
2 parents d2cc61c + 9b3eae1 commit 5f2a89e
Show file tree
Hide file tree
Showing 16 changed files with 10 additions and 237 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test-acceptance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
matrix:
node-version: [18.x]
os: [macos-latest, windows-latest, ubuntu-latest]
env: [smoke, dev, prod]
type: [smoke, plugins, dev, prod]

name: Acceptance ${{ matrix.env }} test kit on Node v${{ matrix.node-version }} (${{ matrix.os }})
name: Acceptance ${{ matrix.type }} test kit on Node v${{ matrix.node-version }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 45
timeout-minutes: 20

env:
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
Expand All @@ -43,7 +43,7 @@ jobs:

- run: npm ci

- run: npm run test:acceptance:${{ matrix.env }}
- run: npm run test:acceptance:${{ matrix.type }}
env:
CYPRESS_REQUEST_TIMEOUT: 20000
CYPRESS_DEFAULT_COMMAND_TIMEOUT: 40000
Expand All @@ -53,6 +53,6 @@ jobs:
- if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: cypress-screenshots-${{ matrix.env }}-${{ runner.os }}-${{ matrix.node-version }}
name: cypress-screenshots-${{ matrix.type }}-${{ runner.os }}-${{ matrix.node-version }}
path: cypress/screenshots/

41 changes: 0 additions & 41 deletions .github/workflows/test-download.yaml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/test-plugins.yaml

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe('Management plugins: ', () => {
cy.get('a[href*="/templates"]')
.should('contains.text', 'Templates').click()

cy.get('h2').eq(2).should('contain.text', pluginName)
cy.get('h2').contains(pluginName)

cy.task('log', `Create a new ${pluginPageTitle} page`)

Expand All @@ -150,8 +150,7 @@ describe('Management plugins: ', () => {
.should('contains.text', `Create new ${pluginPageTitle} page`)
cy.get('#chosen-url')
.type(pluginPagePath)
cy.get('.govuk-button')
.should('contains.text', 'Create page').click()
cy.get('.govuk-button').contains('Create page').click()

provePluginFunctionalityWorks()
})
Expand Down Expand Up @@ -217,8 +216,7 @@ describe('Management plugins: ', () => {
const pkg = 'invalid-prototype-kit-plugin'
const pluginName = 'Invalid Prototype Kit Plugin'
cy.visit(`${managePluginsPagePath}/install?package=${encodeURIComponent(pkg)}`)
cy.get('h2')
.should('contains.text', `Install ${pluginName}`)
cy.get('h2').contains(`Install ${pluginName}`)
failAction()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Management plugins: ', () => {
})

it(`Preview a ${plugin}${version2} template`, () => {
cy.get('h2').eq(2).should('contain.text', pluginName)
cy.get('h2').contains(pluginName)

cy.task('log', `Preview the ${pluginPageTitle} template`)

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/smoke/0-smoke-tests/index-page.cypress.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
specify('index page', () => {
cy.visit('/')
cy.contains('GOV.UK Prototype Kit')
cy.get('h2').contains('GOV.UK Prototype Kit')
})

specify('GOV.UK Frontend fonts loaded', () => {
Expand Down

0 comments on commit 5f2a89e

Please sign in to comment.