Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8328716

[TestBug] Screen capturing utility for failed tests

XMLWordPrintable

    • Fix Understood

      Create a JUnit5-compatible utility to capture screenshots of failed headful tests. The idea is that a certain annotation can be added to an intermittently failing test or a test that fails on a certain platform to capture the screenshot for debugging:

      ```
      @ExtendWith(ScreenCaptureTestWatcher.class)
      ```

      Screenshots of the primary screen will be captured in PNG format, encoded to a Base64 string, and logged to stderr.
      A special utility is then needed to extract the actual screenshot image from the log file (I am thinking of Monkey Tester, but it can be a standalone app or a script).

      QUESTIONS

      - stdout or stderr?
      - format? hex/base64?
      - should it emit a valid JSON segment to be compatible with any log viewer applications that understand JSON? i.e. `{ screenshot:"...base64..." }`
      - do we need a separate decoder script or Monkey Tester is enough?

      MAILING LIST

      https://mail.openjdk.org/pipermail/openjfx-dev/2024-March/046124.html
      https://mail.openjdk.org/pipermail/openjfx-dev/2024-March/046125.html

            angorya Andy Goryachev
            angorya Andy Goryachev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: