Skip to content

Instantly share code, notes, and snippets.

@hanikhan
Created December 13, 2017 07:46
Show Gist options
  • Save hanikhan/a63b7df334ceaf7fd58a6e9c0c885391 to your computer and use it in GitHub Desktop.
Save hanikhan/a63b7df334ceaf7fd58a6e9c0c885391 to your computer and use it in GitHub Desktop.
BrowserStack Selenide sample using Gradle
/*
* Clone https://github.com/browserstack/selenide-browserstack
* Configure gradle globally OR locally in the project directory
* Use 'gradle init'
* Modify the build.gradle file inline with the below example
*/
apply plugin: 'java'
apply plugin: 'maven'
group = 'com.browserstack'
version = '1.0-SNAPSHOT'
description = """selenide-java-browserstack"""
sourceCompatibility = 1.5
targetCompatibility = 1.5
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'org.testng', name: 'testng', version:'6.10'
compile group: 'commons-io', name: 'commons-io', version:'2.5'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version:'2.53.0'
compile group: 'com.browserstack', name: 'browserstack-local-java', version:'1.0.0'
compile group: 'com.googlecode.json-simple', name: 'json-simple', version:'1.1.1'
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.5.6'
compile group: 'org.slf4j', name: 'slf4j-simple', version:'1.5.6'
testCompile group: 'com.codeborne', name: 'selenide', version:'4.2'
}
task runParallelTests(type: JavaExec, dependsOn: 'classes') {
main = 'org.testng.TestNG'
classpath = files("./config",
project.sourceSets.main.compileClasspath,
project.sourceSets.test.compileClasspath,
project.sourceSets.main.runtimeClasspath,
project.sourceSets.test.runtimeClasspath)
args = ["-parallel", "methods", "-threadcount", "3", "-d", "./build/test-output", "./config/parallel.testng.xml"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment