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

Step definition parses wrong parameter from feature file #670

Open
NavyaAJ opened this issue Jan 29, 2024 · 1 comment
Open

Step definition parses wrong parameter from feature file #670

NavyaAJ opened this issue Jan 29, 2024 · 1 comment
Labels
awaiting response Awaiting response from the reporter

Comments

@NavyaAJ
Copy link

NavyaAJ commented Jan 29, 2024

Pytest BDD version : 7.0.1

I have below lines in feature file:

Given..
When..
Then I see  a <status_code_returned>
And I see a "<error_message>"

Examples:
|status_code_returned| error_message.                        |
| 409                |   credential exists                   |

Within the step definition .py file of Then, the value of status code is populating as , ' credential exists ' instead of 200, and it is throwing ValueError exception during assertion as it is expecting int (200)

I tried commenting And line in feature file and the value for status_code_returned is passing as expected.

Update:

The issue is step definition for feature line And I see a "<error_message>" is before than the line Then I see a <status_code_returned>. So during execution , pytest-bdd maps this line with the other as the beginning of both the feature lines are same.

This code was perfectly working in previous versions of pytest-bdd, so it will be great if a fix can be in place.

@jsa34
Copy link
Collaborator

jsa34 commented Nov 28, 2024

@NavyaAJ Thanks for raising this issue.

Could you:

  1. Check if this still occurs with version 8.0.0?
  2. If so, provide a minimal reproducible example (feature and step definition code)
    ?

@jsa34 jsa34 added the awaiting response Awaiting response from the reporter label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Awaiting response from the reporter
Projects
None yet
Development

No branches or pull requests

2 participants