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

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

explicit user configuration is not loaded in 20.0.5 #1185

yodarx opened this issue May 6, 2024 · 4 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

  • I've read the FAQ.
  • I've read instructions for logging issues.
  • I'm not using cypress-cucumber-preprocessor@4.3.1 (package name has changed and it is no longer the most recent version, see #689).
@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

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

4 participants