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

Cucumber: Report broken when using Example setps #1685

Closed
asvdw opened this issue May 22, 2019 · 5 comments
Closed

Cucumber: Report broken when using Example setps #1685

asvdw opened this issue May 22, 2019 · 5 comments
Labels

Comments

@asvdw
Copy link

asvdw commented May 22, 2019

Hello,
Using serenity version 2.0.40 and cucumber 1.9.37, there are unprocessed placeholders in examples table when executing set of example.

ie with this feature file:


Feature: Lookup a definition with sets
  In order to talk better
  As an English student
  I want to look up word definitions

  Scenario Outline: Looking up the definition of 'apple' with sets
    Given the user is on the Wikionary home page
    When the user looks up the definition of the word '<word>'
    Then they should see the definition '<definition>'

  @Daily
    Examples: representative set
      | word  | definition                                                                                    |
      | apple | A common, round fruit produced by the tree Malus domestica, cultivated in temperate climates. |


    Examples: other set
      | word | definition                                                                                     |
      | pear | An edible fruit produced by the pear tree, similar to an apple but elongated towards the stem. |

and `mvn verify -Dtags=Daily', tests are rightly executed (look for apple but not for pear) but in the report you'll see something like this, in Specifications tab

word definition  
apple A common, round fruit produced by the tree Malus domestica, cultivated in temperate climates. {example-result:Lookup a definition with sets!Looking up the definition of 'apple' with sets[0][0]}

Furthermore, if I run mvn serenity:aggregate after mvn clean verify, placeholders for all examples are now replaced by "success" icon, even if they has not bu run - in this case, pear and apple will be marked as successful.

Any idea ?
Thank you

@wakaleo
Copy link
Member

wakaleo commented Jun 1, 2019

This will be tricky to fix. If you would like to have a go, the code in question is in the textWithEmbeddedExampleResults() method in the Formatter class.

@asvdw
Copy link
Author

asvdw commented Jun 4, 2019

Hello,
Indeed.. it's tricky ;)

Firstly I have to clarify the issue:
mvn serenity:aggregate will replace placeholders, but with inaccurate results
mvn serenity:aggregate -Dtags=Daily will leave placeholders

The problem is about tags.

then I saw that:
in HtmlAggregateStoryReporter.generateReportsForTestResultsFrom(File sourceDirectory),
allTestOutcomes.withTags(this.getTags()) remove all dataTable rows, except the first one

So commenting this as a quick and dirty fix does the trick for my issue, but there may be some side effects:

  //      if (!StringUtils.isEmpty(this.tags)) {
  //          allTestOutcomes = allTestOutcomes.withTags(this.getTags());
  //      }

I do not have the time to look further right now, but that seems to be the right track...

@wakaleo wakaleo added the bug label Aug 14, 2019
@jcunliffe1
Copy link

jcunliffe1 commented Jan 20, 2022

Using multiple tags with subcategories, which then are split via tagtype definition, is also broken on example data tags. I'm running on cucumber 7 and serenity 3.1.1

@wakaleo
Copy link
Member

wakaleo commented Jan 20, 2022

@jcunliffe1 can you provide an example project?

@wakaleo wakaleo closed this as completed Jan 20, 2022
@wakaleo wakaleo reopened this Jan 20, 2022
@wakaleo
Copy link
Member

wakaleo commented Feb 12, 2022

Fixed in 3.2.0

@wakaleo wakaleo closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants