I have serenity.properties file with such configurations:
serenity.take.screenshots = BEFORE_AND_AFTER_EACH_STEP
webdriver.driver = "chrome"
Also I have PageObjects, Steps layer and Tests module
My Gradle build file looks like:
group 'com.am'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.serenity-bdd.aggregator'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath("net.serenity-bdd:serenity-gradle-plugin:1.4.0")
}
}
dependencies {
compile 'net.serenity-bdd:serenity-core:1.4.0'
compile 'net.serenity-bdd:serenity-junit:1.4.0'
compile 'junit:junit:4.12'
compile 'org.assertj:assertj-core:1.7.0'
compile 'org.slf4j:slf4j-simple:1.7.7'
compile group: 'net.serenity-bdd', name: 'serenity-rest-assured', version: '1.4.0'
compile group: 'org.jsoup', name: 'jsoup', version: '1.8.3'
compile 'ru.yandex.qatools.htmlelements:htmlelements-all:1.17'
}
gradle.startParameter.continueOnFailure = true
When I run tests with simple command
gradle clean test aggregate
Report is generated but without any screenshots.
My report looks like:
Could anybody please give an advice where am I wrong? I think it's some simple one but I can't understand where... In all manuals it says that serenity makes screenshots by default but I don't have any.
The issue is solved. Driver should be managed by Serenity but I used to create my own instance of a driver.
Resolution: 1. add Managed tag to tests
@Managed
WebDriver driver;
check that serenity.properties contains (e.g)
webdriver.driver = chrome webdriver.chrome.driver = pathtodriver/chromedriver.exe