|
8 | 8 | def test_valuebox(page: Page, local_app: ShinyAppProc, value_box_id: str) -> None: |
9 | 9 | page.goto(local_app.url) |
10 | 10 |
|
11 | | - value_box1 = ValueBox(page, "valuebox1") |
12 | | - # value_box1.expect_height(None); TODO-fix-karan; |
13 | | - value_box1.expect_title("KPI Title") |
14 | | - value_box1.expect_value("$1 Billion Dollars") |
15 | | - value_box1.expect_full_screen(False) |
16 | | - value_box1.open_full_screen() |
17 | | - value_box1.expect_full_screen(True) |
18 | | - value_box1.expect_body(["30% VS PREVIOUS 30 DAYS"]) |
19 | | - value_box1.close_full_screen() |
20 | | - value_box1.expect_full_screen(False) |
21 | | - |
22 | | - value_box2 = ValueBox(page, "valuebox2") |
23 | | - # value_box2.expect_height("300px"); TODO-fix-karan; |
24 | | - value_box2.expect_title("title") |
25 | | - value_box2.expect_value("value") |
26 | | - value_box2.expect_full_screen(False) |
27 | | - value_box2.open_full_screen() |
28 | | - value_box2.expect_full_screen(True) |
29 | | - value_box2.expect_body(["content", "more body"]) |
30 | | - value_box2.close_full_screen() |
31 | | - value_box2.expect_full_screen(False) |
32 | | - |
33 | | - title_tag_name = ( |
34 | | - value_box2.loc_title.locator("*") |
35 | | - .nth(0) |
36 | | - .evaluate("el => el.tagName.toLowerCase()") |
37 | | - ) |
38 | | - assert title_tag_name == "p" |
| 11 | + value_box = ValueBox(page, value_box_id) |
| 12 | + value_box.expect_full_screen(False) |
| 13 | + value_box.open_full_screen() |
| 14 | + value_box.expect_full_screen(True) |
| 15 | + if value_box_id == "valuebox1": |
| 16 | + value_box.expect_height(None) |
| 17 | + value_box.expect_title("KPI Title") |
| 18 | + value_box.expect_value("$1 Billion Dollars") |
| 19 | + value_box.expect_body(["30% VS PREVIOUS 30 DAYS"]) |
| 20 | + else: |
| 21 | + # value_box.expect_height("300px") # TODO-fix-karan; |
| 22 | + value_box.expect_title("title") |
| 23 | + value_box.expect_value("value") |
| 24 | + value_box.expect_body(["content", "more body"]) |
| 25 | + title_tag_name = ( |
| 26 | + value_box.loc_title.locator("*") |
| 27 | + .nth(0) |
| 28 | + .evaluate("el => el.tagName.toLowerCase()") |
| 29 | + ) |
| 30 | + assert title_tag_name == "p" |
| 31 | + value_box.close_full_screen() |
| 32 | + value_box.expect_full_screen(False) |
0 commit comments