File tree Expand file tree Collapse file tree
record_a_mammogram/tests/system Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1-
2-
31include scripts/shared.mk
42
53clean :: _clean-docker # Clean-up project resources (main) @Operations
@@ -19,6 +17,7 @@ dependencies: # Install dependencies needed to build and test the project @Pipel
1917
2018assets : # Compile assets @Pipeline
2119 npm run compile
20+ poetry run playwright install
2221
2322build : # Build the project artefact @Pipeline
2423 docker build -t " app:$$ (git rev-parse HEAD)" .
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ To run all the tests:
4242make test
4343```
4444
45+ Running ` make config ` beforehand will ensure you have necessary dependencies installed, including the browser needed by playwright for system tests.
46+
4547### Dependency management
4648Python dependencies are managed via [ poetry] ( https://python-poetry.org/docs/basic-usage/ ) .
4749
Original file line number Diff line number Diff line change 11from django .contrib .staticfiles .testing import StaticLiveServerTestCase
22import os
3- from playwright .sync_api import sync_playwright , expect
3+ from playwright .sync_api import sync_playwright
44
55class SystemTestCase (StaticLiveServerTestCase ):
66 @classmethod
@@ -18,6 +18,7 @@ def tearDownClass(cls):
1818
1919 def setUp (self ):
2020 self .page = self .browser .new_page ()
21+ self .page .set_default_timeout (5000 )
2122
2223 def tearDown (self ):
2324 self .page .close ()
Original file line number Diff line number Diff line change 11import re
2+ import pytest
23from django .urls import reverse
34from playwright .sync_api import expect
45
78from manage_breast_screening .participants .tests .factories import ParticipantFactory
89from manage_breast_screening .clinics .models import Appointment
910
10- class UserSubmitsCannotGoAheadForm (SystemTestCase ):
11- def setUp ( self ):
12- super (). setUp ()
11+ class TestUserSubmitsCannotGoAheadForm (SystemTestCase ):
12+ @ pytest . fixture ( autouse = True )
13+ def before ( self ):
1314 self .participant = ParticipantFactory ()
1415 self .screening_episode = ScreeningEpisodeFactory (participant = self .participant )
1516 self .appointment = AppointmentFactory (screening_episode = self .screening_episode )
You can’t perform that action at this time.
0 commit comments