e***@decathlon.com
2016-01-28 10:19:22 UTC
Hello,
First of all, thanks for this wonderful framework.
Step execution results can have two main states: PASSED or FAILED (if we
ignore PENDING, SKIPPED, UNDEFINED, etc.).
I'd like steps to have another middle state: WARN.
This state would threat the step as FAILED but will not skip the execution
of the following steps.
Here is why:
I have such a scenario:
When I go to the category page "CATEGORY ONE" of my website
Then The product "VISIBLE 1" is "Visible"
And The product "VISIBLE 2" is "Visible"
And The product "NOT VISIBLE 1" is "Not visible"
And The product "NOT VISIBLE 2" is "Not visible"
This is one scenario for speed reasons:
All products are (or are not) on the page: we load the category page once.
If we divide the scenario in 4 (with eg. an "Examples:" section), we would
load the category page 4 times (we cannot have a Background section because
the .feature file has more scenarios that don't share that background).
And this scenario is quite simple, but in real life we get more complex
scenarios that navigate through several pages and have additional OPTIONAL
assertions on each page: such assertion failures should be reported as
errors, but the test must continue in order to spot all assertion failures,
and not stop at the first failure and hide other potential failures...
Is it possible for a future version of Cucumber to add such FAILED step
that continues to execute the next steps?
So that an optional assert failure will not hide other failures by not
executing their steps.
This could be done with an annotation like that:
@WarningInsteadOfFailure
@Then("^The product " + PLACEHOLDER_STRING + " is " +
PLACEHOLDER_STRING + "$")
public void the_product_is(String productName, Visibility visibility) {
assertThat(page(CategoryPage.class).getProduct(productName) !=
null).isEqualTo(visibility.isVisible());
}
Or this could be more fine-grained:
Instead of a @WarningInsteadOfFailure annotation, we could request only
specific exceptions to be treated as warnings:
@WarningInsteadOfFailure({AssertionError.class,
NoSuchElementException.class})
What do you think about this proposal?
Have a nice day,
Sébastien Laoût.
First of all, thanks for this wonderful framework.
Step execution results can have two main states: PASSED or FAILED (if we
ignore PENDING, SKIPPED, UNDEFINED, etc.).
I'd like steps to have another middle state: WARN.
This state would threat the step as FAILED but will not skip the execution
of the following steps.
Here is why:
I have such a scenario:
When I go to the category page "CATEGORY ONE" of my website
Then The product "VISIBLE 1" is "Visible"
And The product "VISIBLE 2" is "Visible"
And The product "NOT VISIBLE 1" is "Not visible"
And The product "NOT VISIBLE 2" is "Not visible"
This is one scenario for speed reasons:
All products are (or are not) on the page: we load the category page once.
If we divide the scenario in 4 (with eg. an "Examples:" section), we would
load the category page 4 times (we cannot have a Background section because
the .feature file has more scenarios that don't share that background).
And this scenario is quite simple, but in real life we get more complex
scenarios that navigate through several pages and have additional OPTIONAL
assertions on each page: such assertion failures should be reported as
errors, but the test must continue in order to spot all assertion failures,
and not stop at the first failure and hide other potential failures...
Is it possible for a future version of Cucumber to add such FAILED step
that continues to execute the next steps?
So that an optional assert failure will not hide other failures by not
executing their steps.
This could be done with an annotation like that:
@WarningInsteadOfFailure
@Then("^The product " + PLACEHOLDER_STRING + " is " +
PLACEHOLDER_STRING + "$")
public void the_product_is(String productName, Visibility visibility) {
assertThat(page(CategoryPage.class).getProduct(productName) !=
null).isEqualTo(visibility.isVisible());
}
Or this could be more fine-grained:
Instead of a @WarningInsteadOfFailure annotation, we could request only
specific exceptions to be treated as warnings:
@WarningInsteadOfFailure({AssertionError.class,
NoSuchElementException.class})
What do you think about this proposal?
Have a nice day,
Sébastien Laoût.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.