Skip to content

Commit

Permalink
tests: refactor startup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorozenko committed Oct 7, 2024
1 parent f11650c commit 68c58c8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/playwirght/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,25 @@ def test_startup(page: Page, app: ShinyAppProc):
"""
page.goto(app.url)

# Wait for the page to load fully
# Shiny apps require this wait
page.wait_for_load_state("networkidle")

# When shiny fails after startup, it adds the #shiny-disconnected-overlay div
# We check if it's not present in the page
assert not page.query_selector("#shiny-disconnected-overlay"), "The shiny app failed to start"


def test_startup_without_errors(page: Page, app: ShinyAppProc):
"""
Tests if shiny app started without errors.
"""
page.goto(app.url)

page.wait_for_load_state("networkidle")

assert not page.query_selector("div.shiny-output-error"), "The shiny app started with errors"


def test_link_button(page: Page, app: ShinyAppProc):
"""
Test that the link_button contains the link to the docs.
Expand Down

0 comments on commit 68c58c8

Please sign in to comment.