Skip to content

E2E Tests

E2E Tests #82

# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: E2E Tests
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
release_tag:
description: 'New Release Name'
permissions:
contents: read
jobs:
send_starting_slack_notification:
name: Send Starting Slack Notification
runs-on: ubuntu-latest
steps:
- name: Send E2E Starting Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_TITLE: 'Starting E2E Tests'
SLACK_FOOTER: ''
MSG_MINIMAL: true
SLACK_MESSAGE: 'E2E Tests Starting'
cypress_tests:
name: E2E Tests
runs-on: ubuntu-latest
environment: development
needs: [ send_starting_slack_notification ]
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Cypress dependencies
working-directory: ./cypress
run: |
npm install
- name: Update Config file and Run Tests
if: ${{!always()}}
working-directory: ./cypress
run: |
sed -i -e "s/base_url: \'.*\'/base_url: \'${{vars.BASE_URL}}\'/g" cypress.config.ts
sed -i -e "s/username: \'.*\'/username: \'${{vars.NON_ADMIN_USER}}\'/g" cypress.config.ts
sed -i -e "s/password: \'.*\'/password: \'${{secrets.NON_ADMIN_PASS}}\'/g" cypress.config.ts
sed -i -e "s/account_id: \'.*\'/account_id: \'${{vars.AWS_ACCOUNT}}\'/g" cypress.config.ts
npm run cypress:run
send_final_slack_notification:
name: Send E2E Finished Notification
needs: [cypress_tests]
runs-on: ubuntu-latest
if: always()
steps:
- name: Send GitHub Action trigger data to Slack workflow
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_COLOR: ${{ contains(join(needs.*.result, ' '), 'failure') && 'failure' || 'success' }}
SLACK_TITLE: 'E2E Tests Finished'
SLACK_FOOTER: ''
MSG_MINIMAL: 'actions url,commit'
SLACK_MESSAGE_ON_FAILURE: '<!here> E2E Tests FAILED on branch ${{ github.head_ref || github.ref_name }} for <${{ github.event.pull_request.html_url || github.event.head_commit.url }}|commit>'
SLACK_MESSAGE_ON_SUCCESS: 'E2E Tests SUCCESS on branch ${{ github.head_ref || github.ref_name }} for <${{ github.event.pull_request.html_url || github.event.head_commit.url }}|commit>.'
SLACK_MESSAGE: 'E2E Tests Finished with status ${{ job.status }} on branch ${{ github.head_ref || github.ref_name }} for <${{ github.event.pull_request.html_url || github.event.head_commit.url }}|commit>'