Support automatic loading of step definitions from External Modules#262
Draft
Support automatic loading of step definitions from External Modules#262
Conversation
If we want to support EMs, we want to support loading of step definitions that are defined for an EM
|
I tested this. The step definitions are being picked up from the EM repository, but when a step definition is shared between two EMs, I have to add it to both repositories. This then causes Cypress to report duplicate step definitions during execution. |
Collaborator
|
Thanks for the feedback @MintooXavier! @aldefouw, to resolve this, does it make sense to only load step definitions for the module currently being tested? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The aim of this change is to support the automatic loading of step definitions that are defined for an EM right within the
package.jsonfile by default.We've standardized on the path for automated tests existing here:
So, I think this makes sense.
Pre-flight Checklist
Overview
This change supports loading step definitions from the External Modules. Without it, you'd have to manually copy step definitions into the base
redcap_cypress/support/step_definitionsfolder.Context
This is the setup we're using at UW to make this work.
Note:
1 This is recommended approach per official documentation within
cypress-cucumber-preprocessorrepository as linked here:https://github.com/badeball/cypress-cucumber-preprocessor/blob/master/docs/step-definitions.md
2 You'll notice that "step_definitions" (snakecase) moves to "stepDefinitions" (camelcase). This is not a mistake. It appears this is a long standing bug. It should have been camelcase since the beginning.