Skip to content

Commit afb4323

Browse files
committed
Document discrepancy between the preprocessor and cucumber-js
1 parent 4d834be commit afb4323

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/cucumber-basics.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ When("I fill in the entire form", function () {
105105

106106
`Before()` and `After()` is similar to Cypress' `beforeEach()` and `afterEach()`, but they can be selected to conditionally run based on the tags of each scenario, as shown below. Furthermore, failure in these hooks does **not** result in remaining tests being skipped. This is contrary to Cypress' `beforeEach` and `afterEach`.
107107

108+
> **Note**
109+
> Contrary to how cucumber-js works, these `After()` hooks **does not** run if your scenario fails[^1].
110+
108111
```ts
109112
import { Before } from "@badeball/cypress-cucumber-preprocessor";
110113

@@ -124,3 +127,5 @@ Before({ tags: "@foo or @bar" }, function () {
124127
// This hook will be executed before scenarios tagged with @foo or @bar.
125128
});
126129
```
130+
131+
[^1]: This discrepancy between the preprocessor and cucumber-js is currently considered to be unsolvable, as explained [here](https://github.com/badeball/cypress-cucumber-preprocessor/issues/824#issuecomment-1561492281).

0 commit comments

Comments
 (0)