Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End-to-end testing - playwright CI #361

Merged
merged 19 commits into from
Jan 8, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tests: update github action to run playwright CI tests
  • Loading branch information
osundwajeff committed Feb 21, 2024
commit 6053283c10d541f04a5cf2853be0366b21dcf775
35 changes: 34 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
working-directory: dockerize
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 20

- name: Run docker-compose build
run: docker-compose build
Expand All @@ -57,7 +60,7 @@ jobs:
run: |
cat << EOF | docker-compose exec -T devweb bash
pip install coverage
python manage.py makemigrations
python manage.py makemigrations --merge --noinput
python manage.py migrate
coverage run manage.py test
coverage xml
Expand All @@ -68,3 +71,33 @@ jobs:
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Start Django server
run: |
docker-compose exec -T devweb bash -c "python manage.py loaddata fixtures/*.json"
sleep 10
docker-compose exec -T devweb bash -c "nohup python manage.py runserver 0.0.0.0:8080 &"

- name: Test django endpoint
run: |
curl -v http://0.0.0.0:62202
if [ $? -ne 0 ]; then
echo "Curl command failed"
exit 1
fi

- name: Install playwright dependencies
working-directory: playwright/ci-test
run: |
npm install
npm ci
npx playwright install --with-deps
- name: Run Playwright tests
working-directory: playwright/ci-test
run: npx playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright/ci-test/playwright-report/
retention-days: 30