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

Requirements are not automatically mapped in reports using version 2.0.56 onwards with cucumber 4. #1817

Closed
kreigy1310garg opened this issue Sep 18, 2019 · 16 comments

Comments

@kreigy1310garg
Copy link

Hi Team,
I am using serenity bdd with cucumber 4 for testing microservices.

My directory structure is src/test/resources/features then one.feature,second.feature.

When I use serenity 2.0.48 and serenity-cucumber4 1.0.12 then my requirements are automatically mapped with features but no support of @manual-last-tested , then I migrated to 2.0.67 with serenity-cucumber4 1.0.21 because this is supported after 2.0.56.

Now my requirements overview is coming as blank.

I also tried with 2.0.56 with 1.0.12 but still it is blank.

I tried to use serenity properties for requirements.dir,requirements.basedir but still my requirement overview is blank.

My build.gradle

/*

// Apply the java-library plugin to add support for Java Library

group 'sdc-service-test'
version '1.0-SNAPSHOT'

repositories {
mavenCentral()
}

buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath("net.serenity-bdd:serenity-gradle-plugin:${SerenityCoreVersion}")
}
}

apply plugin: 'java'
apply plugin: 'net.serenity-bdd.aggregator'

configurations.all {
resolutionStrategy {
force "io.cucumber:cucumber-core:${cucumberVersion}"
}

}

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
compile "net.serenity-bdd:serenity-rest-assured:${SerenityCoreVersion}"
compile "net.serenity-bdd:serenity-cucumber4:${SerenityCucumberVersion}"
compile "org.assertj:assertj-core:${assertJVersion}"
compile "ch.qos.logback:logback-classic:${logVersion}"
compile "net.serenity-bdd:serenity-core:${SerenityCoreVersion}"
compile "com.googlecode.json-simple:json-simple:${gsonVersion}"
compile "org.skyscreamer:jsonassert:${jsonAssertVersion}"
compile "mysql:mysql-connector-java:${mysqlVerison}"
compile "io.cucumber:cucumber-junit:${cucumberVersion}"
compile "io.cucumber:cucumber-core:${cucumberVersion}"
compile "org.json:json:${jsonVersion}"

}

test {
testLogging.showStandardStreams = true
}
gradle.startParameter.continueOnFailure = false

test.finalizedBy(aggregate)

gradle.properties

SerenityCoreVersion = 2.0.67
SerenityScreenPlayCoreVersion = 2.0.67
SerenityCucumberVersion = 1.0.21
junitVersion=4.12
assertJVersion=3.12.2
slf4jVersion=1.7.7
gsonVersion=1.1
jsonAssertVersion = 1.5.0
mysqlVerison = 8.0.11
logVersion = 0.9.26
cucumberVersion=4.2.0
jsonVersion = 20180813

2 0 67_requirements
2 0 48_requirements

I attached screenshots for both version reports. I didn't do any change in structure only upgraded the version.

@wakaleo
Copy link
Member

wakaleo commented Sep 23, 2019

I can't reproduce this; can you provide a sample project?

@zzoubian
Copy link
Contributor

zzoubian commented Oct 3, 2019

I can't reproduce this; can you provide a sample project?

This issue was reproducible using the serenity-cucumber4-starter project:
https://github.com/serenity-bdd/serenity-cucumber4-starter

The issue occurs in versions after 2.0.48. I was using Java 1.8, and tried different versions of Gradle: 3.4, 4.2, 5.6.

2.0.48:
2019-10-03 09_48_19-Requirements_2 0 48

2.0.49:
2019-10-03 09_48_19-Requirements_2 0 49

2.0.56:
2019-10-03 09_48_19-Requirements_2 0 56

2.0.70:
2019-10-03 09_48_19-Requirements_2 0 70

@wakaleo
Copy link
Member

wakaleo commented Oct 3, 2019

Still can't reproduce this with Gradle or Maven. and haven't come across it on Windows, Linux or MacOS.

@zzoubian
Copy link
Contributor

zzoubian commented Oct 3, 2019

Still can't reproduce this with Gradle or Maven. and haven't come across it on Windows, Linux or MacOS.

It stops working in 2.0.49+. It works with 2.0.48. Are you able to reproduce using 2.0.49?

@wakaleo
Copy link
Member

wakaleo commented Oct 3, 2019

No, I can't reproduce this issue for 2.0.49 either. If you can see what version change causes the change in behaviour, I would recommend looking at the code changes and experimenting to see if you can isolate the cause.

@kreigy1310garg
Copy link
Author

Thanks wakaleo for your efforts. I tried everything to find the root cause but still facing the same issue. I don't know why you are not able to reproduce the same. I am able to reproduce it with the starter project as well. But I don't know it is happening.

@kreigy1310garg
Copy link
Author

@wakaleo could you please try using serenity rest assured instead of serenity core ?

@wakaleo
Copy link
Member

wakaleo commented Oct 9, 2019

I have lots of projects using serenity-rest-assured; I don't see this behaviour with them either.

@kreigy1310garg
Copy link
Author

@wakaleo could you please share any standard grade having serenity rest assured with cucumber4 so that I would be able to find out the root cause.

@kreigy1310garg
Copy link
Author

@wakaleo Invited you in my project SDC as collaborator. Please look into the project and check why requirements are not mapped as structure and everything is fine.

Please don't share the repo further ... Thanks for your efforts.

@zzoubian
Copy link
Contributor

I did a little bit more digging around, and it appears it only affects Windows machines. On our Mac it worked fine.

It appears the default requirements directory is set to "src/test.features" in FileSystemRequirementsTagProvider, Inside the method
FileSystemRequirementsTagProvider.capabilitiesAndStoriesIn(), the call rootDirectory.exists() returns null on Windows.

When we override this value with the system property, "serenity.requirements.dir" to src/test/resources/features in serenity.properties. The requirements get created, and the report generates properly.

@wakaleo
Copy link
Member

wakaleo commented Oct 30, 2019

Well spotted. If you can figure out how to get the root directory logic working on Windows and create a PR, I will include it in the next release

@kreigy1310garg
Copy link
Author

@zzoubian could you please let me know with which version you are able to override the properties as I am unable to override the same using serenity.requirements.dir=src/test/resources/features in serenity properties with serenity 2.0.67 and higher version on windows. Could you please tell me with which version you are able to override the path.

@eventsequor
Copy link

eventsequor commented Mar 19, 2021

Greetings
You can see that when running only a test scenario, for example with the command
mvn clean verify -Dtags = "@ annotation",
no information is generated in the requirements overview. It is only generated when the whole package where the runners are defined is run.

To run the whole project you can use the command
mvn clean verify
in maven

@wakaleo wakaleo closed this as completed Feb 12, 2022
@gurgl
Copy link

gurgl commented Mar 31, 2022

This needs to be fixed

@wakaleo
Copy link
Member

wakaleo commented Apr 4, 2022

This needs to be fixed

What needs to be fixed? If you want to filter by tags, you can use the standard Cucumber options, e.g.

mvn clean verify -Dcucumber.filter.tags="@mytag"

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

No branches or pull requests

5 participants