Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ def test_accordion_bookmarking_demo(page: Page, app: ShinyAppProc) -> None:
acc_mod.expect_open(["Section A"])
acc_mod.set(["Section C"])

existing_url = page.url
# click bookmark button
bookmark_button = controller.InputBookmarkButton(page)
bookmark_button.click()

page.wait_for_url(lambda url: url != existing_url, timeout=5 * 1000)

# reload page
page.reload()

Expand All @@ -32,8 +35,12 @@ def test_accordion_bookmarking_demo(page: Page, app: ShinyAppProc) -> None:
acc_single.set([])
acc_mod.set([])

existing_url = page.url

bookmark_button.click()

page.wait_for_url(lambda url: url != existing_url, timeout=5 * 1000)

# reload page
page.reload()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ def test_checkbox_demo(page: Page, app: ShinyAppProc) -> None:
module_checkbox.expect_checked(True)
module_text.expect_value("Checkbox value: True")

existing_url = page.url
bookmark_button = controller.InputBookmarkButton(page)
bookmark_button.click()

page.wait_for_url(lambda url: url != existing_url, timeout=5 * 1000)

# reload the page to test bookmark
page.reload()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ def test_checkbox_group_demo(page: Page, app: ShinyAppProc) -> None:
module_group.expect_selected(["Choice A", "Choice C"])
module_text.expect_value("Checkbox group values: ('Choice A', 'Choice C')")

existing_url = page.url
# Bookmark the state
bookmark_button = controller.InputBookmarkButton(page)
bookmark_button.click()
page.wait_for_url(lambda url: url != existing_url, timeout=5 * 1000)

# Reload the page to test bookmark
page.reload()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ def test_file_input_bookmarking(page: Page, app: ShinyAppProc) -> None:

mod_file_output_txt.expect_value("File name(s): users.csv, users2.csv")

existing_url = page.url

# click bookmark button
bookmark_button = controller.InputBookmarkButton(page)
bookmark_button.click()
page.wait_for_url(lambda url: url != existing_url, timeout=5 * 1000)

page.reload()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ def test_text_input_demo(page: Page, app: ShinyAppProc) -> None:

# click bookmark button
bookmark_button = controller.InputBookmarkButton(page)
existing_url = page.url
bookmark_button.click()

page.wait_for_url(lambda url: url != existing_url, timeout=5 * 1000)

page.reload()

# Check if the values are retained after reloading the page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ def test_navsets_bookmarking_demo(
mod_navset_cont = navset_controller(page, f"first-{navset_name}_{navset_variant}")
mod_navset_cont.set(f"{navset_name}_b")

existing_url = page.url

# Click bookmark button
controller.InputBookmarkButton(page).click()

page.wait_for_url(lambda url: url != existing_url, timeout=5 * 1000)
# Reload page
page.reload()

Expand All @@ -55,3 +57,4 @@ def test_navsets_bookmarking_demo(
navset_cont.expect_value(f"{navset_name}_c")
mod_navset_collection.expect_value(navset_name)
mod_navset_cont.expect_value(f"{navset_name}_b")
mod_navset_cont.expect_value(f"{navset_name}_b")
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ def test_navset_hidden_bookmarking(
mod_navset_btn = controller.InputActionButton(page, f"first-{navset_id}_button")
mod_navset_btn.click()

existing_url = page.url

# Click bookmark button
controller.InputBookmarkButton(page).click()
page.wait_for_url(lambda url: url != existing_url, timeout=5 * 1000)

# Reload page
page.reload()
Expand Down
3 changes: 2 additions & 1 deletion tests/playwright/examples/example_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def get_apps(path: str) -> typing.List[str]:
"FutureWarning: The default of observed=False is deprecated",
# seaborn: https://github.com/mwaskom/seaborn/pull/3355
"FutureWarning: use_inf_as_na option is deprecated",
"pd.option_context('mode.use_inf_as_na", # continutation of line above
"pd.option_context('mode.use_inf_as_na", # continutation of line above,
"RuntimeWarning: invalid value encountered in dot", # some groups didn't have enough data points to create a meaningful line
]
app_allow_js_errors: typing.Dict[str, typing.List[str]] = {
"examples/brownian": ["Failed to acquire camera feed:"],
Expand Down
2 changes: 1 addition & 1 deletion tests/playwright/shiny/bookmark/chat/chatlas/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
# Use ChatOpenAI as it does not need credentials until submission to the server.
# However, if we use `.set_turns()` and `.get_turns()`, a submission is never made to the server... therefore we don't need credentials.
chat_client = chatlas.ChatOpenAI( # pyright: ignore[reportUnknownMemberType]
turns=[],
api_key="<not_utilized>",
)
chat_client.set_turns([]) # type: ignore[arg-type]
chat.enable_bookmarking(chat_client, bookmark_store="url")


Expand Down
Loading