Skip to content

Commit e1678a1

Browse files
authored
fix playwright bis (#1333)
* test CI * skip failing tests * fix import error * skip collatz until fixed * skip computedvars until fixed * longer timeout, remove skips * longer timeout * longer timeout * try something different * sigh try again * :( * whitelist page for faster tests and rmeove skips * fix tests * misfixed the test * fix tests again * laxer condition in test * fix test again * clean up code
1 parent 5a7d6eb commit e1678a1

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

pcweb/whitelist.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
WHITELISTED_PAGES = []
1414

15+
1516
def _check_whitelisted_path(path: str):
1617
if len(WHITELISTED_PAGES) == 0:
1718
return True

tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,17 @@
88
@pytest.fixture(scope="session")
99
def reflex_web_app():
1010
app_root = Path(__file__).parent.parent
11+
from pcweb.whitelist import WHITELISTED_PAGES
12+
13+
WHITELISTED_PAGES.extend(
14+
[
15+
"/docs/events",
16+
"/docs/vars",
17+
"/docs/getting-started",
18+
"/docs/library/graphing",
19+
"/docs/api-reference/special-events",
20+
]
21+
)
22+
1123
with AppHarness.create(root=app_root) as harness:
1224
yield harness

tests/test_background_events.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import re
32

43
import pytest
@@ -14,15 +13,14 @@ def background_events_url() -> str:
1413
return docs.events.background_events.path
1514

1615

17-
@pytest.mark.skipif(
18-
os.environ.get("GITHUB_ACTIONS") is not None, reason="Consistently fails in CI"
19-
)
2016
def test_background_events(
2117
reflex_web_app: AppHarness,
2218
page: Page,
2319
background_events_url: str,
2420
):
2521
assert reflex_web_app.frontend_url is not None
22+
page.set_default_timeout(60000)
23+
page.set_default_navigation_timeout(60000)
2624

2725
page.goto(reflex_web_app.frontend_url + background_events_url)
2826
expect(page).to_have_url(re.compile(background_events_url))
@@ -36,7 +34,8 @@ def test_background_events(
3634
expect(heading).to_have_text("0 /")
3735

3836
start_button.click()
39-
expect(heading).to_have_text("4 /")
37+
expect(heading).to_have_text(re.compile(r"[4-7] /"))
38+
4039
reset_button.click()
4140
expect(heading).to_have_text("0 /")
42-
expect(heading).to_have_text("10 /")
41+
expect(heading).to_have_text("10 /", timeout=12000)

tests/test_chaining_event.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import re
32
import time
43

@@ -15,9 +14,6 @@ def chaining_event_url() -> str:
1514
return docs.events.chaining_events.path
1615

1716

18-
@pytest.mark.skipif(
19-
os.environ.get("GITHUB_ACTIONS") is not None, reason="Consistently fails in CI"
20-
)
2117
def test_handler_from_handler(
2218
reflex_web_app: AppHarness,
2319
page: Page,

0 commit comments

Comments
 (0)