Skip to content

Commit

Permalink
utilize the alt_verify flag for more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
joesho112358 committed Oct 23, 2024
1 parent 8a60787 commit 5dfcc4d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
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

0 comments on commit 5dfcc4d

Please sign in to comment.