File tree 2 files changed +7
-6
lines changed
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:
40
40
nox -t test
41
41
```
42
42
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:
46
44
47
45
``` bash linenums="0"
48
- nox -t test -- --headed
46
+ nox -t test -- --headless
49
47
```
50
48
51
49
## Creating a pull request
Original file line number Diff line number Diff line change 1
1
import asyncio
2
+ import os
2
3
import sys
3
4
4
5
import pytest
5
6
from playwright .async_api import async_playwright
6
7
from reactpy .testing import BackendFixture , DisplayFixture
7
8
9
+ GITHUB_ACTIONS = os .getenv ("GITHUB_ACTIONS" , "" ).lower () == "true"
10
+
8
11
9
12
def pytest_addoption (parser ) -> None :
10
13
parser .addoption (
11
14
"--headless" ,
12
15
dest = "headless" ,
13
- action = "store_false " ,
16
+ action = "store_true " ,
14
17
help = "Hide the browser window when running web-based tests" ,
15
18
)
16
19
@@ -33,4 +36,4 @@ async def backend():
33
36
@pytest .fixture
34
37
async def browser (pytestconfig ):
35
38
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