Skip to content

Commit 200f292

Browse files
committed
make smaller intervals between steps for making tests more robust
1 parent b59d1ac commit 200f292

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

tests/playwright/shiny/inputs/input_slider/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ def slider_row(
7575
slider_row(
7676
"Date format",
7777
min=(datetime.date(2024, 1, 1)),
78-
max=(datetime.date(2024, 12, 31)),
79-
value=(datetime.date(2024, 4, 15)),
78+
max=(datetime.date(2024, 1, 10)),
79+
value=(datetime.date(2024, 1, 5)),
8080
time_format="%m/%d/%y",
8181
timezone="-0500",
8282
),
8383
slider_row(
8484
"Time format",
8585
min=(datetime.datetime(2024, 1, 1, 0, 0)),
86-
max=(datetime.datetime(2024, 12, 31, 23, 59)),
87-
value=(datetime.datetime(2024, 6, 15, 12, 00)),
86+
max=(datetime.datetime(2024, 1, 10, 23, 59)),
87+
value=(datetime.datetime(2024, 1, 5, 12, 00)),
8888
width="600px",
8989
),
9090
slider_row(

tests/playwright/shiny/inputs/input_slider/test_input_slider_app.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,39 +169,37 @@ def test_slider_date_format(page: Page, local_app: ShinyAppProc) -> None:
169169

170170
s5 = controller.InputSlider(page, "s5")
171171
s5.expect_label("Date format")
172-
s5.expect_value("04/15/24")
172+
s5.expect_value("01/05/24")
173173
s5.expect_min(convert_to_utc_date("01/01/24"))
174-
s5.expect_max(convert_to_utc_date("12/31/24"))
174+
s5.expect_max(convert_to_utc_date("01/10/24"))
175175
s5.expect_time_format("%m/%d/%y")
176176
s5.expect_timezone("-0500")
177177
s5.expect_drag_range(None)
178-
controller.OutputTextVerbatim(page, "txt5").expect_value("2024-04-15")
178+
controller.OutputTextVerbatim(page, "txt5").expect_value("2024-01-05")
179179

180-
new_val = "02/14/24"
180+
new_val = "01/08/24"
181181
s5.set(new_val)
182182
s5.expect_value(new_val)
183-
controller.OutputTextVerbatim(page, "txt5").expect_value("2024-02-14")
183+
controller.OutputTextVerbatim(page, "txt5").expect_value("2024-01-08")
184184

185185

186186
def test_slider_time_format(page: Page, local_app: ShinyAppProc) -> None:
187187
page.goto(local_app.url)
188188

189189
s6 = controller.InputSlider(page, "s6")
190190
s6.expect_label("Time format")
191-
s6.expect_value("2024-06-15 12:00:00")
191+
s6.expect_value("2024-01-05 12:00:00")
192192
s6.expect_min(convert_to_utc_date_time("2024-01-01 00:00:00"))
193-
s6.expect_max(convert_to_utc_date_time("2024-12-31 23:59:00"))
193+
s6.expect_max(convert_to_utc_date_time("2024-01-10 23:59:00"))
194194
s6.expect_time_format("%F %T")
195195
s6.expect_width("600px")
196196
s6.expect_drag_range(None)
197-
controller.OutputTextVerbatim(page, "txt6").expect_value("2024-06-15 19:00:00")
197+
controller.OutputTextVerbatim(page, "txt6").expect_value("2024-01-05 20:00:00")
198198

199-
new_val = "2024-02-02 22:33:30"
199+
new_val = "2024-01-01 00:00:00"
200200
s6.set(new_val)
201201
s6.expect_value(new_val)
202-
controller.OutputTextVerbatim(page, "txt6").expect_value(
203-
"2024-02-03 06:33:30.600000"
204-
)
202+
controller.OutputTextVerbatim(page, "txt6").expect_value("2024-01-01 08:00:00")
205203

206204

207205
def test_slider_drag_range_disabled(page: Page, local_app: ShinyAppProc) -> None:

0 commit comments

Comments
 (0)