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

SLI-1711 Update ITs version #1229

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
slack_notification_script: |
source slack-failure-notification

validate_task:

Check warning on line 116 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L116

task "validate" depends on task "build", but their only_if conditions are different
# name: "Run UTs and trigger SonarQube analysis"
depends_on:
- build
Expand Down Expand Up @@ -141,7 +141,7 @@
slack_notification_script: |
source slack-failure-notification

validate_windows_task:

Check warning on line 144 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L144

task "validate_windows" depends on task "build", but their only_if conditions are different
# name: "Run unit tests on Windows"
depends_on:
- build
Expand Down Expand Up @@ -186,7 +186,7 @@
- env:
IDEA_VERSION: '2022.3.1'
- env:
IDEA_VERSION: '2024.1.4'
IDEA_VERSION: '2024.3.1'
- env:
# It automatically retrieves the latest version available for the given year (likely to be the EAP)
IDEA_VERSION: '2024'
Expand All @@ -210,7 +210,7 @@
slack_notification_script: |
source slack-failure-notification

qa_task:

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different

Check warning on line 213 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L213

task "qa" depends on task "build", but their only_if conditions are different
# name: "Run ITs"
depends_on:
- build
Expand All @@ -234,6 +234,7 @@
GITHUB_TOKEN: VAULT[development/github/token/licenses-ro token]
DISPLAY: :10
JDK_VERSION: "17"
SONAR_JAVA_PATH: "/opt/java/jdk17/bin/java"
SONARCLOUD_IT_PASSWORD: VAULT[development/team/sonarlint/kv/data/sonarcloud-it data.password]
clionKey_file:
path: ${CIRRUS_WORKING_DIR}/its/build/idea-sandbox/config-uiTest/clion.key.b64
Expand Down Expand Up @@ -280,62 +281,62 @@
QA_CATEGORY: 'Idea2022'
TEST_SUITE: 'Standalone'
- env:
IDEA_VERSION: 'IC-2024.1.4'
IDEA_VERSION: 'IC-2024.3.1'
QA_CATEGORY: 'Idea2024'
TEST_SUITE: 'OpenInIdeTests'
- env:
IDEA_VERSION: 'IC-2024.1.4'
IDEA_VERSION: 'IC-2024.3.1'
QA_CATEGORY: 'Idea2024'
TEST_SUITE: 'ConnectedAnalysisTests'
- env:
IDEA_VERSION: 'IC-2024.1.4'
IDEA_VERSION: 'IC-2024.3.1'
QA_CATEGORY: 'Idea2024'
TEST_SUITE: 'ConfigurationTests'
- env:
IDEA_VERSION: 'IC-2024.1.4'
IDEA_VERSION: 'IC-2024.3.1'
QA_CATEGORY: 'Idea2024'
TEST_SUITE: 'Standalone'
- env:
IDEA_VERSION: 'IU-2022.3.1'
QA_CATEGORY: 'IdeaUltimate2022'
- env:
IDEA_VERSION: 'IU-2024.1.4'
IDEA_VERSION: 'IU-2024.3.1'
QA_CATEGORY: 'IdeaUltimate2024'
- env:
IDEA_VERSION: 'PY-2022.3.1'
QA_CATEGORY: 'PyCharmProfessional2022'
- env:
IDEA_VERSION: 'PY-2024.1.4'
IDEA_VERSION: 'PY-2024.3.1'
QA_CATEGORY: 'PyCharmProfessional2024'
- env:
IDEA_VERSION: 'PC-2022.3.1'
QA_CATEGORY: 'PyCharmCommunity2022'
- env:
IDEA_VERSION: 'PC-2024.1.4'
IDEA_VERSION: 'PC-2024.3.1'
QA_CATEGORY: 'PyCharmCommunity2024'
- env:
IDEA_VERSION: 'RD-2022.3.1'
QA_CATEGORY: 'Rider2022'
- env:
IDEA_VERSION: 'RD-2024.1.4'
IDEA_VERSION: 'RD-2024.3.1'
QA_CATEGORY: 'Rider2024'
- env:
IDEA_VERSION: 'PS-2022.3.1'
QA_CATEGORY: 'PhpStorm2022'
- env:
IDEA_VERSION: 'PS-2024.1.4'
IDEA_VERSION: 'PS-2024.3.1'
QA_CATEGORY: 'PhpStorm2024'
- env:
IDEA_VERSION: 'GO-2022.3.1'
QA_CATEGORY: 'GoLand2022'
- env:
IDEA_VERSION: 'GO-2024.1.4'
IDEA_VERSION: 'GO-2024.3.1'
QA_CATEGORY: 'GoLand2024'
- env:
IDEA_VERSION: 'CL-2022.3.1'
QA_CATEGORY: 'CLion2022'
- env:
IDEA_VERSION: 'CL-2024.1.4'
IDEA_VERSION: 'CL-2024.3.1'
QA_CATEGORY: 'CLion2024'
<<: *SETUP_GRADLE_CACHE
xvfb_background_script: |
Expand Down Expand Up @@ -369,7 +370,7 @@
run_its_script: |
echo "Run ITs on ${IDEA_VERSION}"
source .cirrus/use-gradle-wrapper.sh
gradle :its:check --stacktrace -i -PijVersion=${IDEA_VERSION} -PslPluginDirectory=${CIRRUS_WORKING_DIR}/staged-plugin
gradle :its:check --stacktrace -i -PijVersion=${IDEA_VERSION} -PslPluginDirectory=${CIRRUS_WORKING_DIR}/staged-plugin -Dorchestrator.configUrl=file:///$CIRRUS_WORKING_DIR/its/orchestrator.properties
<<: *CLEANUP_GRADLE_CACHE_SCRIPT
always:
stop_recording_script: |
Expand All @@ -393,7 +394,7 @@
slack_notification_script: |
source slack-failure-notification

inspect_orchestrator_cache_task:

Check warning on line 397 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L397

task "inspect_orchestrator_cache" depends on task "build", but their only_if conditions are different
<<: *ONLY_PR_AND_MAINTAINED_BRANCHES
depends_on: build
eks_container:
Expand Down Expand Up @@ -437,7 +438,7 @@
slack_notification_script: |
source slack-failure-notification

promote_task:

Check warning on line 441 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L441

task "promote" depends on task "mend_scan", but their only_if conditions are different

Check warning on line 441 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L441

task "promote" depends on task "build", but their only_if conditions are different
depends_on:
- build
- validate
Expand Down
5 changes: 5 additions & 0 deletions .cirrus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ USER root

ENV NODE_VERSION=18

RUN wget https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-x64_bin.tar.gz && \
mkdir -p /opt/java/jdk17 && \
tar -xzf jdk-17.0.12_linux-x64_bin.tar.gz -C /opt/java/jdk17 --strip-components=1 && \
rm jdk-17.0.12_linux-x64_bin.tar.gz

RUN apt-get update && apt-get install -y metacity xvfb xauth ffmpeg \
nodejs=${NODE_VERSION}.* \
build-essential \
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ allprojects {
}
}


tasks.cyclonedxBom {
setIncludeConfigs(listOf("runtimeClasspath", "sqplugins_deps"))
inputs.files(configurations.runtimeClasspath, configurations.archives.get())
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ commons-lang3 = "3.17.0"
commons-text = "1.12.0"
findbugs-jsr305 = "3.0.2"
junit-bom = "5.11.3"
junit4 = "4.13.2"
mockito-kotlin = "5.4.0"
awaitility = "4.2.2"

Expand Down Expand Up @@ -61,6 +62,7 @@ commons-langs3 = { module = "org.apache.commons:commons-lang3", version.ref = "c
commons-text = { module = "org.apache.commons:commons-text", version.ref = "commons-text" }
findbugs-jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "findbugs-jsr305" }
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit-bom" }
junit4 = { module = "junit:junit", version.ref = "junit4" }
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockito-kotlin" }
awaitility = { module = "org.awaitility:awaitility", version.ref = "awaitility" }

Expand Down
11 changes: 11 additions & 0 deletions its/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ dependencies {
testImplementation(libs.junit.api)
testImplementation(libs.assertj.core)
testRuntimeOnly(libs.junit.engine)
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#junit5-test-framework-refers-to-junit4
testRuntimeOnly(libs.junit4)
}

tasks.test {
useJUnitPlatform {
System.getenv("SONAR_JAVA_PATH")?.let {
executable = it
}
val tag = System.getenv("TEST_SUITE")

if (tag != null && (tag == "OpenInIdeTests" || tag == "ConnectedAnalysisTests"
Expand All @@ -46,6 +51,9 @@ tasks.test {
}
}
testLogging.showStandardStreams = true
System.getenv("SONAR_JAVA_PATH")?.let {
executable = it
}
}

license {
Expand Down Expand Up @@ -81,6 +89,9 @@ intellij {
val runIdeDirectory: String by project

tasks.runIdeForUiTests {
System.getenv("SONAR_JAVA_PATH")?.let {
executable = it
}
systemProperty("sonarlint.internal.sonarcloud.url", "https://sc-staging.io")
systemProperty("sonarlint.internal.sonarcloud.websocket.url", "wss://events-api.sc-staging.io/")
systemProperty("robot-server.port", "8082")
Expand Down
21 changes: 21 additions & 0 deletions its/orchestrator.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# SonarLint for IntelliJ IDEA
# Copyright (C) 2015-2024 SonarSource
# [email protected]
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
#
java.home=/opt/java/jdk17
sonar.java.path=/opt/java/jdk17/bin/java
16 changes: 14 additions & 2 deletions its/src/test/kotlin/org/sonarlint/intellij/its/BaseUiTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ import org.sonarlint.intellij.its.fixtures.isGoLand
import org.sonarlint.intellij.its.fixtures.isGoPlugin
import org.sonarlint.intellij.its.fixtures.isIdea
import org.sonarlint.intellij.its.fixtures.isJavaScriptPlugin
import org.sonarlint.intellij.its.fixtures.isModernUI
import org.sonarlint.intellij.its.fixtures.isPhpStorm
import org.sonarlint.intellij.its.fixtures.isPyCharm
import org.sonarlint.intellij.its.fixtures.isRider
import org.sonarlint.intellij.its.fixtures.isSQLPlugin
import org.sonarlint.intellij.its.fixtures.tool.window.TabContentFixture
import org.sonarlint.intellij.its.fixtures.tool.window.leftToolWindow
import org.sonarlint.intellij.its.fixtures.tool.window.toolWindow
import org.sonarlint.intellij.its.utils.OpeningUtils.Companion.closeProject
import org.sonarlint.intellij.its.utils.StepsLogger
Expand Down Expand Up @@ -157,8 +159,13 @@ open class BaseUiTest {
private fun sonarlintLogPanel(function: TabContentFixture.() -> Unit = {}) {
with(remoteRobot) {
idea {
if (remoteRobot.isModernUI()) {
leftToolWindow("SonarQube for IDE") {
ensureOpen()
}
}
toolWindow("SonarQube for IDE") {
ensureOpen()
if (remoteRobot.isModernUI().not()) ensureOpen()
tabTitleContains("Log") { select() }
content("SonarLintLogPanel") {
this.apply(function)
Expand All @@ -171,8 +178,13 @@ open class BaseUiTest {
private fun cmakePanel(function: TabContentFixture.() -> Unit = {}) {
with(remoteRobot) {
idea {
if (remoteRobot.isModernUI()) {
leftToolWindow("SonarQube for IDE") {
ensureOpen()
}
}
toolWindow("CMake") {
ensureOpen()
if (remoteRobot.isModernUI().not()) ensureOpen()
tabTitleContains("Debug") { select() }
content("DataProviderPanel") {
this.apply(function)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ class ActionMenuFixture(
}

fun item(label: String, function: ActionMenuItemFixture.() -> Unit = {}): ActionMenuItemFixture {
return findElement<ActionMenuItemFixture>(byXpath("menu item $label", "//div[@class='ActionMenuItem' and @text='$label']")).apply(function)
return if (remoteRobot.isModernUI()) {
findElement<ActionMenuItemFixture>(byXpath("//div[@text='$label']")).apply(
function
)
} else {
findElement<ActionMenuItemFixture>(byXpath("menu item $label", "//div[@class='ActionMenuItem' and @text='$label']")).apply(
function
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import com.intellij.remoterobot.fixtures.FixtureName
import com.intellij.remoterobot.search.locators.byXpath
import com.intellij.remoterobot.stepsProcessing.step
import com.intellij.remoterobot.utils.WaitForConditionTimeoutException
import com.intellij.remoterobot.utils.keyboard
import com.intellij.remoterobot.utils.waitFor
import java.awt.event.KeyEvent
import java.time.Duration
import org.sonarlint.intellij.its.utils.optionalStep

Expand Down Expand Up @@ -103,10 +105,14 @@ class IdeaFrame(remoteRobot: RemoteRobot, remoteComponent: RemoteComponent) : Co
println("Check background tasks - done")
}

fun actionMenu(label: String, function: ActionMenuFixture.() -> Unit): ActionMenuFixture {
return findAll<ActionMenuFixture>(byXpath("menu $label", "//div[@class='ActionMenu' and @text='$label']"))[0].apply(function)
}

fun actionMenu(label: String, function: ActionMenuFixture.() -> Unit): ActionMenuFixture {
return if (remoteRobot.isModernUI()) {
find<ActionMenuFixture>(byXpath("menu $label", "//div[@tooltiptext='Main Menu']")).apply(function)
} else {
findAll<ActionMenuFixture>(byXpath("menu $label", "//div[@class='ActionMenu' and @text='$label']"))[0].apply(function)
}
}

fun IdeaFrame.analyzeFile() {
editorComponent().rightClick()
actionMenuItem("Analyze with SonarQube for IDE") {
Expand All @@ -128,10 +134,16 @@ class IdeaFrame(remoteRobot: RemoteRobot, remoteComponent: RemoteComponent) : Co
}

fun openSettings() {
actionMenu("File") {
open()
item("Settings...") {
click()
if (remoteRobot.isModernUI()) {
keyboard {
hotKey(KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_S)
}
} else {
actionMenu("File") {
open()
item("Settings...") {
click()
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,25 @@ fun RemoteRobot.isGoPlugin() = callJs<Boolean>("com.intellij.ide.plugins.PluginM
fun RemoteRobot.isSQLPlugin() = callJs<Boolean>("com.intellij.ide.plugins.PluginManager.isPluginInstalled(com.intellij.openapi.extensions.PluginId.getId('com.intellij.database'))")
fun RemoteRobot.isJavaScriptPlugin() =
callJs<Boolean>("com.intellij.ide.plugins.PluginManager.isPluginInstalled(com.intellij.openapi.extensions.PluginId.getId('JavaScript'))")

private fun RemoteRobot.majorVersion() =
callJs<String>("com.intellij.openapi.application.ApplicationInfo.getInstance().getMajorVersion()")

private fun RemoteRobot.minorVersion() =
callJs<String>("com.intellij.openapi.application.ApplicationInfo.getInstance().getMinorVersion()")

fun RemoteRobot.isModernUI(): Boolean {
val version = "${this.majorVersion()}.${this.minorVersion()}"
val referenceVersion = "2024.2"
val versionParts = version.split(".").map { it.toInt() }
val referenceParts = referenceVersion.split(".").map { it.toInt() }

for (i in versionParts.indices) {
if (i >= referenceParts.size || versionParts[i] > referenceParts[i]) {
return true
} else if (versionParts[i] < referenceParts[i]) {
return false
}
}
return versionParts.size > referenceParts.size
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ import com.intellij.remoterobot.fixtures.DefaultXpath
import com.intellij.remoterobot.fixtures.FixtureName
import com.intellij.remoterobot.search.locators.byXpath
import com.intellij.remoterobot.stepsProcessing.step
import java.time.Duration
import org.sonarlint.intellij.its.fixtures.findElement
import org.sonarlint.intellij.its.fixtures.isModernUI
import org.sonarlint.intellij.its.fixtures.stripeButton
import java.time.Duration

fun ContainerFixture.toolWindow(
title: String,
Expand All @@ -40,6 +41,15 @@ fun ContainerFixture.toolWindow(
toolWindowPane.apply(function)
}

fun ContainerFixture.leftToolWindow(
title: String,
function: ToolWindowFixture.() -> Unit = {}
): ToolWindowFixture = step("Search for tool window with title $title") {
val toolWindowPane = find<ToolWindowFixture>(byXpath("//div[@class='ToolWindowLeftToolbar']"), Duration.ofSeconds(5))
toolWindowPane.title = title
toolWindowPane.apply(function)
}

// Panel class name changed from ToolWindowsPane to ToolWindowPane in 2022.x
@DefaultXpath(by = "ToolWindow type", xpath = "//div[@class='ToolWindowsPane' or @class='ToolWindowPane']")
@FixtureName(name = "Tool Window")
Expand All @@ -50,7 +60,15 @@ class ToolWindowFixture(remoteRobot: RemoteRobot, remoteComponent: RemoteCompone
findElement<TabTitleFixture>(byXpath("tab with title $title", "//div[@class='ContentTabLabel' and @text='$title']")).apply(function)

fun tabTitleContains(text: String, function: TabTitleFixture.() -> Unit = {}): TabTitleFixture {
return findElement<TabTitleFixture>(byXpath("tab with title $text", "//div[@class='ContentTabLabel' and contains(@text, '$text')]")).apply(function)
return if (remoteRobot.isModernUI()) {
findElement<TabTitleFixture>(byXpath("tab with title $text", "//div[@text='$text']")).apply(
function
)
} else {
findElement<TabTitleFixture>(byXpath("tab with title $text", "//div[@class='ContentTabLabel' and contains(@text, '$text')]")).apply(
function
)
}
}

fun content(classType: String, function: TabContentFixture.() -> Unit = {}) =
Expand All @@ -60,7 +78,12 @@ class ToolWindowFixture(remoteRobot: RemoteRobot, remoteComponent: RemoteCompone
findElement<ComponentFixture>(byXpath("card with type $classType", "//div[@class='$classType']"))

fun ensureOpen() {
stripeButton(title).open()
if (remoteRobot.isModernUI()) {
val button = findElement<ComponentFixture>(byXpath("//div[@tooltiptext='SonarQube for IDE']"))
if (button.callJs<Boolean>("component.isSelected()").not()) button.click()
} else {
stripeButton(title).open()
}
}

}
Loading
Loading