@@ -34,6 +34,7 @@ async def test_cone(ConeApp, utils, config):
3434 task = app .server .start (exec_mode = "task" , port = 0 )
3535 await app .server .ready
3636 RESULT_BASE = Path (__file__ ).with_name ("results" ) / "cone" / conf_key
37+ valid_image_comparisons = []
3738
3839 async with async_playwright () as p :
3940 browser = await p .chromium .launch (headless = True )
@@ -42,20 +43,38 @@ async def test_cone(ConeApp, utils, config):
4243
4344 await page .goto (f"http://localhost:{ app .server .port } /" )
4445 await expect (page .locator (".readyCount" )).to_have_text ("1" )
45- await utils .assert_screenshot (page , BASELINES [0 ], RESULT_BASE , threshold = 0.1 )
46+ valid_image_comparisons .append (
47+ await utils .compare_screenshot (
48+ page , BASELINES [0 ], RESULT_BASE , threshold = 0.1
49+ )
50+ )
4651
4752 app .resolution = 60
4853 await expect (page .locator (".readyCount" )).to_have_text ("2" )
49- await utils .assert_screenshot (page , BASELINES [1 ], RESULT_BASE , threshold = 0.1 )
54+ valid_image_comparisons .append (
55+ await utils .compare_screenshot (
56+ page , BASELINES [1 ], RESULT_BASE , threshold = 0.1
57+ )
58+ )
5059
5160 app .mounted = False
5261 app .resolution = 4
53- await utils .assert_screenshot (page , BASELINES [2 ], RESULT_BASE , threshold = 0.1 )
62+ valid_image_comparisons .append (
63+ await utils .compare_screenshot (
64+ page , BASELINES [2 ], RESULT_BASE , threshold = 0.1
65+ )
66+ )
5467
5568 app .mounted = True
5669 await asyncio .sleep (0.1 ) # Debounced resize needs complete
5770 await expect (page .locator (".readyCount" )).to_have_text ("3" )
58- await utils .assert_screenshot (page , BASELINES [3 ], RESULT_BASE , threshold = 0.1 )
71+ valid_image_comparisons .append (
72+ await utils .compare_screenshot (
73+ page , BASELINES [3 ], RESULT_BASE , threshold = 0.1
74+ )
75+ )
76+
77+ assert all (valid_image_comparisons ), "Some images don't match"
5978
6079 # Clean up resource
6180 await browser .close ()
0 commit comments