hrcorval / behavex

BDD test wrapper for parallel test executions and more!
https://github.com/hrcorval/behavex
MIT License
85 stars 20 forks source link

Flexibility using maximum potential of RegEx (in matcher module) for StepDefs is needed #102

Closed qarampage closed 9 months ago

qarampage commented 1 year ago

Hi @anibalinn

At the moment I can't create something like in the StepDef file , which I could easily achieve in JAVA Cucumber plugin.

Tools : Pycharm Community + Gherkin (plugin) / Cucumber / Cucumber+ plugin Framework Package : behavex Python 3.11

Here are the samples I am looking for :

Step given in a Scenario Then I verify response body with below attributes | FieldName | FieldValue | | access_token | Token_I_captured_previously |

StepDef I had @step(u'I verify response (header|body|code) with below attributes') def step_impl(context, whichType): print(whichType) response_has_key(response_dict, context.table, "body")

Error I received on the Terminal: You can implement step definitions for undefined steps with these snippets: @then(u'I verify response body with below attributes') def step_impl(context): raise NotImplementedError(u'STEP: Then I verify response body with below attributes')

Similarly I need the following to be available like we have in JAVA. Can this be implemented in the BehaveX matcher module ?

image
hrcorval commented 9 months ago

Hi @qarampage. This request is related to the base Behave framework. Based on the documentation you should use the regular expresions as detailed in the following document: https://jenisys.github.io/behave.example/step_matcher/re_matcher.html

I hope it helps.