Skip to content

Commit 8b057b2

Browse files
committed
Fix github actions
1 parent 5ffc34f commit 8b057b2

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

docs/src/about/code.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ By running the command below you can run the full test suite:
4040
nox -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

tests/conftest.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import asyncio
2+
import os
23
import sys
34

45
import pytest
56
from playwright.async_api import async_playwright
67
from reactpy.testing import BackendFixture, DisplayFixture
78

9+
GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS", "").lower() == "true"
10+
811

912
def 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
3437
async 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"))

0 commit comments

Comments
 (0)