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

Overriding step definitions #36

Open
raj-balaebail opened this issue Apr 23, 2021 · 1 comment
Open

Overriding step definitions #36

raj-balaebail opened this issue Apr 23, 2021 · 1 comment

Comments

@raj-balaebail
Copy link

I am trying to implement an inheritance/override model where I want to have a 'generic' step definition which will be imported in and specific steps overridden as necessary.

I was able to import the step definitions from my generic file, but the override (I used the same step definition name) seems to not be overriding the step definitions.
ex:
Generic file

Given('User navigates to x page', async () => {
  await pAPage.navigateTo('x')
});

Specific/inherited file

Given('User navigates to x page', async () => {
  await pAPage.navigateTo('y')
});

PS: Our software has a number of applications that are all similar but vary (differently) a bit from the base configuration based on the client. Having to define the common steps multiple times will create a maintenance nightmare. Hence we want to group the common step definitions in the generic file and import/override by client as needed.

Appreciate all the help in advance.

@raj-balaebail
Copy link
Author

raj-balaebail commented Apr 26, 2021

@rquellh I would appreciate if you can look in to this !! A potential solution (although I didn't find a equivalent in JS is https://github.com/makandra/cucumber_priority)

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

No branches or pull requests

1 participant