File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
services/dynamic-scheduler/tests/unit/api_frontend Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 2222SCREENSHOT_SUFFIX = ".ignore.screenshot.png"
2323
2424
25+ async def take_screenshot (async_page : Page , prefix : str = "" ) -> None :
26+ path = SCREENSHOTS_PATH / f"{ prefix } { uuid4 ()} { SCREENSHOT_SUFFIX } "
27+ await async_page .screenshot (path = path )
28+ print (f"Please check :{ path } " )
29+
30+
2531@asynccontextmanager
2632async def take_screenshot_on_error (
2733 async_page : Page ,
@@ -30,10 +36,7 @@ async def take_screenshot_on_error(
3036 yield
3137 # allows to also capture exceptions form `with pytest.raise(...)``
3238 except BaseException :
33- path = SCREENSHOTS_PATH / f"{ uuid4 ()} { SCREENSHOT_SUFFIX } "
34- await async_page .screenshot (path = path )
35- print (f"Please check :{ path } " )
36-
39+ await take_screenshot (async_page )
3740 raise
3841
3942
You can’t perform that action at this time.
0 commit comments