Skip to content

Filtered specs affect common ancestor path #785

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

Closed
badeball opened this issue Aug 2, 2022 · 1 comment
Closed

Filtered specs affect common ancestor path #785

badeball opened this issue Aug 2, 2022 · 1 comment

Comments

@badeball
Copy link
Owner

badeball commented Aug 2, 2022

For Cypress v10 and higher, a common ancestor path (CAP) is calculated for all spec files and used as an implicit integration folder. This implicit folder is removed from the absolute path of all spec files and the result is used as replacement values in stepDefinitions.

IE. given the following spec files

  • cypress/e2e/foo/bar.feature
  • cypress/e2b/baz/qux.feature

and stepDefinitions: "cypress/e2e/[filepath].ts", then we'd have a CAP of cypress/e2e. For cypress/e2e/foo/bar.feature, we'd remove it and the extension and be left with foo/bar, this is what's used for [filepath].

The CAP is calculated inside template.ts, which is implicitly invoked by EG. esbuild.ts. It however, will typically be invoked after addCucumberPreprocessorPlugin(..) has had a chance to mutate the config object. This may affect the ability to calculate a proper CAP, as we're now basing it on a subset of the spec files.

badeball added a commit that referenced this issue Aug 2, 2022
badeball added a commit that referenced this issue Aug 8, 2022
The value that is sometimes mutated by addCucumberPreprocessorPlugin(),
is read by compile() as it attempts to calculate a common ancestor
path of all the files.

It would erroneously use the filtered specs to determine this value and
this obviously adversely affected the ability to resolve step
definitions.

This fixes #785.
badeball added a commit that referenced this issue Aug 8, 2022
The value that is sometimes mutated by addCucumberPreprocessorPlugin(),
is read by compile() as it attempts to calculate a common ancestor
path of all the files.

It would erroneously use the filtered specs to determine this value and
this obviously adversely affected the ability to resolve step
definitions.

This fixes #785.
@badeball
Copy link
Owner Author

badeball commented Aug 8, 2022

This has been fixed in v12.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant