Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serenity BDD report doesn't generate visual parts in Window 10 after 3.7.0 version #3288

Open
IvanZinio opened this issue Oct 17, 2023 · 2 comments

Comments

@IvanZinio
Copy link

IvanZinio commented Oct 17, 2023

What happened?

I have a project for testing API that use Java, Gradle and Serenity to tests API, that works perfectly in different OS.

When I try to upgrade the Serenity libraries from 3.7.0 to 3.9.0 or any upper (ex: 3.9.0 or 4.0.15 or whichever in between), the tests are properly executed in any OS, but curiusly just in Windows 10 it doesn't generate the visual parts of the report. No css, nor ico, nor png, nor bootstrap foulder, etc. This results in a basic html report.

In Unix or Mac the report is generated properly whichever version, we have tried and it works. Just not in Windows OS.

Relevant configuration:

- build.gradle:

buildscript {
repositories {
jcenter()
mavenLocal()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "net.serenity-bdd:serenity-gradle-plugin:3.9.0"
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.22.0"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.4.1.3373"
}
}

plugins {
id "com.diffplug.spotless" version "6.22.0"
}

repositories {
jcenter()
mavenLocal()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}

apply plugin: 'java'
apply plugin: "net.serenity-bdd.serenity-gradle-plugin"
apply plugin: 'org.sonarqube'

group 'Testing project'

dependencies {
implementation 'javax.mail:mail:1.4.7'

implementation 'org.json:json:20231013'
implementation 'com.jayway.jsonpath:json-path:2.8.0'
implementation 'com.networknt:json-schema-validator:1.0.87'

implementation 'org.slf4j:slf4j-api:2.0.9'
implementation 'org.slf4j:slf4j-simple:2.0.9'

implementation 'net.lingala.zip4j:zip4j:2.11.5'

implementation 'net.serenity-bdd:serenity-core:3.9.0'
implementation 'net.serenity-bdd:serenity-junit:3.9.0'
testImplementation 'net.serenity-bdd:serenity-cucumber:3.9.0'
implementation 'net.serenity-bdd:serenity-rest-assured:3.9.0'
testImplementation 'io.cucumber:cucumber-junit:7.14.0'

}

wrapper {
gradleVersion = '8.4'
}

gradle.startParameter.continueOnFailure = true

test {
systemProperties System.getProperties()
testLogging.showStandardStreams = true
test.reports.html.required.set(false)
test.reports.junitXml.required.set(false)
include "testRunner/TestRunner.class"
}

javadoc {
source = sourceSets.test.allJava
classpath = sourceSets.test.compileClasspath
destinationDir = file("documentation/javadoc")
}

gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked"
}
}

- gradle-wrapper.properties:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

- serenity.properties:

max.retries=3
junit.retry.tests=true

- TestRunner.java:

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
features = "src/test/java/service/services",
plugin = {
"pretty",
"html:target/cucumber_html.html",
"json:target/cucumber_json.json",
"junit:target/junit.xml"
},
glue = "service")

What did you expect to happen?

I would like to be able to update the Serenity libraries and generate and see the Serenity BDD report with all the visual parts.

Serenity BDD version

3.9.0 or 4.0.15 or whichever in between

JDK version

java 14.0.2 2020-07-14

Execution environment

Windows 10 - 22H2, 64 bits
Browser not relevant (confirmed).

How to reproduce the bug.

We use this command to execute tests: clean test aggregate -Dcucumber.filter.tags='@run' -DEnv="stg" --info

How can we make it happen?

Work on this myself and propose a PR (with Serenity BDD team guidance)

@jecardenasri01
Copy link

try whit this ,is very import versión java and gradle :
image
defaultTasks 'clean', 'test', 'aggregate'

repositories {
mavenCentral()
mavenLocal()
}
repositories {
maven {
url "https://plugins.gradle.org/m2/"

}}

buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"

    }
}

dependencies {

    classpath "net.serenity-bdd:serenity-gradle-plugin:4.0.12"
}

}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "net.serenity-bdd.serenity-gradle-plugin"

compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"

sourceCompatibility = 11
targetCompatibility = 11

ext {
// https://mvnrepository.com/artifact/net.serenity-bdd/serenity-cucumber
serenity_version = '4.0.12'

junit_platform_launcher_version="1.10.0"
junit_platform_suite_version="1.10.0"

// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
junit_jupiter_engine_version="5.10.0"
junit_vintage_engine_version="5.10.0"
cucumber_junit_platform_engine_version="7.2.3"
logback_classic_version="1.2.10"
assertj_core_version="3.23.1"

}

dependencies {
dependencies {
testImplementation "net.serenity-bdd:serenity-core:${serenity_version}"
testImplementation "net.serenity-bdd:serenity-cucumber:${serenity_version}"
testImplementation "net.serenity-bdd:serenity-screenplay:${serenity_version}"
testImplementation "net.serenity-bdd:serenity-screenplay-webdriver:${serenity_version}"
testImplementation "net.serenity-bdd:serenity-ensure:${serenity_version}"
testImplementation "org.junit.platform:junit-platform-launcher:${junit_platform_launcher_version}"
testImplementation "io.cucumber:cucumber-junit-platform-engine:${cucumber_junit_platform_engine_version}"
testImplementation "org.junit.platform:junit-platform-suite:${junit_platform_suite_version}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_engine_version}"
testImplementation "org.junit.vintage:junit-vintage-engine:${junit_vintage_engine_version}"
implementation "ch.qos.logback:logback-classic:${logback_classic_version}"
testImplementation "org.assertj:assertj-core:${assertj_core_version}"
}
}

test {
useJUnitPlatform()
testLogging.showStandardStreams = true
systemProperties System.getProperties()
systemProperty "https.protocols", "TLSv1.2,TLSv1.3"
}

gradle.startParameter.continueOnFailure = true

test.finalizedBy(aggregate)

@IvanZinio
Copy link
Author

The Java version could have been an issue but actually there is not a difference.
The build.gradle you have put is for other kind of project with others goals. It doesn't work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants