Skip to content

Commit

Permalink
Create testsE2E.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
maathzzz authored Jan 10, 2025
1 parent 4f867c8 commit cca38bf
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/testsE2E.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Run Playwright E2E Tests

on:
workflow_dispatch:
inputs:
branch:
description: 'Use workflow from branch'
required: true
type: string

jobs:
e2e-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}

- name: Set TEST_URL variable
run: |
if [[ "${{ github.event.inputs.branch }}" == "staging" ]]; then
echo "TEST_URL=https://kingpanda.dev/" >> $GITHUB_ENV
elif [[ "${{ github.event.inputs.branch }}" == "master" ]]; then
echo "TEST_URL=https://kingpanda.bet.br/" >> $GITHUB_ENV
else
BRANCH_LOWER=$(echo "${{ github.event.inputs.branch }}" | tr '[:upper:]' '[:lower:]')
echo "TEST_URL=https://$BRANCH_LOWER.kingpanda-front.pages.dev" >> $GITHUB_ENV
fi
- name: Install dependencies
run: npm install

- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Run Playwright tests
run: npx playwright test

- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30

0 comments on commit cca38bf

Please sign in to comment.