Skip to content

Node.js CI and Playwright Tests #35

Node.js CI and Playwright Tests

Node.js CI and Playwright Tests #35

Workflow file for this run

name: 'Node.js CI and Playwright Tests'
on:
workflow_dispatch:
schedule:
# Test 3 times a day
- cron: '0 */8 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: ['14.21.3']
steps:
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v4
- name: Start MySQL service
run: |
sudo systemctl start mysql.service
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies of back-end and start building and running
working-directory: source/back-end
run: |
npm install
npm run start &
- name: Install dependencies of front-end and start building and running
working-directory: source/front-end
run: |
npm install
npm run serve &
- name: Ensure browsers are installed
run: playwright install --with-deps
# # Run the registration test first
# - name: Run the registration test
# run: pytest source/test/system-test/test_register.py
- name: Run MySQL database tests first
run: |
pytest source/test/test_import_sql.py source/test/test_mysql_login.py
- name: Run all tests
# run: pytest source/test/system-test/*.py
run: |
pytest --tracing on
- name: Upload trace files as artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-trace
path: test-results/