Skip to content

Playwright tests / schedule #6

Playwright tests / schedule

Playwright tests / schedule #6

Workflow file for this run

name: "Playwright Tests"
run-name: Playwright tests / ${{ github.event.pull_request.title || github.event_name }}
on:
schedule:
- cron: "0 1 * * 5"
workflow_dispatch:
env:
IMAGE: ${{ vars.DOCKERHUB_ORG_NAME }}/neon_tests
CONTAINER: services-${{ github.run_id }}
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
jobs:
dockerize:
if: ${{ github.ref_name != 'develop'}}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: "Dockerize neon tests"
id: requirements
uses: ./.github/actions/dockerize-neon-tests
with:
image_tag: ${{ github.sha }}
docker_username: ${{ secrets.DOCKER_USERNAME }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}
playwright:
name: "Playwright UI tests"
needs:
- dockerize
if: |
always() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
NETWORK: "devnet"
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Define image tag"
id: image_tag
uses: ./.github/actions/define-image-tag
- name: "Pull Docker Test Image"
run: docker pull ${{ env.IMAGE }}:${{ steps.image_tag.outputs.tag }}
- name: "Run docker container"
run: |
docker run -i -d --name=${{ env.CONTAINER }} \
-e CHROME_EXT_PASSWORD=${{ secrets.CHROME_EXT_PASSWORD }} \
--entrypoint /bin/bash ${{ env.IMAGE }}:${{ steps.image_tag.outputs.tag }}
- name: "Run Playwright Tests"
run: |
docker exec -i ${{ env.CONTAINER }} \
xvfb-run python3 ./clickfile.py run ui --network=${{ env.NETWORK }} --ui-item=neonpass
- name: "Generate allure report"
if: always()
uses: ./.github/actions/generate-allure-report
with:
container: ${{ env.CONTAINER }}
network: ${{ env.NETWORK }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
tests_name: ui
- name: "Notify on failure"
if: failure() && github.ref_name == 'develop'
run: |
docker exec -i ${{ env.CONTAINER }} \
python3 ./clickfile.py send-notification \
-u ${{ secrets.SLACK_QA_CHANNEL_URL }} \
-b ${{ env.BUILD_URL }} \
-n ${{ env.NETWORK }}
- name: Remove docker container
if: always()
run: docker rm -f ${{ env.CONTAINER }}