From b134708d7c05f4b0065be8db1507f895a0dc068c Mon Sep 17 00:00:00 2001 From: Karan Gathani Date: Sun, 13 Jul 2025 05:20:38 +0530 Subject: [PATCH] Update end-to-end testing docs for new app fixture Replaces usage of 'local_app' with 'app' using the new create_app_fixture in the test example. Updates fixture explanations to match the new variable name and usage. --- docs/end-to-end-testing.qmd | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/end-to-end-testing.qmd b/docs/end-to-end-testing.qmd index 7393249a..bd6d0e07 100644 --- a/docs/end-to-end-testing.qmd +++ b/docs/end-to-end-testing.qmd @@ -77,13 +77,17 @@ Now for the exciting part – writing the test code! 2. **Copy and paste this code:** ```python +from playwright.sync_api import Page from shiny.playwright import controller +from shiny.pytest import create_app_fixture from shiny.run import ShinyAppProc -from playwright.sync_api import Page -def test_basic_app(page: Page, local_app: ShinyAppProc) -> None: +app = create_app_fixture(["app.py"]) + + +def test_basic_app(page: Page, app: ShinyAppProc) -> None: # Navigate to the app URL when it's ready - page.goto(local_app.url) + page.goto(app.url) # Controller objects for interacting with specific Shiny components txt = controller.OutputText(page, "txt") @@ -100,7 +104,7 @@ def test_basic_app(page: Page, local_app: ShinyAppProc) -> None: - **Understand role of Fixtures** - **ShinyAppProc**: Manages a Shiny application subprocess, handling lifecycle (startup, shutdown) and providing access to output streams. - **page**: Playwright object representing the browser tab. - - **local_app**: Running instance of the Shiny application. + - **app**: Running instance of the Shiny application. - **Understand role of Controllers**