serenity-bdd/serenity-core

ERR_FILE_NOT_FOUND after running Gradle aggregate

Closed this issue · 15 comments

What happened?

After updating serenity from 4.0.27 to 4.1.3 test report is not aggregated properly (had to update because @TestTemplate displayName isn't working properly on 4.0.27)
When accessing scenario results I'm getting ERR_FILE_NOT_FOUND. Looks like aggregation fails to convert json to html because I can find the json with expected name.

What did you expect to happen?

No response

Serenity BDD version

4.1.3

JDK version

17

Execution environment

No response

How to reproduce the bug.

id 'net.serenity-bdd.serenity-gradle-plugin' version '4.1.3'
Zrzut ekranu 2024-03-10 o 11 26 38

How can we make it happen?

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

Make sure you do a clean build

Tried multiple times.
image
image

It might be something to do with the name of the tests or scenarios - try setting serenity.compress.filenames to false and see if there are any patterns.

Not sure what to look for
before aggregate:
image
after:
image
Looks like there is no other way than to debug reports

image

You should see the html files with the end of the test names:

image

Then compare this with the link that doesn't work to see for which test or page the report isn't getting generated.

Also check the console logs for exceptions.

it's every test. initially I thought it's @TemplateTest but same behaviour for normal @Test. The expected html is missing and it's Scenario page with steps

OK, I can reproduce it. Seems to be a general problem with the Gradle plugin. Try rolling back the recent pull requests and see when the last version that worked was.

rolling back gradle plugin to 4.0.46 solved the issues. Libs remained with 4.1.3

If you can identify the change in the plugin code that causes the issue we might be able to fix it. Having different plugin and library versions is not recommended.

See if 4.1.4-RC1 fixes the issue for you.

works :)

Cool, I will include this in version 4.1.4

Screenshot 2024-03-19 091833
I got this when I open the report. Can anyone help me to solve it.
JDK : 21
Maven : 3.9.6
Serenity BDD : 4.1.0
Many thanks!

Screenshot 2024-03-19 091833 I got this when I open the report. Can anyone help me to solve it. JDK : 21 Maven : 3.9.6 Serenity BDD : 4.1.0 Many thanks!

This is unrelated to the original issue. Try doing a full clean build.

Dear Team,
After the execution an index.html file is generated but while accessing "scenario results" I'm getting ERR_FILE_NOT_FOUND.
Hereby I am attaching my build.gradle file:-

defaultTasks 'clean','test','aggregate'
apply plugin: 'java'
apply plugin: 'net.serenity-bdd.aggregator'

group 'org.automationserenity'
version '1.0-SNAPSHOT'

repositories {
mavenCentral()
}
tasks.withType(ProcessResources).configureEach {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

sourceSets {
test {
resources {
srcDir 'src/test/resources'
}
}
}

buildscript {
project.ext {
serenityVersion = '2.3.12'
}
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath('net.serenity-bdd:serenity-gradle-plugin:' + serenityVersion)
//classpath "net.serenity-bdd:serenity-gradle-plugin:$serenityVersion"
}
}

sourceCompatibility = 17
targetCompatibility = 17

ext {
slf4jVersion = '2.0.13'
serenityCoreVersion = '4.1.20'
junitVersion = '4.13.2'
assertJVersion = '3.26.3'
logbackVersion = '1.5.6'
jacksonVersion = '2.17.2'
}

dependencies {
testImplementation "net.serenity-bdd:serenity-core:${serenityCoreVersion}",
"net.serenity-bdd:serenity-junit:${serenityCoreVersion}",
"net.serenity-bdd:serenity-screenplay:${serenityCoreVersion}",
"junit:junit:${junitVersion}",
"org.assertj:assertj-core:${assertJVersion}",
"ch.qos.logback:logback-classic:${logbackVersion}",
"org.slf4j:slf4j-api:${slf4jVersion}",
"com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
}

test {
testLogging.showStandardStreams = true
systemProperties System.getProperties()
}
gradle.startParameter.continueOnFailure = true
test.finalizedBy(aggregate)

Please need your help to resolve this issue. I have tried everything possible to get through this issue. Please let me know if any more files is needed.