Skip to content
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

explicit user configuration is not loaded in 20.0.5 #1185

Closed
3 tasks done
yodarx opened this issue May 6, 2024 · 6 comments
Closed
3 tasks done

explicit user configuration is not loaded in 20.0.5 #1185

yodarx opened this issue May 6, 2024 · 6 comments

Comments

@yodarx
Copy link

yodarx commented May 6, 2024

Current behavior

Since version 20.0.5 no explicit user configuration is loaded from package.json is loaded.
When I place the configuration in .cypress-cucumber-preprocessorrc.json within the cypress directory it works.

Debug Log with Version 20.0.5:

cypress-cucumber-preprocessor resolved no explicit user configuration +1ms

Debug Log with Version 20.0.4

cypress-cucumber-preprocessor resolved explicit user configuration { stepDefinitions: [ './integration/common/*.ts' ] } +2ms

Desired behavior

User configuration in package.json is recognized.

Test code to reproduce

Structure of my project

  • project
    • package.json
    • projects/
      • project-e2e/
        • integration/
          • common/
            • Common Step Definitions.ts

My configuration in package.json:

  "cypress-cucumber-preprocessor": {
    "nonGlobalStepDefinitions": true,
    "stepDefinitions": [
      "./integration/common/*.ts"
    ]
  },

Run DEBUG=cypress:electron,cypress-configuration,cypress-cucumber-preprocessor cypress open, the explicit user configuration is not loaded.

Versions

  • Cypress version: 13.6.6
  • Preprocessor version: 20.0.5
  • Node version: 20.11.1

Checklist

@badeball
Copy link
Owner

badeball commented May 6, 2024

Works seemingly fine as far as I can see. You need to provide a minimal, reproducible example.

@rujorgensen
Copy link

I'm experiencing a similar issue (common step definitions not found), although our custom configuration is placed in cypress-cucumber-preprocessor.config.js, and not in package.json 🙂. Downgrading to 20.0.4 fixes it.

@badeball
Copy link
Owner

Here's an example illustrating configuration using package.json and here's a similar example using cypress-cucumber-preprocessor.config.js. They both work, so I'm guessing you're doing something that you're not telling me about.

The purpose of a reproducible example is that it's unambiguous and you need to provide it.

@florianbnd
Copy link

florianbnd commented May 27, 2024

Hello,

I think this issue is linked to cosmicconfig package version 8.3.6 to 9.0.0 and the structure of your project.
searchStrategy is none by default and your configuration is located in root package.json.

Can you try creating a package.json file located in project-e2e with your configuration :
"cypress-cucumber-preprocessor": { "nonGlobalStepDefinitions": true, "stepDefinitions": [ "./integration/common/*.ts" ] }

@badeball Could you please have a look also ? :)

More details here : https://github.com/cosmiconfig/cosmiconfig/blob/main/CHANGELOG.md#900

@warri93
Copy link

warri93 commented Jun 3, 2024

@badeball based on what @florianbnd said, are you planning on adding the option to set searchStrategy to project?

Creating separate package.json files for all my e2e projects feels like a lot off overkill right now.

Thank you!

@badeball
Copy link
Owner

badeball commented Jun 6, 2024

@florianbnd, I'm aware of the changelog, but I don't make any changes based on a hunch. Instead, I'd really like for someone to just provide some information indicating that that is indeed the issue being observed. @warri93 has done so now, hence the change. This has been added with v20.0.6.

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

No branches or pull requests

5 participants