From 37065103f803eaa6601ecd6b1c1203127f26b045 Mon Sep 17 00:00:00 2001 From: Iurii Ignatko Date: Wed, 13 Nov 2024 14:49:12 +0100 Subject: [PATCH] Fix xpath for button selection and change test to integration --- .../injection/DevelocityExceptionLogProcessorTest.groovy | 4 ++-- .../plugins/gradle/injection/InjectionConfigTest.groovy | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/groovy/hudson/plugins/gradle/injection/DevelocityExceptionLogProcessorTest.groovy b/src/test/groovy/hudson/plugins/gradle/injection/DevelocityExceptionLogProcessorTest.groovy index c1d9c74d..99336852 100644 --- a/src/test/groovy/hudson/plugins/gradle/injection/DevelocityExceptionLogProcessorTest.groovy +++ b/src/test/groovy/hudson/plugins/gradle/injection/DevelocityExceptionLogProcessorTest.groovy @@ -2,13 +2,13 @@ package hudson.plugins.gradle.injection import hudson.console.ConsoleNote import hudson.model.Actionable +import hudson.plugins.gradle.BaseJenkinsIntegrationTest import hudson.plugins.gradle.BuildScanAction -import spock.lang.Specification import spock.lang.Subject import java.nio.charset.StandardCharsets -class DevelocityExceptionLogProcessorTest extends Specification { +class DevelocityExceptionLogProcessorTest extends BaseJenkinsIntegrationTest { private static final String GRADLE_PLUGIN_ERROR = "Internal error in Gradle Enterprise Gradle plugin: com.acme.FooBar" private static final String MAVEN_EXTENSION_ERROR = "[ERROR] Internal error in Gradle Enterprise Maven extension: com.acme.FooBar" diff --git a/src/test/groovy/hudson/plugins/gradle/injection/InjectionConfigTest.groovy b/src/test/groovy/hudson/plugins/gradle/injection/InjectionConfigTest.groovy index a8cd8f60..493959b3 100644 --- a/src/test/groovy/hudson/plugins/gradle/injection/InjectionConfigTest.groovy +++ b/src/test/groovy/hudson/plugins/gradle/injection/InjectionConfigTest.groovy @@ -334,7 +334,8 @@ class InjectionConfigTest extends BaseJenkinsIntegrationTest { } private static HtmlButton getAddButton(HtmlForm form, String label) { - def xpath = "//div[text() = '$label']/following-sibling::div[contains(@class, 'setting-main')]//span[contains(@class, 'repeatable-add')]//button[text() = 'Add']" + def xpath = "//div[text() = '$label']/following-sibling::div[contains(@class, 'setting-main')]//button[contains(@class, 'repeatable-add')]" + return form.getFirstByXPath(xpath) } }