feat: add UI E2E tests [IDE-1347] #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: UI Tests - PR | |
| on: | |
| pull_request: | |
| paths: | |
| - 'src/main/kotlin/io/snyk/plugin/ui/**' | |
| - 'src/test/kotlin/io/snyk/plugin/ui/**' | |
| - 'build.gradle.kts' | |
| - '.github/workflows/ui-tests-pr.yml' | |
| jobs: | |
| ui-component-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Setup virtual display | |
| run: | | |
| export DISPLAY=:99 | |
| Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 & | |
| echo "DISPLAY=:99" >> $GITHUB_ENV | |
| - name: Build Plugin | |
| run: ./gradlew buildPlugin --info | |
| - name: Run Component UI Tests | |
| run: ./gradlew runUiTests --tests "*UITest" --info | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ui-test-results | |
| path: | | |
| build/reports/tests/ | |
| build/test-results/ | |
| - name: Generate test report | |
| if: always() | |
| uses: dorny/test-reporter@v1 | |
| with: | |
| name: 'UI Component Test Results' | |
| path: 'build/test-results/**/*.xml' | |
| reporter: java-junit | |
| fail-on-error: false |