diff --git a/tests/playwright/shiny/components/test_sidebar.py b/tests/playwright/shiny/components/test_sidebar.py index 9cd2a42b6..5c3371cf1 100644 --- a/tests/playwright/shiny/components/test_sidebar.py +++ b/tests/playwright/shiny/components/test_sidebar.py @@ -1,6 +1,6 @@ from conftest import ShinyAppProc, create_doc_example_core_fixture from controls import OutputTextVerbatim, Sidebar -from playwright.sync_api import Page +from playwright.sync_api import Page, expect app = create_doc_example_core_fixture("sidebar") @@ -48,6 +48,5 @@ def test_sidebar_position_and_open(page: Page, app: ShinyAppProc) -> None: output_txt_always.expect_value("input.sidebar_always(): True") # Handle is included but it should have `display: none` always_sidebar.expect_handle(True) - from playwright.sync_api import expect expect(always_sidebar.loc_handle).to_have_css("display", "none") diff --git a/tests/playwright/shiny/components/value_box/smoke/test_valuebox.py b/tests/playwright/shiny/components/value_box/smoke/test_valuebox.py index 5b5c4909a..d9bf7129b 100644 --- a/tests/playwright/shiny/components/value_box/smoke/test_valuebox.py +++ b/tests/playwright/shiny/components/value_box/smoke/test_valuebox.py @@ -8,31 +8,25 @@ def test_valuebox(page: Page, local_app: ShinyAppProc, value_box_id: str) -> None: page.goto(local_app.url) - value_box1 = ValueBox(page, "valuebox1") - # value_box1.expect_height(None); TODO-fix-karan; - value_box1.expect_title("KPI Title") - value_box1.expect_value("$1 Billion Dollars") - value_box1.expect_full_screen(False) - value_box1.open_full_screen() - value_box1.expect_full_screen(True) - value_box1.expect_body(["30% VS PREVIOUS 30 DAYS"]) - value_box1.close_full_screen() - value_box1.expect_full_screen(False) - - value_box2 = ValueBox(page, "valuebox2") - # value_box2.expect_height("300px"); TODO-fix-karan; - value_box2.expect_title("title") - value_box2.expect_value("value") - value_box2.expect_full_screen(False) - value_box2.open_full_screen() - value_box2.expect_full_screen(True) - value_box2.expect_body(["content", "more body"]) - value_box2.close_full_screen() - value_box2.expect_full_screen(False) - - title_tag_name = ( - value_box2.loc_title.locator("*") - .nth(0) - .evaluate("el => el.tagName.toLowerCase()") - ) - assert title_tag_name == "p" + value_box = ValueBox(page, value_box_id) + value_box.expect_full_screen(False) + value_box.open_full_screen() + value_box.expect_full_screen(True) + if value_box_id == "valuebox1": + value_box.expect_height(None) + value_box.expect_title("KPI Title") + value_box.expect_value("$1 Billion Dollars") + value_box.expect_body(["30% VS PREVIOUS 30 DAYS"]) + else: + # value_box.expect_height("300px") # TODO-fix-karan; + value_box.expect_title("title") + value_box.expect_value("value") + value_box.expect_body(["content", "more body"]) + title_tag_name = ( + value_box.loc_title.locator("*") + .nth(0) + .evaluate("el => el.tagName.toLowerCase()") + ) + assert title_tag_name == "p" + value_box.close_full_screen() + value_box.expect_full_screen(False) diff --git a/tests/playwright/shiny/inputs/test_input_switch.py b/tests/playwright/shiny/inputs/test_input_switch.py index 39034bf2f..0fc16a042 100644 --- a/tests/playwright/shiny/inputs/test_input_switch.py +++ b/tests/playwright/shiny/inputs/test_input_switch.py @@ -9,7 +9,6 @@ def test_input_switch_kitchen(page: Page, app: ShinyAppProc) -> None: page.goto(app.url) somevalue = InputSwitch(page, "somevalue") - somevalue.expect_label expect(somevalue.loc_label).to_have_text("Some value") somevalue.expect_label("Some value")