commit 6f13c9433d85dba97d50c1eb5681ecf3b07100e5
parent 5be9e36e8c1e3c7841be070a678a28776cddeba2
Author: Asher Morgan <59518073+ashermorgan@users.noreply.github.com>
Date: Sat, 20 Apr 2024 09:30:06 -0700
Update e2e tests and GitHub actions
Diffstat:
2 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
@@ -11,13 +11,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Set up Python
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.12'
+ cache: 'pip'
- name: Install dependencies
- run: pip3 install -r requirements.txt
+ run: pip install -r requirements.txt
+
+ - name: Install playwright browsers
+ run: playwright install
- name: Run tests with pytest
- run: python3 -m pytest
+ run: python -m pytest
diff --git a/tests/test_e2e.py b/tests/test_e2e.py
@@ -1,3 +1,4 @@
+import os
import pytest
from playwright.sync_api import Page, expect
from xprocess import ProcessStarter
@@ -9,10 +10,8 @@ def api(xprocess):
class Starter(ProcessStarter):
pattern = '.*Running.*'
timeout = 10
- args = ['python3', '-m', 'flask', '--app', '../../../../mock_api.py', 'run']
- env = {
- 'FLASK_RUN_PORT': port,
- }
+ args = ['python', '-m', 'flask', '--app', '../../../../mock_api.py',
+ 'run', '--port', port]
# Start API
xprocess.ensure('api', Starter)
@@ -29,11 +28,9 @@ def server(xprocess, api):
class Starter(ProcessStarter):
pattern = '.*Running.*'
timeout = 10
- args = ['python3', '-m', 'flask', '--app', '../../../../songs2slides', 'run']
- env = {
- 'API_URL': api + '/{title}/{artist}/',
- 'FLASK_RUN_PORT': port,
- }
+ args = ['python', '-m', 'flask', '--app', '../../../../songs2slides',
+ 'run', '--port', port]
+ env = os.environ | { 'API_URL': api + '/{title}/{artist}/' }
# Start server
xprocess.ensure('server', Starter)