Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 1 addition & 2 deletions tests/playwright/shiny/components/test_sidebar.py
Original file line number Diff line number Diff line change
@@ -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")

Expand Down Expand Up @@ -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")
50 changes: 22 additions & 28 deletions tests/playwright/shiny/components/value_box/test_valuebox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
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)
1 change: 0 additions & 1 deletion tests/playwright/shiny/inputs/test_input_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down