RFR: 8328716: [TestBug] Screen capturing utility for failed tests
Andy Goryachev
angorya at openjdk.org
Mon Mar 31 14:54:38 UTC 2025
On Fri, 28 Mar 2025 21:00:47 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> 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.
>>
>> A possible improvement could be to output a data URL
>>
>> `data:image/png;base64,iVBORw0KGgoAAAANSUhEU...`
>>
>> so it can be rendered in Safari (Chrome truncates the image possibly due to following a url length limit)
>
> tests/system/src/test/java/test/robot/javafx/scene/control/behavior/TextAreaBehaviorRobotTest.java line 40:
>
>> 38: * since the mapped functions require rendered text.
>> 39: */
>> 40: @ExtendWith(ScreenCaptureTestWatcher.class)
>
> A JUnit5 annotation seams like an easy way to mark our robot tests for capture. Are there any drawbacks with this approach?
I don't think so - it's a simple way to plug in into the junit5 framework.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1746#discussion_r2021207520
More information about the openjfx-dev
mailing list