@@ -149,14 +149,21 @@ clean-js: FORCE
149
149
SUB_FILE: =
150
150
PYTEST_BROWSERS: = --browser webkit --browser firefox --browser chromium
151
151
PYTEST_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
+
152
160
install-playwright : FORCE
153
161
playwright install --with-deps
154
162
155
163
install-rsconnect : FORCE
156
164
pip install git+https://github.com/rstudio/rsconnect-python.git#egg=rsconnect-python
157
165
158
- # Full test path to playwright tests
159
- TEST_FILE: ="tests/playwright/$(SUB_FILE ) "
166
+
160
167
# All end-to-end tests with playwright
161
168
playwright : install-playwright # # All end-to-end tests with playwright; (TEST_FILE="" from root of repo)
162
169
pytest $(TEST_FILE ) $(PYTEST_BROWSERS )
@@ -169,20 +176,18 @@ playwright-show-trace: ## Show trace of failed tests
169
176
170
177
# end-to-end tests with playwright; (SUB_FILE="" within tests/playwright/shiny/)
171
178
playwright-shiny : FORCE
172
- $(MAKE ) playwright TEST_FILE=" tests/playwright/shiny/ $( SUB_FILE ) "
179
+ $(MAKE ) playwright TEST_FILE=" $( SHINY_TEST_FILE ) "
173
180
174
181
# end-to-end tests on deployed apps with playwright; (SUB_FILE="" within tests/playwright/deploys/)
175
182
playwright-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) "
179
184
180
185
# end-to-end tests on all py-shiny examples with playwright; (SUB_FILE="" within tests/playwright/examples/)
181
186
playwright-examples : FORCE
182
- $(MAKE ) playwright TEST_FILE=" tests/playwright/examples/ $( SUB_FILE ) "
187
+ $(MAKE ) playwright TEST_FILE=" $( EXAMPLES_TEST_FILE ) "
183
188
184
189
coverage : 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 )
186
191
coverage html
187
192
$(BROWSER ) htmlcov/index.html
188
193
0 commit comments