GithubHelp home page GithubHelp logo

Requesting Enhancement for "Step_Definitions" location configuration in package.json to support glob patterns about cypress-cucumber-preprocessor HOT 10 CLOSED

badeball avatar badeball commented on August 20, 2024
Requesting Enhancement for "Step_Definitions" location configuration in package.json to support glob patterns

from cypress-cucumber-preprocessor.

Comments (10)

Huffman17 avatar Huffman17 commented on August 20, 2024 1

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.

lgandecki avatar lgandecki commented on August 20, 2024

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.

asmahkojo avatar asmahkojo commented on August 20, 2024

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.

lgandecki avatar lgandecki commented on August 20, 2024

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.

asmahkojo avatar asmahkojo commented on August 20, 2024

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.

bhreinb avatar bhreinb commented on August 20, 2024

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.

lgandecki avatar lgandecki commented on August 20, 2024

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.

bhreinb avatar bhreinb commented on August 20, 2024

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.

vio-codes avatar vio-codes commented on August 20, 2024

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.

badeball avatar badeball commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.