RFR: 8328716: [TestBug] Screen capturing utility for failed tests [v7]
Andy Goryachev
angorya at openjdk.org
Fri Apr 4 21:15:37 UTC 2025
> Introduce a facility, in the form of JUnit5 annotation, to allow for capturing a desktop screenshot of a failed test.
>
> The primary intent is to be able to debug an intermittent test case, rather than wholesale addition of the new annotation to all the tests.
>
> The log contains a base-64 encoded screenshot (like this: `data:image/png;base64,iVBORw0KGgoAAAANSUhEU...` )
> so it can be rendered in Safari (Chrome truncates the image possibly due to following a url length limit)
>
> Additionally, provided a utility class to capture the screenshots at the specific point in a test and write it to stdout/stderr:
>
>
> // write a base-64 encoded screenshot to stderr
> ScreenshotCapture.writeScreenshot(System.err);
>
>
> Example:
>
> 
Andy Goryachev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 17 additional commits since the last revision:
- review comments
- Merge remote-tracking branch 'origin/master' into 8328716.screenshots
- javadoc
- removed watchers
- cleanup
- screen capture
- data url
- testing: inject a failure
- review comments
- prefix
- ... and 7 more: https://git.openjdk.org/jfx/compare/c5a7b213...8668ebb1
-------------
Changes:
- all: https://git.openjdk.org/jfx/pull/1746/files
- new: https://git.openjdk.org/jfx/pull/1746/files/469cd437..8668ebb1
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jfx&pr=1746&range=06
- incr: https://webrevs.openjdk.org/?repo=jfx&pr=1746&range=05-06
Stats: 5206 lines in 101 files changed: 4529 ins; 408 del; 269 mod
Patch: https://git.openjdk.org/jfx/pull/1746.diff
Fetch: git fetch https://git.openjdk.org/jfx.git pull/1746/head:pull/1746
PR: https://git.openjdk.org/jfx/pull/1746
More information about the openjfx-dev
mailing list