Skip to content

Playwright Tests

Playwright Tests #11

Workflow file for this run

name: Playwright Tests
on:
# push:
# branches: [ main, master ]
# pull_request:
# branches: [ main, master ]
workflow_dispatch:
inputs:
number_of_runs:
description: 'Number of runs'
required: true
type: number
# jobs:
# test:
# timeout-minutes: 5
# runs-on: ubuntu-latest
# strategy:
# max-parallel: 30
# matrix:
# instance: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
echo "Creating a matrix with ${{ github.event.inputs.number_of_runs }} runs"
matrix="{\"instance\": ["
for i in $(seq 1 ${{ github.event.inputs.number_of_runs }}); do
matrix+="\"$i\""
if [ $i -lt ${{ github.event.inputs.number_of_runs }} ]; then
matrix+=", "
fi
done
matrix+="]}"
echo "Matrix: $matrix"
echo "::set-output name=matrix::$matrix"
test:
needs: setup-matrix
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
max-parallel: 30
matrix: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
with:
repository: macnev2013/p_pw_mg
token: ${{ secrets.ACCESS_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Ensure browsers are installed
run: python -m playwright install
- name: Run
run: 1. python main.py
env:
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
LOGIN_URL: ${{ secrets.LOGIN_URL }}
BROWSER_STATE: ${{ secrets.BROWSER_STATE_1 }}
- name: Run
run: 2. python main.py
env:
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
LOGIN_URL: ${{ secrets.LOGIN_URL }}
BROWSER_STATE: ${{ secrets.BROWSER_STATE_1 }}
- name: Run
run: 3. python main.py
env:
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
LOGIN_URL: ${{ secrets.LOGIN_URL }}
BROWSER_STATE: ${{ secrets.BROWSER_STATE_1 }}
- name: Run
run: 4. python main.py
env:
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
LOGIN_URL: ${{ secrets.LOGIN_URL }}
BROWSER_STATE: ${{ secrets.BROWSER_STATE_1 }}
- name: Run
run: 5. python main.py
env:
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
LOGIN_URL: ${{ secrets.LOGIN_URL }}
BROWSER_STATE: ${{ secrets.BROWSER_STATE_1 }}
- name: Run
run: 6. python main.py
env:
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
LOGIN_URL: ${{ secrets.LOGIN_URL }}
BROWSER_STATE: ${{ secrets.BROWSER_STATE_1 }}
- name: Run
run: 7. python main.py
env:
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
LOGIN_URL: ${{ secrets.LOGIN_URL }}
BROWSER_STATE: ${{ secrets.BROWSER_STATE_1 }}
- name: Run
run: 8. python main.py
env:
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
LOGIN_URL: ${{ secrets.LOGIN_URL }}
BROWSER_STATE: ${{ secrets.BROWSER_STATE_1 }}
- name: Run
run: 9. python main.py
env:
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
LOGIN_URL: ${{ secrets.LOGIN_URL }}
BROWSER_STATE: ${{ secrets.BROWSER_STATE_1 }}
- name: Run
run: 10. python main.py
env:
EMAIL: ${{ secrets.EMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
LOGIN_URL: ${{ secrets.LOGIN_URL }}
BROWSER_STATE: ${{ secrets.BROWSER_STATE_1 }}