instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
a_file.parent.mkdir(exist_ok=True)
with metadata_file.open("a+") as f:
fcntl.flock(f.fileno(), fcntl.LOCK_EX)
f.seek(0)
try:
content = f.read()
metadata = json.loads(conte... |
traceback.print_exc()
else:
if report.failed:
print(f"No video available for failed test: {item.name}")
video_dir = Path("test-videos")
if video_dir.exists():
import time
recent_videos = [
... | import traceback |
try:
content = f.read()
metadata = json.loads(content) if content.strip() else {}
except (json.JSONDecodeError, ValueError):
metadata = {}
video_filename = video_fi... |
if video_dir.exists():
import time
recent_videos = [
f
for f in video_dir.glob("*.webm")
if f.stat().st_mtime > (time.time() - 60)
]
print(
... | video_dir = Path("test-videos") |
content = f.read()
metadata = json.loads(content) if content.strip() else {}
except (json.JSONDecodeError, ValueError):
metadata = {}
video_filename = video_file.name
metadata[video_f... | if video_dir.exists():
import time
recent_videos = [
f
for f in video_dir.glob("*.webm")
if f.stat().st_mtime > (time.time() - 60)
]
print(
f"R... | |
metadata = json.loads(content) if content.strip() else {}
except (json.JSONDecodeError, ValueError):
metadata = {}
video_filename = video_file.name
metadata[video_filename] = test_name
... |
recent_videos = [
f
for f in video_dir.glob("*.webm")
if f.stat().st_mtime > (time.time() - 60)
]
print(
f"Recent video files found: {[f.name for f in recent_vide... | import time |
(content) if content.strip() else {}
except (json.JSONDecodeError, ValueError):
metadata = {}
video_filename = video_file.name
metadata[video_filename] = test_name
f.seek(0)
... |
print(
f"Recent video files found: {[f.name for f in recent_videos]}"
)
| recent_videos = [
f
for f in video_dir.glob("*.webm")
if f.stat().st_mtime > (time.time() - 60)
] |
import re
|
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def background_events_url() -> str:
from pcweb.pages import docs
return docs.events.background_events.path
def test_background_events(
reflex_web_app: AppHarness,
page:... | import pytest |
import re
import pytest
|
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def background_events_url() -> str:
from pcweb.pages import docs
return docs.events.background_events.path
def test_background_events(
reflex_web_app: AppHarness,
page: Page,
background_events_url: str,
):
... | from playwright.sync_api import Page, expect |
import re
import pytest
from playwright.sync_api import Page, expect
|
from utils import get_full_url
@pytest.fixture
def background_events_url() -> str:
from pcweb.pages import docs
return docs.events.background_events.path
def test_background_events(
reflex_web_app: AppHarness,
page: Page,
background_events_url: str,
):
assert reflex_web_app.frontend_url is... | from reflex.testing import AppHarness |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
|
@pytest.fixture
def background_events_url() -> str:
from pcweb.pages import docs
return docs.events.background_events.path
def test_background_events(
reflex_web_app: AppHarness,
page: Page,
background_events_url: str,
):
assert reflex_web_app.frontend_url is not None
page.set_default_... | from utils import get_full_url |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
|
def test_background_events(
reflex_web_app: AppHarness,
page: Page,
background_events_url: str,
):
assert reflex_web_app.frontend_url is not None
page.set_default_timeout(60000)
page.set_default_navigation_timeout(60000)
page.goto(get_full_url(reflex_web_app, background_events_url))
... | def background_events_url() -> str:
from pcweb.pages import docs
return docs.events.background_events.path |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def background_events_url() -> str:
|
return docs.events.background_events.path
def test_background_events(
reflex_web_app: AppHarness,
page: Page,
background_events_url: str,
):
assert reflex_web_app.frontend_url is not None
page.set_default_timeout(60000)
page.set_default_navigation_timeout(60000)
page.goto(get_full_u... | from pcweb.pages import docs |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def background_events_url() -> str:
from pcweb.pages import docs
return docs.events.background_events.path
def test_background_events(
reflex_web_ap... |
reset_button = page.get_by_role("button", name="Reset")
expect(start_button).to_be_visible(timeout=60000)
demo_block = page.locator('[id="background_demo"]').nth(1)
heading = demo_block.get_by_role("heading")
expect(heading).to_have_text("0 /")
start_button.click()
expect(heading).to_have... | start_button = page.get_by_role("button", name="Start", exact=True) |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def background_events_url() -> str:
from pcweb.pages import docs
return docs.events.background_events.path
def test_background_events(
reflex_web_ap... |
expect(start_button).to_be_visible(timeout=60000)
demo_block = page.locator('[id="background_demo"]').nth(1)
heading = demo_block.get_by_role("heading")
expect(heading).to_have_text("0 /")
start_button.click()
expect(heading).to_have_text(re.compile(r"[4-7] /"))
reset_button.click()
... | reset_button = page.get_by_role("button", name="Reset") |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def background_events_url() -> str:
from pcweb.pages import docs
return docs.events.background_events.path
def test_background_events(
reflex_web_ap... |
heading = demo_block.get_by_role("heading")
expect(heading).to_have_text("0 /")
start_button.click()
expect(heading).to_have_text(re.compile(r"[4-7] /"))
reset_button.click()
expect(heading).to_have_text("0 /")
expect(heading).to_have_text("10 /", timeout=12000)
| demo_block = page.locator('[id="background_demo"]').nth(1) |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def background_events_url() -> str:
from pcweb.pages import docs
return docs.events.background_events.path
def test_background_events(
reflex_web_ap... |
expect(heading).to_have_text("0 /")
start_button.click()
expect(heading).to_have_text(re.compile(r"[4-7] /"))
reset_button.click()
expect(heading).to_have_text("0 /")
expect(heading).to_have_text("10 /", timeout=12000)
| heading = demo_block.get_by_role("heading") |
import re
|
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def chaining_event_url() -> str:
from pcweb.pages import docs
return docs.events.chaining_events.path
def test_handler_from_handler(
reflex_web_app: AppHarne... | import time |
import re
import time
|
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def chaining_event_url() -> str:
from pcweb.pages import docs
return docs.events.chaining_events.path
def test_handler_from_handler(
reflex_web_app: AppHarness,
page: P... | import pytest |
import re
import time
import pytest
|
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def chaining_event_url() -> str:
from pcweb.pages import docs
return docs.events.chaining_events.path
def test_handler_from_handler(
reflex_web_app: AppHarness,
page: Page,
chaining_event_url: str,
):
asse... | from playwright.sync_api import Page, expect |
import re
import time
import pytest
from playwright.sync_api import Page, expect
|
from utils import get_full_url
@pytest.fixture
def chaining_event_url() -> str:
from pcweb.pages import docs
return docs.events.chaining_events.path
def test_handler_from_handler(
reflex_web_app: AppHarness,
page: Page,
chaining_event_url: str,
):
assert reflex_web_app.frontend_url is not ... | from reflex.testing import AppHarness |
import re
import time
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
|
@pytest.fixture
def chaining_event_url() -> str:
from pcweb.pages import docs
return docs.events.chaining_events.path
def test_handler_from_handler(
reflex_web_app: AppHarness,
page: Page,
chaining_event_url: str,
):
assert reflex_web_app.frontend_url is not None
page.set_default_timeo... | from utils import get_full_url |
import re
import time
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
|
def test_handler_from_handler(
reflex_web_app: AppHarness,
page: Page,
chaining_event_url: str,
):
assert reflex_web_app.frontend_url is not None
page.set_default_timeout(60000)
page.set_default_navigation_timeout(60000)
page.goto(get_full_url(reflex_web_app, chaining_event_url))
exp... | def chaining_event_url() -> str:
from pcweb.pages import docs
return docs.events.chaining_events.path |
import re
import time
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def chaining_event_url() -> str:
|
return docs.events.chaining_events.path
def test_handler_from_handler(
reflex_web_app: AppHarness,
page: Page,
chaining_event_url: str,
):
assert reflex_web_app.frontend_url is not None
page.set_default_timeout(60000)
page.set_default_navigation_timeout(60000)
page.goto(get_full_url... | from pcweb.pages import docs |
import re
import time
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def chaining_event_url() -> str:
from pcweb.pages import docs
return docs.events.chaining_events.path
def test_handler_from_handler(
ref... |
expect(chain_heading).to_have_text("0")
run_button = page.get_by_role("button", name="Run")
run_button.scroll_into_view_if_needed()
expect(run_button).to_be_visible()
run_button.click()
# commented this as runtime is not reliable in CI
# expect(chain_heading).to_have_text("1")
# expect... | chain_heading = page.locator('[id="call-handler"] > .rt-Flex > span') |
import re
import time
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def chaining_event_url() -> str:
from pcweb.pages import docs
return docs.events.chaining_events.path
def test_handler_from_handler(
ref... |
run_button.scroll_into_view_if_needed()
expect(run_button).to_be_visible()
run_button.click()
# commented this as runtime is not reliable in CI
# expect(chain_heading).to_have_text("1")
# expect(chain_heading).to_have_text("2")
# expect(chain_heading).to_have_text("3")
# expect(chain_he... | run_button = page.get_by_role("button", name="Run") |
button", name="Run")
run_button.scroll_into_view_if_needed()
expect(run_button).to_be_visible()
run_button.click()
# commented this as runtime is not reliable in CI
# expect(chain_heading).to_have_text("1")
# expect(chain_heading).to_have_text("2")
# expect(chain_heading).to_have_text("3")
... |
collatz_input = collatz_box.get_by_role("textbox")
collatz_input.fill("10", timeout=4000)
collatz_input.blur()
collatz_heading = page.locator('[id="collatz"] > .rt-Flex > span')
# commented this as runtime is not reliable in CI
# expect(collatz_heading).to_have_text("10")
# expect(collatz_... | collatz_box = page.locator('[id="collatz"]') |
ew_if_needed()
expect(run_button).to_be_visible()
run_button.click()
# commented this as runtime is not reliable in CI
# expect(chain_heading).to_have_text("1")
# expect(chain_heading).to_have_text("2")
# expect(chain_heading).to_have_text("3")
# expect(chain_heading).to_have_text("4")
#... |
collatz_input.fill("10", timeout=4000)
collatz_input.blur()
collatz_heading = page.locator('[id="collatz"] > .rt-Flex > span')
# commented this as runtime is not reliable in CI
# expect(collatz_heading).to_have_text("10")
# expect(collatz_heading).to_have_text("5")
# expect(collatz_heading)... | collatz_input = collatz_box.get_by_role("textbox") |
e in CI
# expect(chain_heading).to_have_text("1")
# expect(chain_heading).to_have_text("2")
# expect(chain_heading).to_have_text("3")
# expect(chain_heading).to_have_text("4")
# expect(chain_heading).to_have_text("5")
# expect(chain_heading).to_have_text("6")
# expect(chain_heading).to_have_... |
# commented this as runtime is not reliable in CI
# expect(collatz_heading).to_have_text("10")
# expect(collatz_heading).to_have_text("5")
# expect(collatz_heading).to_have_text("16")
# expect(collatz_heading).to_have_text("8")
# expect(collatz_heading).to_have_text("4")
# expect(collatz_he... | collatz_heading = page.locator('[id="collatz"] > .rt-Flex > span') |
import re
|
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def computed_vars_url() -> str:
from pcweb.pages import docs
return docs.vars.computed_vars.path
def test_computed_vars(
reflex_web_app: AppHarness,
page: Page,
com... | import pytest |
import re
import pytest
|
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def computed_vars_url() -> str:
from pcweb.pages import docs
return docs.vars.computed_vars.path
def test_computed_vars(
reflex_web_app: AppHarness,
page: Page,
computed_vars_url: str,
):
assert reflex_web... | from playwright.sync_api import Page, expect |
import re
import pytest
from playwright.sync_api import Page, expect
|
from utils import get_full_url
@pytest.fixture
def computed_vars_url() -> str:
from pcweb.pages import docs
return docs.vars.computed_vars.path
def test_computed_vars(
reflex_web_app: AppHarness,
page: Page,
computed_vars_url: str,
):
assert reflex_web_app.frontend_url is not None
pag... | from reflex.testing import AppHarness |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
|
@pytest.fixture
def computed_vars_url() -> str:
from pcweb.pages import docs
return docs.vars.computed_vars.path
def test_computed_vars(
reflex_web_app: AppHarness,
page: Page,
computed_vars_url: str,
):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(reflex_web_... | from utils import get_full_url |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def computed_vars_url() -> str:
|
return docs.vars.computed_vars.path
def test_computed_vars(
reflex_web_app: AppHarness,
page: Page,
computed_vars_url: str,
):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(reflex_web_app, computed_vars_url))
expect(page).to_have_url(re.compile(computed_vars_url)... | from pcweb.pages import docs |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def computed_vars_url() -> str:
from pcweb.pages import docs
return docs.vars.computed_vars.path
def test_computed_vars(
reflex_web_app: AppHarness,... |
input = upper_box.get_by_role("textbox")
input.fill("upper")
input.blur()
expect(upper_box.get_by_role("heading")).to_have_text("UPPER")
| upper_box = page.locator('[id="upper"]') |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def computed_vars_url() -> str:
from pcweb.pages import docs
return docs.vars.computed_vars.path
def test_computed_vars(
reflex_web_app: AppHarness,... |
input.fill("upper")
input.blur()
expect(upper_box.get_by_role("heading")).to_have_text("UPPER")
| input = upper_box.get_by_role("textbox") |
"""Test the counter example on the main page."""
import re
|
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def intro_page_url() -> str:
from pcweb.pages import docs
return docs.getting_started.introduction.path
def test_counter(reflex_web_app: AppHarness, page: Page, intro_page_url)... | import pytest |
"""Test the counter example on the main page."""
import re
import pytest
|
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def intro_page_url() -> str:
from pcweb.pages import docs
return docs.getting_started.introduction.path
def test_counter(reflex_web_app: AppHarness, page: Page, intro_page_url):
assert reflex_web_app.frontend_url is n... | from playwright.sync_api import Page, expect |
"""Test the counter example on the main page."""
import re
import pytest
from playwright.sync_api import Page, expect
|
from utils import get_full_url
@pytest.fixture
def intro_page_url() -> str:
from pcweb.pages import docs
return docs.getting_started.introduction.path
def test_counter(reflex_web_app: AppHarness, page: Page, intro_page_url):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(re... | from reflex.testing import AppHarness |
"""Test the counter example on the main page."""
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
|
@pytest.fixture
def intro_page_url() -> str:
from pcweb.pages import docs
return docs.getting_started.introduction.path
def test_counter(reflex_web_app: AppHarness, page: Page, intro_page_url):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(reflex_web_app, intro_page_url))
... | from utils import get_full_url |
"""Test the counter example on the main page."""
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
|
def test_counter(reflex_web_app: AppHarness, page: Page, intro_page_url):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(reflex_web_app, intro_page_url))
expect(page).to_have_url(re.compile(intro_page_url))
counter_block = page.locator('[id="counter"]')
expect(counter_blo... | def intro_page_url() -> str:
from pcweb.pages import docs
return docs.getting_started.introduction.path |
"""Test the counter example on the main page."""
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def intro_page_url() -> str:
|
return docs.getting_started.introduction.path
def test_counter(reflex_web_app: AppHarness, page: Page, intro_page_url):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(reflex_web_app, intro_page_url))
expect(page).to_have_url(re.compile(intro_page_url))
counter_block = pa... | from pcweb.pages import docs |
"""Test the counter example on the main page."""
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def intro_page_url() -> str:
from pcweb.pages import docs
return docs.getting_started.introduction.path
... |
expect(counter_block).to_be_visible()
# Find increment button and click it twice. (Playwright will autoscroll the button into view)
increment_button = counter_block.get_by_role("button", name="Increment")
expect(increment_button).to_be_visible()
increment_button.click()
increment_button.click(... | counter_block = page.locator('[id="counter"]') |
"""Test the counter example on the main page."""
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def intro_page_url() -> str:
from pcweb.pages import docs
return docs.getting_started.introduction.path
... |
expect(increment_button).to_be_visible()
increment_button.click()
increment_button.click()
counter_heading = counter_block.get_by_role("heading")
# Check that the counter is now 2.
expect(counter_heading).to_have_text(expected="2")
# Find decrement button and click it.
decrement_butt... | increment_button = counter_block.get_by_role("button", name="Increment") |
"""Test the counter example on the main page."""
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def intro_page_url() -> str:
from pcweb.pages import docs
return docs.getting_started.introduction.path
... |
# Check that the counter is now 2.
expect(counter_heading).to_have_text(expected="2")
# Find decrement button and click it.
decrement_button = counter_block.get_by_role("button", name="Decrement")
decrement_button.click()
# Check that the counter is now 1.
expect(counter_heading).to_have... | counter_heading = counter_block.get_by_role("heading") |
import AppHarness
from utils import get_full_url
@pytest.fixture
def intro_page_url() -> str:
from pcweb.pages import docs
return docs.getting_started.introduction.path
def test_counter(reflex_web_app: AppHarness, page: Page, intro_page_url):
assert reflex_web_app.frontend_url is not None
page.got... |
decrement_button.click()
# Check that the counter is now 1.
expect(counter_heading).to_have_text("1")
| decrement_button = counter_block.get_by_role("button", name="Decrement") |
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def event_argument_url() -> str:
from pcweb.pages import docs
return docs.events.event_arguments.path
def test_lambdas(
reflex_web_app: AppHarness,
page: Page,
even... | import pytest | |
import pytest
|
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def event_argument_url() -> str:
from pcweb.pages import docs
return docs.events.event_arguments.path
def test_lambdas(
reflex_web_app: AppHarness,
page: Page,
event_argument_url: str,
):
assert reflex_web... | from playwright.sync_api import Page, expect |
import pytest
from playwright.sync_api import Page, expect
|
from utils import get_full_url
@pytest.fixture
def event_argument_url() -> str:
from pcweb.pages import docs
return docs.events.event_arguments.path
def test_lambdas(
reflex_web_app: AppHarness,
page: Page,
event_argument_url: str,
):
assert reflex_web_app.frontend_url is not None
pag... | from reflex.testing import AppHarness |
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
|
@pytest.fixture
def event_argument_url() -> str:
from pcweb.pages import docs
return docs.events.event_arguments.path
def test_lambdas(
reflex_web_app: AppHarness,
page: Page,
event_argument_url: str,
):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(reflex_web_... | from utils import get_full_url |
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
|
def test_lambdas(
reflex_web_app: AppHarness,
page: Page,
event_argument_url: str,
):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(reflex_web_app, event_argument_url))
inputs = page.get_by_role("textbox")
def check_box_color(i, initial_color, input_color, expec... | def event_argument_url() -> str:
from pcweb.pages import docs
return docs.events.event_arguments.path |
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def event_argument_url() -> str:
|
return docs.events.event_arguments.path
def test_lambdas(
reflex_web_app: AppHarness,
page: Page,
event_argument_url: str,
):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(reflex_web_app, event_argument_url))
inputs = page.get_by_role("textbox")
def check_b... | from pcweb.pages import docs |
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def event_argument_url() -> str:
from pcweb.pages import docs
return docs.events.event_arguments.path
def test_lambdas(
reflex_web_app: AppHarness,
page: P... |
def check_box_color(i, initial_color, input_color, expected_color):
expect(page.locator(".rt-TextFieldRoot").nth(i)).to_have_css(
"background-color", initial_color
)
inputs.nth(i).fill(input_color)
inputs.nth(i).blur()
expect(page.locator(".rt-TextFieldRoot").nt... | inputs = page.get_by_role("textbox") |
import re
|
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def scatterchart_page_url() -> str:
from pcweb.pages import docs
return docs.library.graphing.charts.scatterchart.path
def tests_recharts(
reflex_web_app: AppHarness,
p... | import pytest |
import re
import pytest
|
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def scatterchart_page_url() -> str:
from pcweb.pages import docs
return docs.library.graphing.charts.scatterchart.path
def tests_recharts(
reflex_web_app: AppHarness,
page: Page,
scatterchart_page_url: str,
):... | from playwright.sync_api import Page, expect |
import re
import pytest
from playwright.sync_api import Page, expect
|
from utils import get_full_url
@pytest.fixture
def scatterchart_page_url() -> str:
from pcweb.pages import docs
return docs.library.graphing.charts.scatterchart.path
def tests_recharts(
reflex_web_app: AppHarness,
page: Page,
scatterchart_page_url: str,
):
assert reflex_web_app.frontend_ur... | from reflex.testing import AppHarness |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
|
@pytest.fixture
def scatterchart_page_url() -> str:
from pcweb.pages import docs
return docs.library.graphing.charts.scatterchart.path
def tests_recharts(
reflex_web_app: AppHarness,
page: Page,
scatterchart_page_url: str,
):
assert reflex_web_app.frontend_url is not None
page.goto(get... | from utils import get_full_url |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def scatterchart_page_url() -> str:
|
return docs.library.graphing.charts.scatterchart.path
def tests_recharts(
reflex_web_app: AppHarness,
page: Page,
scatterchart_page_url: str,
):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(reflex_web_app, scatterchart_page_url))
expect(page).to_have_url(re.compi... | from pcweb.pages import docs |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def scatterchart_page_url() -> str:
from pcweb.pages import docs
return docs.library.graphing.charts.scatterchart.path
def tests_recharts(
reflex_we... |
symbols = page.locator(".recharts-symbols")
button = page.get_by_role("button", name="Compute")
expect(input).to_be_visible()
expect(symbols).to_have_count(45)
expect(button).to_be_visible()
| input = page.get_by_placeholder("Enter a number") |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def scatterchart_page_url() -> str:
from pcweb.pages import docs
return docs.library.graphing.charts.scatterchart.path
def tests_recharts(
reflex_we... |
button = page.get_by_role("button", name="Compute")
expect(input).to_be_visible()
expect(symbols).to_have_count(45)
expect(button).to_be_visible()
| symbols = page.locator(".recharts-symbols") |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def scatterchart_page_url() -> str:
from pcweb.pages import docs
return docs.library.graphing.charts.scatterchart.path
def tests_recharts(
reflex_we... |
expect(input).to_be_visible()
expect(symbols).to_have_count(45)
expect(button).to_be_visible()
| button = page.get_by_role("button", name="Compute") |
import re
|
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def server_side_events_url() -> str:
from pcweb.pages import docs
return docs.api_reference.special_events.path
def _predicate_console_message(msg):
return msg.text == "Hel... | import pytest |
import re
import pytest
|
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def server_side_events_url() -> str:
from pcweb.pages import docs
return docs.api_reference.special_events.path
def _predicate_console_message(msg):
return msg.text == "Hello World!"
def _predicate_download(download... | from playwright.sync_api import Page, expect |
import re
import pytest
from playwright.sync_api import Page, expect
|
from utils import get_full_url
@pytest.fixture
def server_side_events_url() -> str:
from pcweb.pages import docs
return docs.api_reference.special_events.path
def _predicate_console_message(msg):
return msg.text == "Hello World!"
def _predicate_download(download):
return download.suggested_filen... | from reflex.testing import AppHarness |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
|
@pytest.fixture
def server_side_events_url() -> str:
from pcweb.pages import docs
return docs.api_reference.special_events.path
def _predicate_console_message(msg):
return msg.text == "Hello World!"
def _predicate_download(download):
return download.suggested_filename == "different_name_logo.png... | from utils import get_full_url |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def server_side_events_url() -> str:
|
return docs.api_reference.special_events.path
def _predicate_console_message(msg):
return msg.text == "Hello World!"
def _predicate_download(download):
return download.suggested_filename == "different_name_logo.png"
def test_server_side_events(
reflex_web_app: AppHarness,
page: Page,
ser... | from pcweb.pages import docs |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def server_side_events_url() -> str:
from pcweb.pages import docs
return docs.api_reference.special_events.path
|
def _predicate_download(download):
return download.suggested_filename == "different_name_logo.png"
def test_server_side_events(
reflex_web_app: AppHarness,
page: Page,
server_side_events_url: str,
):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(reflex_web_app, serv... | def _predicate_console_message(msg):
return msg.text == "Hello World!" |
import re
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
from utils import get_full_url
@pytest.fixture
def server_side_events_url() -> str:
from pcweb.pages import docs
return docs.api_reference.special_events.path
def _predicate_console_message(msg):
... |
def test_server_side_events(
reflex_web_app: AppHarness,
page: Page,
server_side_events_url: str,
):
assert reflex_web_app.frontend_url is not None
page.goto(get_full_url(reflex_web_app, server_side_events_url))
expect(page).to_have_url(re.compile(server_side_events_url))
with page.expe... | def _predicate_download(download):
return download.suggested_filename == "different_name_logo.png" |
"""Integration tests for all titles in Reflex."""
|
from collections import Counter
from pathlib import Path
import pytest
sys.path.append(str(Path(__file__).resolve().parent.parent))
@pytest.fixture
def routes_fixture():
from pcweb.pages import routes
yield routes
def test_unique_titles(routes_fixture):
assert routes_fixture is not None
titles ... | import sys |
"""Integration tests for all titles in Reflex."""
import sys
|
from pathlib import Path
import pytest
sys.path.append(str(Path(__file__).resolve().parent.parent))
@pytest.fixture
def routes_fixture():
from pcweb.pages import routes
yield routes
def test_unique_titles(routes_fixture):
assert routes_fixture is not None
titles = [route for route in routes_fix... | from collections import Counter |
"""Integration tests for all titles in Reflex."""
import sys
from collections import Counter
|
import pytest
sys.path.append(str(Path(__file__).resolve().parent.parent))
@pytest.fixture
def routes_fixture():
from pcweb.pages import routes
yield routes
def test_unique_titles(routes_fixture):
assert routes_fixture is not None
titles = [route for route in routes_fixture if hasattr(route, "t... | from pathlib import Path |
"""Integration tests for all titles in Reflex."""
import sys
from collections import Counter
from pathlib import Path
import pytest
sys.path.append(str(Path(__file__).resolve().parent.parent))
@pytest.fixture
|
def test_unique_titles(routes_fixture):
assert routes_fixture is not None
titles = [route for route in routes_fixture if hasattr(route, "title")]
# Count occurrences of each title
title_counts = Counter(titles)
# Find duplicate titles
duplicates = [title for title, count in title_counts.ite... | def routes_fixture():
from pcweb.pages import routes
yield routes |
"""Integration tests for all titles in Reflex."""
import sys
from collections import Counter
from pathlib import Path
import pytest
sys.path.append(str(Path(__file__).resolve().parent.parent))
@pytest.fixture
def routes_fixture():
|
yield routes
def test_unique_titles(routes_fixture):
assert routes_fixture is not None
titles = [route for route in routes_fixture if hasattr(route, "title")]
# Count occurrences of each title
title_counts = Counter(titles)
# Find duplicate titles
duplicates = [title for title, count i... | from pcweb.pages import routes |
"""Integration tests for all titles in Reflex."""
import sys
from collections import Counter
from pathlib import Path
import pytest
sys.path.append(str(Path(__file__).resolve().parent.parent))
@pytest.fixture
def routes_fixture():
from pcweb.pages import routes
yield routes
def test_unique_titles(routes... |
# Count occurrences of each title
title_counts = Counter(titles)
# Find duplicate titles
duplicates = [title for title, count in title_counts.items() if count > 1]
# Assert that there are no duplicates
assert len(duplicates) == 0, f"Duplicate titles found: {duplicates}"
print(f"Test pass... | titles = [route for route in routes_fixture if hasattr(route, "title")] |
"""Integration tests for all titles in Reflex."""
import sys
from collections import Counter
from pathlib import Path
import pytest
sys.path.append(str(Path(__file__).resolve().parent.parent))
@pytest.fixture
def routes_fixture():
from pcweb.pages import routes
yield routes
def test_unique_titles(routes... |
# Find duplicate titles
duplicates = [title for title, count in title_counts.items() if count > 1]
# Assert that there are no duplicates
assert len(duplicates) == 0, f"Duplicate titles found: {duplicates}"
print(f"Test passed. All {len(titles)} titles are unique.")
| title_counts = Counter(titles) |
"""Integration tests for all titles in Reflex."""
import sys
from collections import Counter
from pathlib import Path
import pytest
sys.path.append(str(Path(__file__).resolve().parent.parent))
@pytest.fixture
def routes_fixture():
from pcweb.pages import routes
yield routes
def test_unique_titles(routes... |
# Assert that there are no duplicates
assert len(duplicates) == 0, f"Duplicate titles found: {duplicates}"
print(f"Test passed. All {len(titles)} titles are unique.")
| duplicates = [title for title, count in title_counts.items() if count > 1] |
"""Integration tests for all urls in Reflex."""
import os
import re
|
import pytest
import requests
def check_urls(repo_dir):
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
"""
url_pattern = re.compile(r'http[s]?://reflex\.dev[^\s")]*')
errors = []
for root, ... | from pathlib import Path |
"""Integration tests for all urls in Reflex."""
import os
import re
from pathlib import Path
|
import requests
def check_urls(repo_dir):
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
"""
url_pattern = re.compile(r'http[s]?://reflex\.dev[^\s")]*')
errors = []
for root, _dirs, files in... | import pytest |
"""Integration tests for all urls in Reflex."""
import os
import re
from pathlib import Path
import pytest
|
def check_urls(repo_dir):
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
"""
url_pattern = re.compile(r'http[s]?://reflex\.dev[^\s")]*')
errors = []
for root, _dirs, files in os.walk(repo_di... | import requests |
"""Integration tests for all urls in Reflex."""
import os
import re
from pathlib import Path
import pytest
import requests
def check_urls(repo_dir):
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
"""
... |
errors = []
for root, _dirs, files in os.walk(repo_dir):
if "__pycache__" in root:
continue
# Check if the root path contains the target directories
if not ("pcweb" in root or "docs" in root or "blog" in root):
continue
for file_name in files:
... | url_pattern = re.compile(r'http[s]?://reflex\.dev[^\s")]*') |
"""Integration tests for all urls in Reflex."""
import os
import re
from pathlib import Path
import pytest
import requests
def check_urls(repo_dir):
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
"""
... |
for root, _dirs, files in os.walk(repo_dir):
if "__pycache__" in root:
continue
# Check if the root path contains the target directories
if not ("pcweb" in root or "docs" in root or "blog" in root):
continue
for file_name in files:
if not file_... | errors = [] |
"""Integration tests for all urls in Reflex."""
import os
import re
from pathlib import Path
import pytest
import requests
def check_urls(repo_dir):
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
"""
... |
# Check if the root path contains the target directories
if not ("pcweb" in root or "docs" in root or "blog" in root):
continue
for file_name in files:
if not file_name.endswith(".py") and not file_name.endswith(".md"):
continue
# page.py ha... | if "__pycache__" in root:
continue |
"""Integration tests for all urls in Reflex."""
import os
import re
from pathlib import Path
import pytest
import requests
def check_urls(repo_dir):
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
"""
... |
for file_name in files:
if not file_name.endswith(".py") and not file_name.endswith(".md"):
continue
# page.py has some URLs that we cannot check in this way
if file_name == "page.py":
continue
file_path = os.path.join(root, file_... | if not ("pcweb" in root or "docs" in root or "blog" in root):
continue |
"""Integration tests for all urls in Reflex."""
import os
import re
from pathlib import Path
import pytest
import requests
def check_urls(repo_dir):
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
"""
... |
# page.py has some URLs that we cannot check in this way
if file_name == "page.py":
continue
file_path = os.path.join(root, file_name)
try:
with open(file_path, "r", encoding="utf-8", errors="ignore") as file:
for line... | if not file_name.endswith(".py") and not file_name.endswith(".md"):
continue |
"""Integration tests for all urls in Reflex."""
import os
import re
from pathlib import Path
import pytest
import requests
def check_urls(repo_dir):
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
"""
... |
file_path = os.path.join(root, file_name)
try:
with open(file_path, "r", encoding="utf-8", errors="ignore") as file:
for line in file:
urls = url_pattern.findall(line)
for url in set(urls):
... | if file_name == "page.py":
continue |
"""Integration tests for all urls in Reflex."""
import os
import re
from pathlib import Path
import pytest
import requests
def check_urls(repo_dir):
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
"""
... |
try:
with open(file_path, "r", encoding="utf-8", errors="ignore") as file:
for line in file:
urls = url_pattern.findall(line)
for url in set(urls):
if url.startswith("http://"):
... | file_path = os.path.join(root, file_name) |
:
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
"""
url_pattern = re.compile(r'http[s]?://reflex\.dev[^\s")]*')
errors = []
for root, _dirs, files in os.walk(repo_dir):
if "__pycache__... |
for url in set(urls):
if url.startswith("http://"):
errors.append(
f"Found insecure HTTP URL: {url} in {file_path}"
)
url = url.strip("\"\n... | urls = url_pattern.findall(line) |
f the repo.
Returns:
A list of errors.
"""
url_pattern = re.compile(r'http[s]?://reflex\.dev[^\s")]*')
errors = []
for root, _dirs, files in os.walk(repo_dir):
if "__pycache__" in root:
continue
# Check if the root path contains the target directories
i... |
url = url.strip("\"\n'")
try:
response = requests.head(
url, allow_redirects=False, timeout=5
)
response.raise_for_status()
... | if url.startswith("http://"):
errors.append(
f"Found insecure HTTP URL: {url} in {file_path}"
) |
continue
# Check if the root path contains the target directories
if not ("pcweb" in root or "docs" in root or "blog" in root):
continue
for file_name in files:
if not file_name.endswith(".py") and not file_name.endswith(".md"):
continue
... |
try:
response = requests.head(
url, allow_redirects=False, timeout=5
)
response.raise_for_status()
except requests.RequestException... | url = url.strip("\"\n'") |
if not ("pcweb" in root or "docs" in root or "blog" in root):
continue
for file_name in files:
if not file_name.endswith(".py") and not file_name.endswith(".md"):
continue
# page.py has some URLs that we cannot check in this way
if file_name ... |
response.raise_for_status()
except requests.RequestException as e:
errors.append(
f"Error accessing URL: {url} in {file_path} | Error: {e}, , Check your path ends with a /"
... | response = requests.head(
url, allow_redirects=False, timeout=5
) |
f"Found insecure HTTP URL: {url} in {file_path}"
)
url = url.strip("\"\n'")
try:
response = requests.head(
url, allow_redirects=Fa... | def test_find_and_check_urls(repo_dir):
"""Test that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
"""
errors = check_urls(repo_dir)
assert not errors, "\n".join(errors) | |
)
try:
response = requests.head(
url, allow_redirects=False, timeout=5
)
response.raise_for_status()
except requests.RequestExceptio... |
assert not errors, "\n".join(errors)
| errors = check_urls(repo_dir) |
"""Test utilities for reflex-web tests."""
|
from reflex.testing import AppHarness
def get_full_url(app_harness: AppHarness, path: str) -> str:
"""Properly join the app's frontend URL with a path.
This ensures proper URL construction without double slashes,
which is important since React Router is stricter than Next.js
about URL formatting.
... | from urllib.parse import urljoin |
"""Test utilities for reflex-web tests."""
from urllib.parse import urljoin
|
def get_full_url(app_harness: AppHarness, path: str) -> str:
"""Properly join the app's frontend URL with a path.
This ensures proper URL construction without double slashes,
which is important since React Router is stricter than Next.js
about URL formatting.
Args:
app_harness: The AppH... | from reflex.testing import AppHarness |
# reflex-dev/templates:.deploy/temporary_db.py to create default reflex.db when deployed
|
rx.utils.prerequisites.check_db_initialized() or rx.Model.alembic_init()
rx.Model.migrate(autogenerate=True)
| import reflex as rx |
from account_management_dashboard.components.account_section import (
account_category_section,
)
from account_management_dashboard.components.header import header_component
from account_management_dashboard.components.net_worth_graph import (
net_worth_graph_component,
)
from account_management_dashboard.com... | import reflex as rx | |
import reflex as rx
|
from account_management_dashboard.components.header import header_component
from account_management_dashboard.components.net_worth_graph import (
net_worth_graph_component,
)
from account_management_dashboard.components.net_worth_summary import (
net_worth_summary,
)
from account_management_dashboard.component... | from account_management_dashboard.components.account_section import (
account_category_section,
) |
import reflex as rx
from account_management_dashboard.components.account_section import (
account_category_section,
)
|
from account_management_dashboard.components.net_worth_graph import (
net_worth_graph_component,
)
from account_management_dashboard.components.net_worth_summary import (
net_worth_summary,
)
from account_management_dashboard.components.sidebar import sidebar
from account_management_dashboard.components.summar... | from account_management_dashboard.components.header import header_component |
import reflex as rx
from account_management_dashboard.components.account_section import (
account_category_section,
)
from account_management_dashboard.components.header import header_component
|
from account_management_dashboard.components.net_worth_summary import (
net_worth_summary,
)
from account_management_dashboard.components.sidebar import sidebar
from account_management_dashboard.components.summary_section import summary_section
from account_management_dashboard.states.account_state import AccountS... | from account_management_dashboard.components.net_worth_graph import (
net_worth_graph_component,
) |
import reflex as rx
from account_management_dashboard.components.account_section import (
account_category_section,
)
from account_management_dashboard.components.header import header_component
from account_management_dashboard.components.net_worth_graph import (
net_worth_graph_component,
)
|
from account_management_dashboard.components.sidebar import sidebar
from account_management_dashboard.components.summary_section import summary_section
from account_management_dashboard.states.account_state import AccountState
def index() -> rx.Component:
"""The main page of the financial dashboard."""
retur... | from account_management_dashboard.components.net_worth_summary import (
net_worth_summary,
) |
import reflex as rx
from account_management_dashboard.components.account_section import (
account_category_section,
)
from account_management_dashboard.components.header import header_component
from account_management_dashboard.components.net_worth_graph import (
net_worth_graph_component,
)
from account_manag... |
from account_management_dashboard.components.summary_section import summary_section
from account_management_dashboard.states.account_state import AccountState
def index() -> rx.Component:
"""The main page of the financial dashboard."""
return rx.el.div(
sidebar(),
rx.el.main(
head... | from account_management_dashboard.components.sidebar import sidebar |
import reflex as rx
from account_management_dashboard.components.account_section import (
account_category_section,
)
from account_management_dashboard.components.header import header_component
from account_management_dashboard.components.net_worth_graph import (
net_worth_graph_component,
)
from account_manag... |
from account_management_dashboard.states.account_state import AccountState
def index() -> rx.Component:
"""The main page of the financial dashboard."""
return rx.el.div(
sidebar(),
rx.el.main(
header_component(),
net_worth_summary(),
net_worth_graph_compone... | from account_management_dashboard.components.summary_section import summary_section |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.