Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilize the alt_verify flag for more test cases #1745

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions shiny/playwright/controller/_input_controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,7 @@ def expect_choices(
arr_name="choices",
arr=choices,
timeout=timeout,
alt_verify=True,
)

def expect_selected(
Expand Down Expand Up @@ -1234,6 +1235,7 @@ def expect_choices(
arr=choices,
key="data-value",
timeout=timeout,
alt_verify=True,
)

def expect_selected(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,17 @@ def test_input_select_kitchensink(page: Page, local_app: ShinyAppProc) -> None:
]
)

# TODO-karan; Debug why this does not complete
# page.set_default_timeout(100)
# select_with_custom_size_and_dict.expect_choices(
# [
# "Orange",
# "Lemon",
# "Lime",
# "Strawberry",
# "Blueberry",
# "Raspberry",
# ],
# )
# select_with_custom_size_and_dict.expect_size("4")
select_with_custom_size_and_dict.expect_choices(
[
"Orange",
"Lemon",
"Lime",
"Strawberry",
"Blueberry",
"Raspberry",
],
)
select_with_custom_size_and_dict.expect_size("4")

# # # TODO-karan; Should we implement this? Seems like the only way to determine which choices belong to which groups. While we're at it, we might as well test the labels.
# # select_with_custom_size_and_dict.expect_choices({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ def test_input_selectize_kitchensink(page: Page, local_app: ShinyAppProc) -> Non

basic_selectize = controller.InputSelectize(page, "basic_selectize")
basic_select_txt = controller.OutputText(page, "basic_result_txt")
# # TODO-karan; Debug why this does not complete
# basic_selectize.expect_choices(["Apple", "Banana", "Cherry", "Date", "Elderberry"])
basic_selectize.expect_choices(["Apple", "Banana", "Cherry", "Date", "Elderberry"])
basic_selectize.expect_choice_labels(
[
"Apple",
Expand All @@ -27,10 +26,9 @@ def test_input_selectize_kitchensink(page: Page, local_app: ShinyAppProc) -> Non

selectize_with_label = controller.InputSelectize(page, "selectize_with_label")
selectize_with_label_txt = controller.OutputText(page, "selectize_with_label_txt")
# # TODO-karan; Debug why this does not complete
# selectize_with_label.expect_choices(
# ["apple", "banana", "cherry", "date", "elderberry"]
# )
selectize_with_label.expect_choices(
["apple", "banana", "cherry", "date", "elderberry"]
)
selectize_with_label.expect_choice_labels(
[
"Apple",
Expand Down Expand Up @@ -74,10 +72,9 @@ def test_input_selectize_kitchensink(page: Page, local_app: ShinyAppProc) -> Non
selectize_width_close_button_txt.expect_value("Orange")
selectize_width_close_button.expect_width("400px")
selectize_width_close_button.expect_choice_groups(["Citrus", "Berries"])
# # TODO-karan; Debug why this does not complete
# selectize_width_close_button.expect_choices(
# ["Orange", "Lemon", "Lime", "Strawberry", "Blueberry", "Raspberry"]
# )
selectize_width_close_button.expect_choices(
["Orange", "Lemon", "Lime", "Strawberry", "Blueberry", "Raspberry"]
)
selectize_width_close_button.expect_choice_labels(
[
"Sweet and tangy",
Expand Down
Loading