@@ -149,14 +149,21 @@ clean-js: FORCE
149149SUB_FILE: =
150150PYTEST_BROWSERS: = --browser webkit --browser firefox --browser chromium
151151PYTEST_DEPLOYS_BROWSERS: = --browser chromium
152+
153+ # Full test path to playwright tests
154+ TEST_FILE: =tests/playwright/$(SUB_FILE )
155+ # Default `make` values that shouldn't be directly used; (Use `TEST_FILE` instead!)
156+ DEPLOYS_TEST_FILE: =tests/playwright/deploys$(SUB_FILE )
157+ SHINY_TEST_FILE: =tests/playwright/shiny/$(SUB_FILE )
158+ EXAMPLES_TEST_FILE: =tests/playwright/examples/$(SUB_FILE )
159+
152160install-playwright : FORCE
153161 playwright install --with-deps
154162
155163install-rsconnect : FORCE
156164 pip install git+https://github.com/rstudio/rsconnect-python.git#egg=rsconnect-python
157165
158- # Full test path to playwright tests
159- TEST_FILE: ="tests/playwright/$(SUB_FILE ) "
166+
160167# All end-to-end tests with playwright
161168playwright : install-playwright # # All end-to-end tests with playwright; (TEST_FILE="" from root of repo)
162169 pytest $(TEST_FILE ) $(PYTEST_BROWSERS )
@@ -169,20 +176,18 @@ playwright-show-trace: ## Show trace of failed tests
169176
170177# end-to-end tests with playwright; (SUB_FILE="" within tests/playwright/shiny/)
171178playwright-shiny : FORCE
172- $(MAKE ) playwright TEST_FILE=" tests/playwright/shiny/ $( SUB_FILE ) "
179+ $(MAKE ) playwright TEST_FILE=" $( SHINY_TEST_FILE ) "
173180
174181# end-to-end tests on deployed apps with playwright; (SUB_FILE="" within tests/playwright/deploys/)
175182playwright-deploys : FORCE
176- $(MAKE ) playwright PYTEST_BROWSERS=" $( PYTEST_DEPLOYS_BROWSERS) " TEST_FILE=" $( TEST_FILE) "
177- playwright-deploys-legacy : FORCE
178- $(MAKE ) playwright TEST_FILE=" tests/playwright/deploys/$( SUB_FILE) " PYTEST_BROWSERS=" $( PYTEST_DEPLOYS_BROWSERS) "
183+ $(MAKE ) playwright PYTEST_BROWSERS=" $( PYTEST_DEPLOYS_BROWSERS) " TEST_FILE=" $( DEPLOYS_TEST_FILE) "
179184
180185# end-to-end tests on all py-shiny examples with playwright; (SUB_FILE="" within tests/playwright/examples/)
181186playwright-examples : FORCE
182- $(MAKE ) playwright TEST_FILE=" tests/playwright/examples/ $( SUB_FILE ) "
187+ $(MAKE ) playwright TEST_FILE=" $( EXAMPLES_TEST_FILE ) "
183188
184189coverage : FORCE # # check combined code coverage (must run e2e last)
185- pytest --cov-report term-missing --cov=shiny tests/pytest/ tests/playwright/shiny/ $( SUB_FILE ) $(PYTEST_BROWSERS )
190+ pytest --cov-report term-missing --cov=shiny tests/pytest/ $( SHINY_TEST_FILE ) $(PYTEST_BROWSERS )
186191 coverage html
187192 $(BROWSER ) htmlcov/index.html
188193
0 commit comments