From 4962f4bbc3877c439c90216e96b7b9ea28f3239d Mon Sep 17 00:00:00 2001 From: Puneet Behl Date: Sun, 17 Mar 2024 10:40:01 +0530 Subject: [PATCH] test(deps): udpate webdriver binaries to 3.2 * Update `webdriver-binaries` gradle plugin to 3.2 * Fixes #184 `java.lang.NoClassDefFoundError: org/openqa/selenium/interactions/HasTouchScreen` by forcing seleniumVersion. This is due to conflict in the selenium libraries. --- build.gradle | 30 ++++++++++++++++++------------ gradle.properties | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index b438fa12..052e10a9 100644 --- a/build.gradle +++ b/build.gradle @@ -5,17 +5,17 @@ buildscript { dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.6.1' - classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" + classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" } } -version project.projectVersion group "org.grails.plugins" +version project.projectVersion apply plugin:"eclipse" apply plugin:"idea" apply plugin: "com.github.erdi.webdriver-binaries" -apply from:"https://raw.githubusercontent.com/grails/grails-common-build/master/common-docs.gradle" +apply from:"https://raw.githubusercontent.com/grails/grails-common-build/v2.0.3/common-docs.gradle" apply plugin:"org.grails.grails-plugin" apply plugin:"org.grails.internal.grails-plugin-publish" @@ -23,6 +23,16 @@ repositories { maven { url "https://repo.grails.org/grails/core" } } +configurations { + all { + resolutionStrategy.eachDependency { DependencyResolveDetails details-> + if (details.requested.group == 'org.seleniumhq.selenium') { + details.useVersion(seleniumVersion) + } + } + } +} + dependencies { api "org.springframework.boot:spring-boot-starter-logging" api "org.springframework.boot:spring-boot-autoconfigure" @@ -64,25 +74,22 @@ dependencies { testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion" testImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion" - api "com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2" - - } + apply from: rootProject.file('gradle/testVerbose.gradle') webdriverBinaries { - if (!System.getenv().containsKey('GITHUB_ACTIONS')) { + if (!System.getenv().containsKey('CI')) { chromedriver "$chromeDriverVersion" geckodriver "$geckodriverVersion" } } tasks.withType(Test) { - systemProperty "geb.env", System.getProperty('geb.env', 'chromeHeadless') + systemProperty "geb.env", System.getProperty('geb.env') systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest") - - if (!System.getenv().containsKey('GITHUB_ACTIONS')) { + if (!System.getenv().containsKey('CI')) { systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver') systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver') } else { @@ -101,8 +108,7 @@ bootRun { String springProfilesActive = 'spring.profiles.active' systemProperty springProfilesActive, System.getProperty(springProfilesActive) } -// enable if you wish to package this plugin as a standalone application -bootJar.enabled = false + grailsPublish { userOrg = 'grails' githubSlug = 'grails/grails-cache' diff --git a/gradle.properties b/gradle.properties index bebd2add..2349139f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ guide=../../guide tags=../ref/Tags gebVersion=6.0 seleniumVersion=4.16.1 -webdriverBinariesVersion=2.7 +webdriverBinariesVersion=3.2 hibernateCoreVersion=5.1.5.Final geckodriverVersion=0.32.2 seleniumSafariDriverVersion=4.16.1