Open DjerohN opened 6 years ago
Hi @DjerohN . I was not able to reproduce your issue. I have tried with your versions and with the latest ones, I have used the project generated from standard serenity archetype for cucumber where I have changed the feature name in LookupADefinition.feature to Feature: Lookup a good definition. Can you please provide a test project to reproduce your issue ? Thanks !
Hi @cliviu I am also facing this problem with following version set:
I would recommend using snake case for feature files.
@wakaleo can you provide few examples for how to name feature file and feature. so, that we will follow that to get full use of serenity reports.
See http://github.com/serenity-bdd/bdd-trader for some examples. Unusual capitalisation may cause issues.
I could reproduce the issue. If feature file name contains of period(.), features get duplicated in the home page of serenity report.
Example : 1.2_upload_file.feature If the file name is changed to 1-2_upload_file.feature, then the duplication won't happen. Hope this information helps
Even I could reproduce the exact same issue Feature filename: features/getFeeQuote.feature Feature: To validate the merchant api getFeeQuote
In the serenity report, I'm getting as follows:
Serenity version - 2.2.0
Can you provide a sample project?
@wakaleo here you go for the command and see attached: mvn clean verify -Denv="https://merchantapi.taal.com/" merchant_api.zip
@wakaleo I am able to replicate the same issue on windows 10. Even without dots if you provide simple name e.g. DataFormTemplate.feature then the same happens with version 2.2.0 using cucumber5. Following version has been used in the project
serenityCoreVersion=2.2.0 serenityCucumberVersion=2.2.0 cucumberCoreVersion=5.5.0
Attaching the screenshot for the same.
@wakaleo even it is replicable on version 2.2.1 with cucumber 5
@wakaleo I am also facing the same issue with Cucumber5
This appears to happen if your feature files are at the root directory of src/test/resources. The workaround (and recommended practice) is to organise your feature files in subdirectories according to functional groups or capabilities, or in some other way that makes sense for the living documentation.
This appears to happen if your feature files are at the root directory of src/test/resources. The workaround (and recommended practice) is to organise your feature files in subdirectories according to functional groups or capabilities, or in some other way that makes sense for the living documentation.
Esa es la solución, cree dentro del repositorio src/test/resources otro repositorio y moví los archivos .feature src/test/resources/PaginaPrincipal, listo funcionó. Gracias.
Hi @wakaleo I am having an issue as a consequence of moving the .feature files in subdirectories:
After I moved the .feature files I am getting warning for all the Scenario's steps
"Step 'xxxxxx' does not have a matching glue code".
If I run my automation suite it works fine just these Warning Messages, not sure if there is a way to get rid of them. When the .feature files were in: /src/test/resources/features it was not displaying the warning, but I was having the duplicated issue in the report.
I am using: Eclipse IDE for Enterprise Java Developers. Version: 2019-06 (4.12.0) Build id: 20190614-1200
In my TestRunner I tried different things, but still same issue:
@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
//features = "src/test/resources/features/Navigation",
plugin = {"pretty"},
features = {"src/test/resources/features/NativeNavigation/","src/test/resources/features/Navigation/","src/test/resources/features/NativePromotion/","src/test/resources/features/NativeNotification/"},
glue = {"com.qualitestgroup.dierbergs.commonsteps","com.qualitestgroup.dierbergs.steps","com.qualitestgroup.dierbergs.stepsPages"}
//features = {"classpath:NativeNavigation.feature","classpath:NativeNotification.feature","classpath:NativePromotion.feature","classpath:Navigation.feature"}
//features = {"src/test/resources/features/NativeNavigation/","src/test/resources/features/Navigation/","src/test/resources/features/NativePromotion/","src/test/resources/features/NativeNotification/"}
)
public class TestRunner {
}
I am attaching my pom.xml in case is useful.
Any help or advice will be highly appreciated. Thanks!
If the tests run correctly it is probably an Eclipse caching issue. I'm not familiar with Eclipse, but rebuiding or reimporting the project might help.
Sounds good, I will try that. Thanks!
Hi @alfeducor2
The problem is not the folder that was created and where you stored the features:
This is Good
use: features = "src/test/resources/features/" (This searches for all the features independent of the child folders. Clean Code), use tags for execution.
Try redirecting the glue to the definitions classes (try a single package with all those classes): glue = "com.qualitestgroup.dierbergs.definitions"
My structure is: definitions --> steps -->pages
I use eclipse version: Version: 2019-03 (4.11.0), Build id: 20190314-1200 (Don't have any problem whit this.)
Send a picture of the structure of your project what I assume is that the problem is with the glue.
pom.xml:
Thanks @BladimirMolina, sorry for the delay, I was trying but not able to make it work, so I had to go back to previous serenity builds:
Gracias @BladimirMolina , perdón por el retraso, estaba intentando pero no pude hacerlo funcionar, así que tuve que volver a las versiones anteriores de serenidad:
2.1.5 2.1.5 1.9.5 Esta es la estructura de mi proyecto: ![imagen](https://user-images.githubusercontent.com/40179266/81245116-0dbe5f80-8fc9-11ea-88e1-4df5b7ee4fef.png) Con estas compilaciones todo funciona bien. ¡Gracias! (Gracias)
Me alegra que haya podido solucionar el inconveniente, sin embargo es un poco frustrante que no se haya podido solucionar el problema con la última versión.
Si gusta me puede enviar el proyecto (el que no funciona) y lo reviso para mirar que es lo que está ocurriendo.
I'm glad you were able to fix the issue, however it is a bit frustrating that you were unable to resolve the issue with the latest version.
If you like, you can send me the project (the one that doesn't work) and I check it to see what is happening.
Hi @BladimirMolina , sorry for the delay. Here is my project in case you still have some time to take a look. As a summary, project works fine, only problem is that I get warning in the feature files like: Step 'user started the automation' does not have a matching glue code for all the steps
Hi @wakaleo , @alfeducor2 , Im also facing the same issue, using cucumber 5. My folder structure is like below src/test/resources/features/ POM
It's a known issue in the backlog.
@wakaleo thanks for the quick response, any workaround without downgrading?
Yes, place your feature files in subdirectories of the src/test/features directory (e.g organised by capability or high level functionality)
@wakaleo thanks a lot it working now
Hi @wakaleo ,
I have the
features
in this (referring to the screenshot) file structure. Still I get duplicate ATs in my cucumber-reports
on Jenkins with different time durations.
PS:
Cucumber version: 6.2.2
Jenkins: 2.235.1
Cucumber reports plugin version: 5.3.1
Read the comments above.
Hi,
[main] WARN io.cucumber.core.plugin.SerenityReporter - Feature from **/loginAPI.feature is not under the 'features' directory. Requirements report will not be correctly generated! The folder structure is shown below:
The following is what I'm seeing in the report:
Please help me resolve this issue. Thanks in advance!
The workaround is in the comments above.
@cliviu seems that your changes in context of this issue has broken correct report generation in our case. I'm referring to commit 0db4b3e and changes in elementsOf
method of LastElement
class.
Let me provide the interim results of my research.
Let's say we have following structure of tests (with serenity.requirement.types
set as "service,feature,suite"):
Once test is finished, Serenity generates tags for it (via call in BaseStepListener
), collecting requirements from providers. One of those providers is PackageRequirementsTagProvider
with its method getTagsFor
. In this method we try to find matchingRequirement for the result of testOutcome.getUserStory().asTag()
. Here we face the difference: before your changes, the result of this asTag method in our case was package2/suite1, but now it is package1.package2/suite1 (normalized in both cases). Then we try to find actually find matchingRequirement by walking through all of the requirements, but no matches found -- requirements provided by FileSystemRequirementStore
doesn't contain package1 in their names. So, no matchingRequirement found and no tags returned from the method. As result, generated report doesn't contain expected information on the tabs (according to requirement types).
I'm not quite sure what would be the best way to address issue above (except just reverting change to LastElement class and get it back later without breaking functionality). @wakaleo @cliviu could you guys take a look and share your thoughts?
hey @a-en . Can you please help me with a small project to reproduce this issue ? Thanks !
hi @cliviu , sure thing - please take a look on this repo. You could get report generated with mvn clean test
. Once report is generated, please take a look on 'Features' list on the index page and then check separate tabs (Services, Features, Suites). If you want to compare that report with the one, which we were getting previously, you could roll back to any Serenity version that doesn't contain changes in LastElement class (for example, we used 2.1.6)
One more thing to be mentioned - the issue, I've described above could be resolved with changes to isAsOrMoreSpecificThan
method by adding extra condition
if (testTag.normalisedName().replaceFirst(".*?([^\\.]+)$", "$1").equals(this.normalisedName()) && (this.getType().equals(testTag.getType()))) {
return true;
}
I've tried locally and it worked fine, however, I'm not quite sure about potential impact and if this is the best way to address it.
If the feature title (line after Feature: in .feature file) differs from the filename then it will appear twice in the report home page. One being named by the title and the second being derived from the filename. If some tests are failed then in the second link will be a 100% failure. Property use.test.case.for.story.tag=false does not work for me.
Using these versions: