vividus-framework / vividus

VIVIDUS is all in one test automation tool
https://docs.vividus.dev
Apache License 2.0
377 stars 85 forks source link

Variables from the table don't work in After story composite step #410

Open AngelinaMarchyk opened 4 years ago

AngelinaMarchyk commented 4 years ago

Describe the bug Variables we use in composite step for Lifecycle: After are not resolved and step fails

To Reproduce Some part of the story:

Lifecycle:
After:
Scope: STORY
When I delete taxId created for ABO registration
Examples:
/regression/tables/${locale}/Regression.table

So we have variables in /regression/tables/${locale}/Regression.table

Composite itself:

Composite: When I delete taxId created for ABO registration
When the condition `#{eval("${locale}" =~ ["BE", "ES", "ID", "IN", "KR", "NL", "PT", "TH"])}` is true I do
|step                                                                                                                                                                                          |
|When I set request headers for affiliate with affiliate code '<AffCd>'                                                                                                                        |
|When I send HTTP DELETE to the relative URL '/accounts/<AffCd>-#{removeWrappingDoubleQuotes(${aboNum})}/parties/#{removeWrappingDoubleQuotes(${partyId})}/taxes/<taxTypeCd>?cntryCd=<cntryCd>'|
|Then the response code is equal to '200'                                                                                                                                                      |
|When I set request headers for affiliate with affiliate code '<AffCd>'                                                                                                                        |
|When I send HTTP GET to the relative URL '/accounts/<AffCd>-#{removeWrappingDoubleQuotes(${aboNum})}/parties/#{removeWrappingDoubleQuotes(${partyId})}/taxes/<taxTypeCd>'                     |
|Then the response code is equal to '400'                                                                                                                                                      |
|Then a JSON element by the JSON path '$..message' is equal to 'NO DATA FOUND'                                                                                                                 |

And variables like <AffCd> or <taxTypeCd> are placed in Regression.table Expected behavior The composite with variables works in "Lifecycle: After" part

Execution environment (please complete the following information):

Archive with test story, table file, composite and Allure report to reproduce this issue

ikalinin1 commented 3 years ago

The current behavior. After: Scenario executed for each example row image image

After: Story bdd.configuration.parallel-story-examples-enabled=true Steps are executed for each examples row image

bdd.configuration.parallel-story-examples-enabled=false Steps are executed after all of the rows of the example image

Also After Stories reported as passed in the report.

We agreed to align the behavior of After: Story steps to work the same way for both cases and targeted it to milestone 0.4.0

valfirst commented 1 year ago

Related to https://jbehave.atlassian.net/browse/JBEHAVE-1591