-
Notifications
You must be signed in to change notification settings - Fork 0
How to test the project
Before testing, make sure all the prerequisites are met.
Run
gradle test
gradle test
will run all the tests that are located in a src/test folder. To exclude any file you don't want to run via this command, add exclude rule:
test {
exclude "**/ee/ttu/geocollection/uiTests/*.class"
}
Run the application locally
gradle bootRun
Then run
gradle testUI
Launching UI tests will require a headless browser called phantomJS. Both versions for Linux and Windows are currently included in the project, therefore no additional installation needed. UI tests also require Selenium, Selenide and GhostDriver. These dependencies are being loaded via gradle. Make sure build.gradle contains following dependencies:
testCompile group: 'org.seleniumhq.selenium', name: 'selenium-java', version:'3.4.0'
testCompile 'com.github.detro:ghostdriver:2.0.0'
testCompile 'com.codeborne:selenide:4.4.1'
gradle testUI
task can also be configured in build.gradle
task testUI(type: Test) {
scanForTestClasses = false
include "**/ee/ttu/geocollection/uiTests/*.class"
def phantomJsFilename = Os.isFamily(Os.FAMILY_WINDOWS) ? "phantomjs/phantomjs-2.1.1-windows/bin/phantomjs.exe" : "phantomjs/phantomjs-2.1.1-linux-x86_64/bin/phantomjs"
systemProperty "phantomjs.binary.path", phantomJsFilename
}
gradle testUI
command runs all the tests form uiTests folder. Path to phantomJS binary is chosen depending on the operating system.