-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manually trigger cypress tests against desired branch (#1049)
- Loading branch information
1 parent
ba5b2e9
commit 89871ce
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Run Cypress Accessibility checks | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
env: | ||
NODE_VERSION: 18.x | ||
|
||
jobs: | ||
cypress-tests: | ||
name: Run Cypress Tests | ||
runs-on: ubuntu-latest | ||
environment: dev | ||
defaults: | ||
run: | ||
working-directory: Dfe.PrepareConversions/Dfe.PrepareConversions.CypressTests | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Setup node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Npm install | ||
run: npm install | ||
|
||
- name: Run cypress (dev) | ||
run: npm run cy:run -- --env url='${{ secrets.AZURE_ENDPOINT }}',cypressTestSecret='${{ secrets.CYPRESS_TEST_SECRET }}, academisationApiUrl=${{secrets.CYPRESS_ACADEMISATION_API_URL}}, academisationApiKey=${{ secrets.CYPRESS_ACADEMISATION_API_KEY}}' | ||
env: | ||
db: ${{ secrets.DB_CONNECTION_STRING }} | ||
|
||
- name: Upload screenshots | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: screenshots-dev | ||
path: Dfe.PrepareConversions/Dfe.PrepareConversions.CypressTests/cypress/screenshots | ||
|
||
- name: Generate report | ||
if: always() | ||
run: | | ||
mkdir mochareports | ||
npm run generate:html:report | ||
- name: Upload report | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: reports-dev | ||
path: Dfe.PrepareConversions/Dfe.PrepareConversions.CypressTests/mochareports | ||
|
||
- name: Report results | ||
if: always() | ||
run: npm run cy:notify -- --custom-text="Environment dev, See more information https://github.com/DFE-Digital/prepare-academy-conversions/actions/runs/${{github.run_id}}" | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |