Skip to content

Commit

Permalink
Add Selenium 4 support; duplicate selenium3 files (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbabcoc authored Mar 7, 2024
1 parent 1893144 commit a6b4186
Show file tree
Hide file tree
Showing 80 changed files with 2,855 additions and 542 deletions.
24 changes: 12 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ group = 'com.nordstrom.ui-tools'
description = 'Selenium Foundation'

if (!project.hasProperty('profile')) {
ext.profile = 'selenium3'
ext.profile = 'selenium4'
} else {
assert ['selenium3'].contains(profile)
assert ['selenium3', 'selenium4'].contains(profile)
}

apply from: "${profile}Deps.gradle"
Expand Down Expand Up @@ -67,13 +67,13 @@ jacoco {
reportsDirectory = file("${buildDir}/customJacocoReportDir")
}

jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}
//jacocoTestReport {
// reports {
// xml.enabled false
// csv.enabled false
// html.destination file("${buildDir}/jacocoHtml")
// }
//}

jar {
group 'Build'
Expand Down Expand Up @@ -106,7 +106,7 @@ sourcesJar {
group 'Build'
description "Assembles a jar archive containing the '${profile}' source files."

classifier = 'sources'
archiveClassifier = 'sources'
from sourceSets.main.allSource
archiveFileName = archiveBase + '-sources.jar'
destinationDirectory = libsDir
Expand All @@ -117,7 +117,7 @@ javadocJar {
group 'Build'
description "Assembles a jar archive containing the '${profile}' JavaDoc files."

classifier = 'javadoc'
archiveClassifier = 'javadoc'
from javadoc.destinationDir
archiveFileName = archiveBase + '-javadoc.jar'
destinationDirectory = libsDir
Expand Down Expand Up @@ -255,7 +255,7 @@ dependencies {
}

test {
jvmArgs "-javaagent:${classpath.find { it.name.contains('junit-foundation') }.absolutePath}"
jvmArgs "-javaagent:${classpath.find { it.name.contains('junit-foundation') }.absolutePath}"
}

def getBrowserCaps() {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
profile=selenium3
profile=selenium4
version=27.0.4-SNAPSHOT
browsers=htmlunit
browsers=chrome
10 changes: 8 additions & 2 deletions htmlunitDeps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ System.setProperty('selenium.grid.plugins', driverPlugins + 'com.nordstrom.autom
System.setProperty('selenium.browser.name', 'htmlunit')
System.setProperty('selenium.context.platform', 'web-app')
dependencies {
testImplementation('org.seleniumhq.selenium:htmlunit-driver') {
exclude module: 'selenium-support'
if ("${profile}" == "selenium4") {
testImplementation('org.seleniumhq.selenium:htmlunit3-driver') {
exclude module: 'selenium-support'
}
} else {
testImplementation('org.seleniumhq.selenium:htmlunit-driver') {
exclude module: 'selenium-support'
}
}
}
Binary file not shown.

This file was deleted.

36 changes: 16 additions & 20 deletions selenium3Deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ sourceSets {
main {
java {
srcDirs = [ 'src/main/java', 'src/selenium3/java' ]
outputDir = new File(buildRoot, 'classes')
destinationDirectory = new File(buildRoot, 'classes')
}
output.resourcesDir = "${buildRoot}/classes"
}
test {
java {
outputDir = new File(buildRoot, 'test-classes')
destinationDirectory = new File(buildRoot, 'test-classes')
}
}
}
Expand All @@ -27,6 +27,14 @@ dependencies {
api 'com.nordstrom.tools:testng-foundation:4.0.4-j8'
api 'org.seleniumhq.selenium:selenium-server:3.141.59'
api 'org.seleniumhq.selenium:selenium-support:3.141.59'
api 'org.seleniumhq.selenium:selenium-chrome-driver:3.141.59'
api 'org.seleniumhq.selenium:selenium-edge-driver:3.141.59'
api 'org.seleniumhq.selenium:selenium-firefox-driver:3.141.59'
api 'org.seleniumhq.selenium:selenium-opera-driver:3.141.59'
api 'org.seleniumhq.selenium:selenium-safari-driver:3.141.59'
api 'org.seleniumhq.selenium:htmlunit-driver:2.70.0'
api 'com.codeborne:phantomjsdriver:1.4.4'
api 'io.github.bonigarcia:webdrivermanager:5.3.3' // final Java 8 release
api 'org.apache.httpcomponents:httpclient:4.5.14'
api 'org.jsoup:jsoup:1.15.3'
api 'org.apache.commons:commons-lang3:3.12.0'
Expand All @@ -37,28 +45,17 @@ dependencies {
api 'org.eclipse.jetty.websocket:websocket-client:9.4.50.v20221201'
api 'org.jetbrains.kotlin:kotlin-stdlib:1.8.10'
api 'org.jetbrains.kotlin:kotlin-stdlib-common:1.8.10'
testImplementation 'org.seleniumhq.selenium:selenium-chrome-driver:3.141.59'
testImplementation 'org.seleniumhq.selenium:selenium-edge-driver:3.141.59'
testImplementation 'io.appium:java-client:7.6.0'
testImplementation 'org.seleniumhq.selenium:selenium-firefox-driver:3.141.59'
testImplementation 'org.seleniumhq.selenium:selenium-opera-driver:3.141.59'
testImplementation 'com.codeborne:phantomjsdriver:1.4.4'
testImplementation 'org.seleniumhq.selenium:selenium-safari-driver:3.141.59'
testImplementation 'org.seleniumhq.selenium:htmlunit-driver:2.70.0'
testImplementation 'org.mockito:mockito-core:4.6.1'
}
api 'com.nordstrom.tools:testng-foundation'
api('org.seleniumhq.selenium:selenium-server') {
exclude module: 'selenium-chrome-driver'
exclude module: 'selenium-edge-driver'
exclude module: 'selenium-firefox-driver'
exclude module: 'selenium-ie-driver'
exclude module: 'selenium-opera-driver'
exclude module: 'selenium-java'
exclude module: 'selenium-safari-driver'
exclude module: 'htmlunit-driver'
}
api 'org.seleniumhq.selenium:selenium-server'
api 'org.seleniumhq.selenium:selenium-support'
api 'org.seleniumhq.selenium:htmlunit-driver'
api 'com.codeborne:phantomjsdriver'
api('io.github.bonigarcia:webdrivermanager') {
exclude group: 'org.slf4j', module: 'slf4j-api'
}
api 'org.apache.httpcomponents:httpclient'
api 'org.jsoup:jsoup'
api 'org.apache.commons:commons-lang3'
Expand All @@ -67,6 +64,5 @@ dependencies {
api 'com.squareup.okhttp3:okhttp'
api 'com.squareup.okio:okio'
api 'org.eclipse.jetty.websocket:websocket-client'
testImplementation 'org.seleniumhq.selenium:htmlunit-driver'
testImplementation 'org.mockito:mockito-core'
}
63 changes: 63 additions & 0 deletions selenium4Deps.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
ext.buildRoot = file('build-s4')
ext.libsDir = new File(buildRoot, 'libs')

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

sourceSets {
main {
java {
srcDirs = [ 'src/main/java', 'src/selenium4/java' ]
destinationDirectory = new File(buildRoot, 'classes')
}
output.resourcesDir = "${buildRoot}/classes"
}
test {
java {
destinationDirectory = new File(buildRoot, 'test-classes')
}
}
}

dependencies {
constraints {
api 'com.nordstrom.tools:testng-foundation:4.0.4-j8'
api 'org.seleniumhq.selenium:selenium-grid:4.17.0'
api 'org.seleniumhq.selenium:selenium-support:4.17.0'
api 'org.seleniumhq.selenium:selenium-chrome-driver:4.17.0'
api 'org.seleniumhq.selenium:selenium-edge-driver:4.17.0'
api 'org.seleniumhq.selenium:selenium-firefox-driver:4.17.0'
api 'org.seleniumhq.selenium:selenium-opera-driver:4.4.0'
api 'org.seleniumhq.selenium:selenium-safari-driver:4.17.0'
api 'org.seleniumhq.selenium:htmlunit3-driver:4.17.0'
api 'com.codeborne:phantomjsdriver:1.5.0'
api 'org.apache.httpcomponents:httpclient:4.5.14'
api 'org.eclipse.jetty:jetty-servlet:9.4.50.v20221201'
api 'org.jsoup:jsoup:1.15.3'
api 'org.apache.commons:commons-lang3:3.12.0'
api ('com.google.guava:guava') {
version { strictly '31.1-jre' }
}
api 'com.beust:jcommander:1.82'
api 'io.netty:netty-transport-native-epoll:4.1.93.Final'
api 'io.netty:netty-transport-native-kqueue:4.1.93.Final'
testImplementation 'io.appium:java-client:7.6.0'
testImplementation 'org.mockito:mockito-core:4.6.1'
}
api 'com.nordstrom.tools:testng-foundation'
api 'org.seleniumhq.selenium:selenium-grid'
api 'org.seleniumhq.selenium:selenium-support'
api 'org.seleniumhq.selenium:selenium-chrome-driver' // temporary
api 'org.seleniumhq.selenium:htmlunit3-driver' // temporary
api 'com.codeborne:phantomjsdriver' // temporary
api 'org.apache.httpcomponents:httpclient'
api 'org.eclipse.jetty:jetty-servlet'
api 'org.jsoup:jsoup'
api 'org.apache.commons:commons-lang3'
api 'com.google.guava:guava'
api 'com.beust:jcommander'
testImplementation 'org.mockito:mockito-core'
}
Loading

0 comments on commit a6b4186

Please sign in to comment.