You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/diagnostics.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,3 +16,23 @@ This supports some of the same flags as Cypress, including
16
16
The intention here being that whatever flags you use to run `cypress run` can also be consumed by the executable to give appropriate diagnostics.
17
17
18
18
> :warning: This feature is especially experimental, it's subject to change anytime and is not considered under semver.
19
+
20
+
## Limitations
21
+
22
+
In order to obtain structured information about step definitions, these files are resolved and evaluated in a Node environment. This environment differs from the normal Cypress environment in that it's not a browser environment and Cypress globals are mocked and imitated to some degree.
23
+
24
+
This means that expressions such as that shown below will work.
25
+
26
+
```ts
27
+
import { Given } from"@badeball/cypress-cucumber-preprocessor";
28
+
29
+
const foo =Cypress.env("foo");
30
+
31
+
Given("a step", () => {
32
+
if (foo) {
33
+
// ...
34
+
}
35
+
});
36
+
```
37
+
38
+
However, other may not. Cypress globals are mocked on a best-effort and need-to-have basis. If you're code doesn't run correctly during diagnostics, you may open up an issue on the tracker.
0 commit comments