Comments (10)
I am having a similar issue, I am trying to separate features from step_definitions so in my package.json :
"cypress-cucumber-preprocessor": { "step_definitions": "./cypress/integration/project/stepdefinitions/" }
and my file path for features is cypress/integration/project/features/file.feature
When I run the feature, it cannot find my step definitions.
from cypress-cucumber-preprocessor.
Thanks!
Would you be able to make a fork and try this out? Possibly adding step definitions in a place that would be accessible only through glob and .feature test for it?
from cypress-cucumber-preprocessor.
Hi! Thanks for the quick reply! I would love to but embarrassingly I'm pretty new to Github and currently don't have too much time on my hands for the next couple weeks. I could possibly get on it after a few weeks but I would really appreciate it if a more seasoned contributor were available to get on it. Any takers for now?
Thanks again!
from cypress-cucumber-preprocessor.
Sure, we could probably have someone cook this up for you.
But, just to clarify, do you have something like:
cypress/
step_definitions/
featureSomtehing/
somethingDefinition.js
otherDefinition.js
otherFeature/
...otherDefinition.js
maybeADefinitionHere.js
or
cypress/
stepDefinitionsFirstFolder/
definitions.js
stepDefinitionsSecondFolder/
someOtherDefinitions.js
?
If it's the second case, what's the reason for NOT putting the step definitions under one folder (with nested folders)?
Could you explain a bit more your situation?
from cypress-cucumber-preprocessor.
Awesome thanks!
It is more like the first case.
To give you more context, let's call the project i'm working on "TestRunnerApp". TestRunnerApp is responsible for running tests for Repository-A and Repository-B. Thus, Repository-A and Repository-B are pulled into TestRunnerApp via npm link.
Both Repository-A and Respository-B will generally have a folder structure like below:
e2e/ common/ step_definitions/ example1CommonStepDefinitions.js example2CommonStepDefinitions.js features/ feature1Folder/ step_definitions/ stepDefinitionsSpecificToFeature1.js feature1.feature
So putting it all together, imagine the above folder structure for both Repository-A and Repository-B within the node_modules of TestRunnerApp (because they are pulled in via npm link).
So, I want to be able to do something like below in the package.json for TestRunnerApp:
"cypress-cucumber-preprocessor": { "step_definitions": "./node_modules/+(Repository-A|Repository-B)/e2e/**/step_definitions/" }
I hope this helps. Thanks again!
from cypress-cucumber-preprocessor.
Hi There,
I tried the sample project here @
https://github.com/TheBrainFamily/cypress-cucumber-example
I upgraded the dependencies to
"cypress": "^3.0.1",
"cypress-cucumber-preprocessor": "1.2.2"
I notice I'm able to override the default "step_definitions" path when I set this in the package.json
"cypress-cucumber-preprocessor": {
"step_definitions": "./cypress/support/step_definitions/"
}
However, I'm unable to do this within "cypress/plugins/index.js"
const cucumber = require('cypress-cucumber-preprocessor').default
module.exports = (on, config) => {
on('file:preprocessor', cucumber())return Object.assign({}, config, {
"integrationFolder": "cypress/integration",
"step_definitions": "tests/e2e/support/step_definitions/"
})}
Naturally, when I set that here I remove the entry within package.json but it doesn't seem to pick up the path I set within "cypress/plugins/index.js". Do I have this right? Any pointers on this would be greatly appreciated.
from cypress-cucumber-preprocessor.
the package.json is a different configuration than what you use here as the config. We've decided not to add anything to the cypress configuration as it's owned by the cypress guys and they didn't really want to cooperate on decisions here. :)
Why can't you use package.json?
from cypress-cucumber-preprocessor.
No I can use the package.json (it's just nice to have all test application configuration centralised in the one place is my only thing 👍 )
For example the "integrationFolder" is defined within "cypress/plugins/index.js"
the code behind that driving the test scenario is within "package.json"
"cypress-cucumber-preprocessor": {
"step_definitions": "./cypress/support/step_definitions/"
}
make sense?
from cypress-cucumber-preprocessor.
I am basically requesting the same in this issue: #483
This is the structure that I'm looking for:
- integration/
- common/
- step_definitions/
- example1CommonStepDefinitions.js
- example2CommonStepDefinitions.js
- features/
- frontend/
- step_definitions/
- frontendstep1.js
- someotherfrontendstep.js
- frontendfeature1.feature
- backendend/
- step_definitions/
- backendstep1.js
- someotherbackendstep.js
- backendfeature1.feature
Can this be achieved in any other way?
from cypress-cucumber-preprocessor.
Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far.
Read more about the transfer of ownership here.
The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so.
from cypress-cucumber-preprocessor.
Related Issues (20)
- Invalid or unexpected token when using createEsbuildPlugin HOT 6
- diagnostics - Cypress.env is not a function when referring to env object as const HOT 7
- Error occured for cypress+cucumber HOT 2
- Error 'glob.escape is not a function' in Headless Mode with Cypress Cucumber Preprocessor 19.1.0 and Node 18.12.0 HOT 10
- negative filters should allow to opt-in/out for non-feature files HOT 2
- Dry run: static code analyses with fallback to evaluation
- Compatibility Issues and Deprecation Warnings with Outdated @cypress/browserify-preprocessor HOT 3
- Cannot see error logs details in Cypress UI debugger HOT 1
- Emit meta information like cucumber-js
- cypress-cucumber-preprocessor support cypress-vite HOT 4
- esbuild always get installed even we want to use webpack HOT 1
- Merge reports obtained through parallelization using Cypress Cloud
- Error: Unexpected state in specEnvelopesHandler: initial (this might be a bug, please report at ...) HOT 8
- Feature request: Add videos to Cypress' cucumber reports HOT 2
- Avoid writing implicit messages report
- Error occured while using cypress+BDD HOT 2
- An error was thrown in your plugins file while executing the handler for the before:spec event HOT 5
- Very constantly getting this error : An error was thrown in your plugins file while executing the handler for the after:run event. HOT 4
- Receiving this error too frequently while running tests - This socket has been ended by the other party HOT 3
- Hook failures can't be represented in any reports (messages / json / html), thus none is created HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress-cucumber-preprocessor.