You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an app developer, it is sometimes necessary to capture the current entire desktop state of a GUI as an image.
The most notable use case is in CI testing, where the screen isn't visible, and test failures are most obvious in their visual presentation; however, there may be some other uses (e.g., an actual "screenshot" app)
Describe the solution you'd like
A cross-platform API to capture an image of the full screen.
As an example of the API in action, modify the testbed test harness so that when a test fails, a screenshot of the screen is captured and written to the cache directory.
Describe alternatives you've considered
Do nothing. Screenshots aren't essential; they're a nice-to-have feature.
The Canvas GUI tests already have tests that write the as_image() representation to disk if the canvas hasn't rendered correctly.
It should be possible to catch a failed test in the teardown of the window_probe() and/or app_probe fixtures in testbed; if an AssertionError is raised during the yield, that will be a test failure; if this occurs, take a screenshot of the window/screen, write to the app cache folder, and re-raise the assertion (so that it is picked up by Pytest).
The text was updated successfully, but these errors were encountered:
What is the problem or limitation you are having?
As an app developer, it is sometimes necessary to capture the current entire desktop state of a GUI as an image.
The most notable use case is in CI testing, where the screen isn't visible, and test failures are most obvious in their visual presentation; however, there may be some other uses (e.g., an actual "screenshot" app)
Describe the solution you'd like
A cross-platform API to capture an image of the full screen.
As an example of the API in action, modify the
testbed
test harness so that when a test fails, a screenshot of the screen is captured and written to the cache directory.Describe alternatives you've considered
Do nothing. Screenshots aren't essential; they're a nice-to-have feature.
Additional context
App.screens[n].as_image()
would seem a logical API.as_image()
representation to disk if the canvas hasn't rendered correctly.window_probe()
and/orapp_probe
fixtures intestbed
; if an AssertionError is raised during theyield
, that will be a test failure; if this occurs, take a screenshot of the window/screen, write to the app cache folder, and re-raise the assertion (so that it is picked up by Pytest).The text was updated successfully, but these errors were encountered: