Non-capturing text in action words definitions


Is it possible to use non-capturing text in steps/action word definitions?

For example I would like to be able to say:
Given I have an “something” and Given I have a “something” to be able to use either “an” or “a” and not to become a variable.

Something like: Given I have (?:a|an) “something”



Hi @daniel.crisan,

Can you give me more details about your use case please?

Thanks in advance.




For example now if I have a step:
Given I have “1” cat
But I also want to say:
Given I have “2” cats
It will create two action words because of the trailing “s” from cats. But I would like to have only one action word.

It’s also discussed here:

Thank you



Thank you fir this explanation.

For now that’s not possible to have such possibilities because we can export in many languages and for some of them there is no support of regular expressions.

The closest you can get to this functionality with HipTest is by defining two actionwords, and make the first one call the second one. When exporting to Gherkin-based languages, the actionword will call the other one as you expect, and you just have to implement one method.

Would that fit your needs?



Thank you for the answer. For now I use parameters and it works ok so far.



Great :grinning:

you’re welcome!