-
Notifications
You must be signed in to change notification settings - Fork 762
UI Testing Support with IntelliJ IDE Starter #537
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
base: next
Are you sure you want to change the base?
Changes from 6 commits
369aca6
3593822
a7ce21a
625b535
cd3c772
9bdc82c
b00eeae
93a5cc9
eef98e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # GitHub Actions Workflow for launching UI tests on Linux, Windows, and Mac in the following steps: | ||
| # - Prepare and launch IDE with your plugin and robot-server plugin, which is needed to interact with the UI. | ||
| # - Wait for IDE to start. | ||
| # GitHub Actions Workflow for launching UI tests on Linux and Mac in the following steps: | ||
| # - Prepare and launch IDE with your plugin and robot-server plugin, which is necessary to interact with the UI. | ||
| # - Wait for IDE to start | ||
| # - Run UI tests with a separate Gradle task. | ||
| # | ||
| # Please check https://github.com/JetBrains/intellij-ui-test-robot for information about UI tests with IntelliJ Platform. | ||
|
|
@@ -12,28 +12,28 @@ on: | |
| workflow_dispatch | ||
|
|
||
| jobs: | ||
|
|
||
| # UI Test Jobs (one per OS/test combination) | ||
| testUI: | ||
| runs-on: ${{ matrix.os }} | ||
| name: Run UI Test on ${{ matrix.osName }} | ||
| runs-on: ${{ matrix.runner }} | ||
| permissions: | ||
| contents: write | ||
| checks: write | ||
| pull-requests: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-latest | ||
| runIde: | | ||
| export DISPLAY=:99.0 | ||
| Xvfb -ac :99 -screen 0 1920x1080x16 & | ||
| gradle runIdeForUiTests & | ||
| - os: windows-latest | ||
| runIde: start gradlew.bat runIdeForUiTests | ||
| - os: macos-latest | ||
| runIde: ./gradlew runIdeForUiTests & | ||
| # Linux test | ||
| - runner: ubuntu-latest | ||
| osName: Linux | ||
| # macOS test | ||
| - runner: macos-latest | ||
| osName: macOS | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had firewall issues when running on Windows ( also with the previous Robot Framework) |
||
|
|
||
| steps: | ||
|
|
||
| # Check out the current repository | ||
| - name: Fetch Sources | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v5 | ||
|
|
||
| # Set up the Java environment for the next steps | ||
| - name: Setup Java | ||
|
|
@@ -44,22 +44,100 @@ jobs: | |
|
|
||
| # Setup Gradle | ||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v4 | ||
| uses: gradle/actions/setup-gradle@v4.2.2 | ||
| with: | ||
| cache-read-only: true | ||
|
|
||
| # Run IDEA prepared for UI testing | ||
| - name: Run IDE | ||
| run: ${{ matrix.runIde }} | ||
| # Set up Xvfb for Linux headless mode | ||
| - name: Setup Xvfb for Linux | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| sudo apt-get update -y | ||
| sudo apt-get install -y xvfb x11-utils libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 | ||
| export DISPLAY=:99.0 | ||
| Xvfb -ac :99 -screen 0 1920x1080x16 & | ||
| sleep 3 | ||
| echo "DISPLAY=:99.0" >> $GITHUB_ENV | ||
|
|
||
| # Run UI test with IDE Starter framework | ||
| - name: Run UI Test | ||
| env: | ||
| CODECOV_API_TOKEN: ${{ secrets.CODECOV_API_TOKEN }} | ||
| LICENSE_KEY: ${{ secrets.LICENSE_KEY }} | ||
| UI_BRANCH_NAME: "${{ matrix.osName }}-${{ github.ref_name }}" | ||
| DISPLAY: ${{ runner.os == 'Linux' && ':99.0' || '' }} | ||
| run: | | ||
| echo "UI on ${{ matrix.osName }} run #: ${{ github.run_number }} and id: ${{ github.run_id }}" | ||
| ./gradlew uiTest | ||
| timeout-minutes: 30 | ||
|
|
||
| # List build directory for debugging | ||
| - name: List build directory structure | ||
| if: always() | ||
| shell: bash | ||
| run: | | ||
| echo "=== Build directory structure ===" | ||
| if [ -d "build" ]; then | ||
| find build -type d -name "log" -o -name "screenshots" -o -name "ui-hierarchy" 2>/dev/null | head -20 || true | ||
| echo "=== Looking for IDE test output ===" | ||
| find build -type d -path "*/ide-tests/*" 2>/dev/null | head -20 || true | ||
| else | ||
| echo "Build directory not found" | ||
| fi | ||
|
|
||
| - name: Collect Test Results | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be removed if we update SetUp.kt to use full CI integration with the DI framework. |
||
| if: always() | ||
| uses: actions/[email protected] | ||
| with: | ||
| name: tests-result-${{ matrix.osName }} | ||
| path: | | ||
| build/reports/ | ||
| build/test-results/ | ||
| build/out/ | ||
| build/idea-sandbox/ | ||
| build/**/*.log | ||
| build/**/screenshots/ | ||
| build/**/ui-hierarchy/ | ||
| if-no-files-found: warn | ||
| continue-on-error: true | ||
|
|
||
| - name: Collect Test Report XML | ||
| if: always() | ||
| uses: actions/[email protected] | ||
| with: | ||
| name: test-report-${{ matrix.osName }} | ||
| path: ${{ github.workspace }}/build/test-results/uiTest/*.xml | ||
|
|
||
| # Test report job using dorny/test-reporter | ||
| test-report: | ||
| name: UI Test Report | ||
| needs: testUI | ||
| runs-on: ubuntu-latest | ||
| if: always() | ||
| permissions: | ||
| contents: write | ||
| checks: write | ||
| pull-requests: write | ||
| actions: read | ||
|
|
||
| # Wait for IDEA to be started | ||
| - name: Health Check | ||
| uses: jtalk/url-health-check-action@v4 | ||
| steps: | ||
| - name: Fetch Sources | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| url: http://127.0.0.1:8082 | ||
| max-attempts: 15 | ||
| retry-delay: 30s | ||
| token: '${{ secrets.GITHUB_TOKEN }}' | ||
|
|
||
| # Run tests | ||
| - name: Tests | ||
| run: ./gradlew test | ||
| - name: Download all test reports | ||
| uses: actions/[email protected] | ||
| with: | ||
| pattern: test-report-* | ||
| path: test-reports | ||
| merge-multiple: true | ||
|
|
||
| - name: Generate Test Report | ||
| uses: dorny/[email protected] | ||
| if: success() || failure() | ||
| with: | ||
| name: UI Test Report Dashboard | ||
| reporter: java-junit | ||
| fail-on-error: 'true' | ||
| path: 'test-reports/*.xml' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <component name="ProjectRunConfigurationManager"> | ||
| <configuration default="false" name="Run UI Tests" type="GradleRunConfiguration" factoryName="Gradle"> | ||
| <ExternalSystemSettings> | ||
| <option name="executionName" /> | ||
| <option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||
| <option name="externalSystemIdString" value="GRADLE" /> | ||
| <option name="scriptParameters" value="" /> | ||
| <option name="taskDescriptions"> | ||
| <list /> | ||
| </option> | ||
| <option name="taskNames"> | ||
| <list> | ||
| <option value="uiTest" /> | ||
| </list> | ||
| </option> | ||
| <option name="vmOptions" /> | ||
| </ExternalSystemSettings> | ||
| <ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess> | ||
| <ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess> | ||
| <DebugAllEnabled>false</DebugAllEnabled> | ||
| <RunAsTest>false</RunAsTest> | ||
| <method v="2" /> | ||
| </configuration> | ||
| </component> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed only because we run the check - the test task already has the tag exclusion, so when running the test task in the IDE or Gradle, it runs only the unit-tests