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

ui-tests in CI #138

Closed
wants to merge 18 commits into from
14 changes: 7 additions & 7 deletions .github/workflows/check.yml → .github/workflows/root_check.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: check
name: root

on:
push:
branches:
- master
pull_request:
#on:
# push:
# branches:
# - master
# pull_request:

jobs:
tests:
strategy:
matrix:
os: [ ubuntu-latest ]
gradle-properties-version: [ 232, 233 ]
os: [ ubuntu-latest ]

runs-on: ${{ matrix.os }}
env:
Expand Down
119 changes: 119 additions & 0 deletions .github/workflows/ui_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: ui
on:
push:
branches:
- master
pull_request:

jobs:
run-ui-tests:
name: run tests for ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
runIde: |
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1920x1080x24 &
sleep 10
mkdir -p ui-tests/build/reports
./gradlew :plugin:runIdeForUiTests > ui-tests/build/reports/idea.log &
runTests: |
export DISPLAY=:99.0
./gradlew :ui-tests:test
url: http://127.0.0.1:8082
reportName: ui-tests-fails-report-linux
# - os: macOS-latest
# runIde: ./gradlew :plugin:runIdeForUiTests &
# runTests: ./gradlew :ui-tests:test
# url: http://127.0.0.1:8082
# reportName: ui-test-fails-report-mac
# - os: windows-latest
# runIde: start gradlew.bat :plugin:runIdeForUiTests
# runTests: ./gradlew :ui-tests:test
# url: http://localhost:8082
# reportName: ui-test-fails-report-windows

runs-on: ${{ matrix.os }}
steps:
- uses: actions/[email protected]

- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
with:
# Not strictly necessary, but it may prevent rate limit
# errors especially on GitHub-hosted macos machines.
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Java
uses: actions/[email protected]
with:
distribution: zulu
java-version: 17

# - name: Build
# uses: gradle/[email protected]
# with:
# gradle-version: wrapper
# cache-read-only: false
# arguments: "assemble testClasses -Pkotlin.incremental=false --no-daemon --stacktrace"
# gradle-home-cache-excludes: |
# caches/modules-2/files-2.1/com.jetbrains.intellij.pycharm
# caches/modules-2/files-2.1/com.jetbrains.intellij.idea
# caches/modules-2/files-2.1/com.jetbrains.intellij.clion

- name: Setup Gradle and dependencies
uses: gradle/actions/[email protected]
with:
gradle-version: wrapper
cache-read-only: false
arguments: ":resolveDependencies -Pkotlin.incremental=false --no-daemon"
gradle-home-cache-excludes: |
caches/modules-2/files-2.1/com.jetbrains.intellij.pycharm
caches/modules-2/files-2.1/com.jetbrains.intellij.idea
caches/modules-2/files-2.1/com.jetbrains.intellij.clion

# - name: Prepare UI testing sandbox
# uses: gradle/[email protected]
# with:
# gradle-version: wrapper
# arguments: ":plugin:prepareUiTestingSandbox -Pkotlin.incremental=false --no-daemon --stacktrace"
# gradle-home-cache-excludes: |
# caches/modules-2/files-2.1/com.jetbrains.intellij.pycharm
# caches/modules-2/files-2.1/com.jetbrains.intellij.idea
# caches/modules-2/files-2.1/com.jetbrains.intellij.clion
- name: Clean plugin
run: ./gradlew :plugin:clean

- name: Clean ui-tests
run: ./gradlew :ui-tests:clean

- name: Run Idea
run: ${{ matrix.runIde }}

- name: Wait for Idea started
uses: jtalk/url-health-check-action@v3
with:
url: ${{ matrix.url }}
max-attempts: 15
retry-delay: 30s

- name: Run tests
run: ${{ matrix.runTests }}

- name: Move video
if: ${{ failure() }}
run: mv ui-tests/video ui-tests/build/reports
#
- name: Copy logs
if: ${{ failure() }}
run: mv ui-tests/build/idea-sandbox/system/log/ ui-tests/build/reports

- name: Save fails report
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.reportName }}
path: |
ui-tests/build/reports
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ project(":plugin") {

runIdeForUiTests {
systemProperty("robot-server.port", "8082")
// systemProperty "ide.mac.message.dialogs.as.sheets", "false"
// systemProperty "jb.privacy.policy.text", "<!--999.999-->"
// systemProperty "jb.consents.confirmation.enabled", "false"
// systemProperty "ide.mac.file.chooser.native", "false"
// systemProperty "jbScreenMenuBar.enabled", "false"
// systemProperty "apple.laf.useScreenMenuBar", "false"
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
systemProperty("jb.consents.confirmation.enabled", "false")
systemProperty("ide.mac.file.chooser.native", "false")
systemProperty("jbScreenMenuBar.enabled", "false")
systemProperty("apple.laf.useScreenMenuBar", "false")
systemProperty("idea.trust.all.projects", "true")
systemProperty("ide.show.tips.on.startup.default.value", "false")
}
Expand Down
2 changes: 2 additions & 0 deletions ui-tests/src/test/kotlin/org/move/ui/NewProjectTest.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.move.ui

import com.automation.remarks.junit5.Video
import com.intellij.openapi.util.io.toCanonicalPath
import com.intellij.remoterobot.RemoteRobot
import com.intellij.remoterobot.utils.waitFor
Expand Down Expand Up @@ -46,6 +47,7 @@ class NewProjectTest {
}

@Test
@Video
fun `new project validation`(robot: RemoteRobot) = with(robot) {
welcomeFrame {
selectNewProjectType("Move")
Expand Down
Loading