File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,10 @@ By running the command below you can run the full test suite:
4040nox -t test
4141```
4242
43- Or, if you want to run the tests in the foreground with a visible browser window, run:
44-
45- <!-- TODO: Change `headed` to `headless` -->
43+ Or, if you want to run the tests in the background run:
4644
4745``` bash linenums="0"
48- nox -t test -- --headed
46+ nox -t test -- --headless
4947```
5048
5149## Creating a pull request
Original file line number Diff line number Diff line change 11import asyncio
2+ import os
23import sys
34
45import pytest
56from playwright .async_api import async_playwright
67from reactpy .testing import BackendFixture , DisplayFixture
78
9+ GITHUB_ACTIONS = os .getenv ("GITHUB_ACTIONS" , "" ).lower () == "true"
10+
811
912def pytest_addoption (parser ) -> None :
1013 parser .addoption (
1114 "--headless" ,
1215 dest = "headless" ,
13- action = "store_false " ,
16+ action = "store_true " ,
1417 help = "Hide the browser window when running web-based tests" ,
1518 )
1619
@@ -33,4 +36,4 @@ async def backend():
3336@pytest .fixture
3437async def browser (pytestconfig ):
3538 async with async_playwright () as pw :
36- yield await pw .chromium .launch (headless = False )
39+ yield await pw .chromium .launch (headless = True if GITHUB_ACTIONS else pytestconfig . getoption ( "headless" ) )
You can’t perform that action at this time.
0 commit comments