Skip to content

Commit

Permalink
Add CircleCI Config for playwright tests
Browse files Browse the repository at this point in the history
  • Loading branch information
holtchesley committed Feb 2, 2022
1 parent 5f1e6bd commit e78d8a3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ jobs:
docker-compose exec app python -m webrecorder.admin -c [email protected] public Test123Test123 archivist 'Info at Perma.cc'
docker-compose exec web pipenv run pytest \
--junitxml=junit/pytest/test-results.xml `# write test results so they can be displayed by circleci` \
--cov --cov-config=setup.cfg --cov-report xml `# write coverage data to coverage.xml for upload by codecov` \
--cov --cov-config=setup.cfg --cov-report xml `# write coverage data to coverage.xml for upload by codecov`
docker-compose exec -d web pipenv run fab run
sleep 10
docker-compose exec playwright pipenv run pytest --browser chromium --browser firefox --browser webkit
# Upload test details to circleci
- store_test_results:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ services:
- "127.0.0.1:4444:4444"
networks:
- default

#
#
# Perma Functional Tests
#
playwright:
build:
context: .
dockerfile: ./playwright/Dockerfile
image: perma-playwright:0.00314
image: perma-playwright:0.00314159
volumes:
- ./playwright:/playwright:delegated
environment:
Expand Down
6 changes: 2 additions & 4 deletions playwright/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM mcr.microsoft.com/playwright:v1.18.1-focal-amd64

ARG DEBIAN_FRONTEND=noninteractive
ARG TZ=America/Los_Angeles
ARG BUILDARCH=amd64
FROM mcr.microsoft.com/playwright:v1.18.1-focal-${BUILDARCH}

RUN apt-get update \
&& apt-get install -y python3.8 python3-pip \
Expand Down
4 changes: 0 additions & 4 deletions playwright/tests/test_functional.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import pytest
import re
from settings import urls, logins


two_minutes = 120*1000

Expand Down Expand Up @@ -32,5 +30,3 @@ def test_example_dot_com(logged_in_user):
replay_frame = logged_in_user.frame('https://example.com/')
assert logged_in_user.title() == 'Perma | Example Domain'
assert "Example Domain" in replay_frame.locator('h1').text_content()


0 comments on commit e78d8a3

Please sign in to comment.