Skip to content

Playwright

Playwright #1

Workflow file for this run

name: Playwright
on:
workflow_dispatch:
jobs:
deploy-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy test stack
run: |
chmod +x ./others/cicd/simci
export PORTAINER_API_TOKEN="${{ secrets.PORTAINER_API_TOKEN }}"
export IO_PASSWORD="${{ secrets.IO_PASSWORD }}"
./others/cicd/simci portainer-stack-delete gitlab-simfeatures "${{ secrets.PORTAINER_URL }}"
./others/cicd/simci portainer-stack-deploy -f ./others/cicd/portainer-stack.yml gitlab-simfeatures "${{ secrets.PORTAINER_URL }}"
playwright-tests:
runs-on: ubuntu-latest
needs: deploy-test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Playwright dependencies
working-directory: ./others/playwright
run: npm ci
- name: Install Playwright browsers
working-directory: ./others/playwright
run: npx playwright install
- name: Wait for app to be ready
run: |
APP_URL="https://gitlab-simfeatures.${{ secrets.PORTAINER_URL }}/ui"
for i in $(seq 1 30); do
if curl -sf -o /dev/null "$APP_URL"; then
echo "App is ready"
break
fi
echo "Waiting for app... ($i/30)"
sleep 10
done
curl -sf -o /dev/null "$APP_URL" || (echo "App failed to become ready" && exit 1)
- name: Run Playwright tests
working-directory: ./others/playwright
env:
CI: true
BASE_URL: "https://gitlab-simfeatures.${{ secrets.PORTAINER_URL }}/ui"
USER_NAME: user
PASSWORD: ${{ secrets.PLAYWRIGHT_PASSWORD }}
run: npx playwright test --project=firefox
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: others/playwright/playwright-report/
retention-days: 7