From c38e14a2011a5376dce0ef276cc50df297825b86 Mon Sep 17 00:00:00 2001 From: "eugene.nizienko" Date: Wed, 7 Apr 2021 12:08:14 +0200 Subject: [PATCH] introduced workflow which is launches UI tests on linux, windows and mac #89 --- .github/workflows/run-ui-tests.yml | 84 ++++++++++++++++++++++++++++++ build.gradle.kts | 17 ++++++ 2 files changed, 101 insertions(+) create mode 100644 .github/workflows/run-ui-tests.yml diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml new file mode 100644 index 0000000..455c64c --- /dev/null +++ b/.github/workflows/run-ui-tests.yml @@ -0,0 +1,84 @@ +# GitHub Actions Workflow created for launching UI tests on linux, windows and mac in following steps: +# - prepare and launch Idea with your plugin and robot-server plugin which is need to interact with UI +# - wait for the Idea started +# - run UI tests with separate gradle task + +# Please check https://github.com/JetBrains/intellij-ui-test-robot for information about UI tests with IntelliJ Idea + +# Workflow is triggered manually. + +name: Run UI Tests +on: + workflow_dispatch +jobs: + build-for-ui-test-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 11 + + # Run IDEA prepared for UI testing + - name: Run Idea + run: | + export DISPLAY=:99.0 + Xvfb -ac :99 -screen 0 1920x1080x16 & + gradle runIdeForUiTests & + - name: Wait for Idea started + uses: jtalk/url-health-check-action@v1.4 + with: + url: http://127.0.0.1:8082 + max-attempts: 15 + retry-delay: 30s + + # Run tests + - name: Tests + run: ./gradlew test + + build-for-ui-test-mac-os: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 11 + + # Run IDEA prepared for UI testing + - name: Run Idea + run: ./gradlew runIdeForUiTests & + - name: Wait for Idea started + uses: jtalk/url-health-check-action@v1.4 + with: + url: http://127.0.0.1:8082 + max-attempts: 15 + retry-delay: 30s + + # Run tests + - name: Tests + run: ./gradlew test + + build-for-ui-test-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 11 + + # Run IDEA prepared for UI testing + - name: Run Idea + run: start gradlew.bat runIdeForUiTests + - name: Wait for Idea started + uses: jtalk/url-health-check-action@v1.4 + with: + url: http://127.0.0.1:8082 + max-attempts: 15 + retry-delay: 30s + + # Run tests + - name: Tests + run: gradle test \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index e817fcc..489c4a3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,7 @@ import io.gitlab.arturbosch.detekt.Detekt import org.jetbrains.changelog.markdownToHTML +import org.jetbrains.intellij.tasks.DownloadRobotServerPluginTask +import org.jetbrains.intellij.tasks.RunIdeForUiTestTask import org.jetbrains.kotlin.gradle.tasks.KotlinCompile fun properties(key: String) = project.findProperty(key).toString() @@ -63,6 +65,21 @@ detekt { } } +// Configure UI tests plugin +// Read more: https://github.com/JetBrains/intellij-ui-test-robot +tasks { + withType { + version = "0.10.3" + } + + withType { + systemProperty("robot-server.port", "8082") + systemProperty("ide.mac.message.dialogs.as.sheets", "false") + systemProperty("jb.privacy.policy.text", "") + systemProperty("jb.consents.confirmation.enabled", "false") + } +} + tasks { // Set the compatibility versions to 1.8 withType {