Sample suite to demonstrate browser automation Using groovy, Geb, Spock and Gradle
Java 8 or higher
Gradle
Artifactory OSS up and running
Login with a valid credential -> redirects to homepage
Login with an invalid credential -> Show error message
Perform some good quick searches -> redirects to search results page with good results
Perform some bad quick searches -> show error message in toast and redirect to search results page with no results
Can be changed in file JfrogConfig under src/test/resources
environments {
test {
url = "http://localhost:8081"
username = "admin"
password = "password"
}
}
Datables can be changed in QuickSearchSpec.groovy under src/test/groovy -> specs
goodSearchTerm| _
"fi" | _
"fil" | _
"file" | _
Chnage the driver versions in build.gradle to match with browser installed
ext {
gebVersion = '3.3'
seleniumVersion = '3.14.0'
chromeDriverVersion = '80.0.3987.16'
geckoDriverVersion = '0.26.0'
}
following commands will launch the tests with the individual browsers:
./gradlew clean chromeTest
./gradlew clean firefoxTest
Reports can ve viewed in the directory -> build/spock-reports/index.html