Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate how to get videos/screenshots of failed tests in GHA using VScode extension tester #441

Open
aparnamichael opened this issue Dec 13, 2024 · 1 comment
Assignees
Milestone

Comments

@aparnamichael
Copy link
Contributor

aparnamichael commented Dec 13, 2024

Investigate how to get videos/screenshots of failed tests in GHA using VScode extension tester.
https://github.com/redhat-developer/vscode-extension-tester

@gilbysunil14
Copy link

Follow these steps to take screenshots in GHA and archive it

  1. The following code VSBrowser.instance.takeScreenshot("fileName") will take screenshot of the existing browser window.
  2. The screenshot will be saved in a temporary location. We have to copy the same to a known location in the project folder screenshots. For this use afterAll() hook to copy the screenshot from the temporary location to a new location.
  3. We can get the temporary location of the screen shot from VSBrowser.instance.getScreenshotsDir().
  4. For archiving screenshots in GHA, an additional step needs to be added which is Archive screenshots. An example is shown below:
- name: Archive screenshots
        if: always() && runner.os == 'linux' && matrix.targetVSCode == 'latest'
        uses: actions/upload-artifact@v3
        with:
          name: liberty-run-tests-screenshots-${{ github.sha }}
          path: ./screenshots/*.png
          if-no-files-found: warn
          retention-days: 7

@gilbysunil14 gilbysunil14 moved this from New Issues to In Progress in Open Liberty Developer Experience Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants