Skip to content

Commit 6af6b59

Browse files
committed
Set pixel_ratio in outlined button screenshot tests
Updated screenshot assertions in the handling_clicks test to specify the pixel_ratio parameter, ensuring screenshots are taken with the correct scaling.
1 parent b019017 commit 6af6b59

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

sdk/python/packages/flet/integration_tests/examples/material/test_outlined_button.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
import flet as ft
44
import flet.testing as ftt
5-
65
from examples.controls.outlined_button import (
76
basic,
87
custom_content,
9-
icons,
108
handling_clicks,
9+
icons,
1110
)
1211

1312

@@ -77,19 +76,25 @@ async def test_handling_clicks(flet_app_function: ftt.FletTestApp):
7776
await flet_app_function.tester.pump_and_settle()
7877
flet_app_function.assert_screenshot(
7978
"handling_clicks1",
80-
await flet_app_function.page.take_screenshot(),
79+
await flet_app_function.page.take_screenshot(
80+
pixel_ratio=flet_app_function.screenshots_pixel_ratio
81+
),
8182
)
8283
await flet_app_function.tester.tap(ob)
8384
await flet_app_function.tester.pump_and_settle()
8485
flet_app_function.assert_screenshot(
8586
"handling_clicks2",
86-
await flet_app_function.page.take_screenshot(),
87+
await flet_app_function.page.take_screenshot(
88+
pixel_ratio=flet_app_function.screenshots_pixel_ratio
89+
),
8790
)
8891
await flet_app_function.tester.tap(ob)
8992
await flet_app_function.tester.pump_and_settle()
9093
flet_app_function.assert_screenshot(
9194
"handling_clicks3",
92-
await flet_app_function.page.take_screenshot(),
95+
await flet_app_function.page.take_screenshot(
96+
pixel_ratio=flet_app_function.screenshots_pixel_ratio
97+
),
9398
)
9499

95100
flet_app_function.create_gif(

0 commit comments

Comments
 (0)