pytest-bdd
pytest-bdd copied to clipboard
New pytest bdd 6.0.1 doesnt take null values from the Examples within the scenario outline
Steps to reproduce
-
Within a Pytest feature file try to have a scenario outline
-
Within example (just take example for a login page) as discussed 3.Scenario Outline: Login functionality with Negative password and valid email Given User opens login in page When the User enters <invalid_password> into password and valid credential on the other textbox Then verify wrong_password will display a <warning_message> under the textbox Examples: | invalid_password | warning_message | | | Password cannot be empty |
Step definition for the above scenario : def test_login_invalidPassword_Cases(): pass
@when(parsers.parse('the User enters {invalid_password} into {textbox} and valid credential on the other textbox')) def login_with_negative_password(textbox, invalid_password): Login_functions.fn_InvalidLogin(textbox, invalid_password)
- In the run time of the test ,the null value is getting as " " (double qoutes)
Hi, can you please reformat your post so that’s more readable? I’m on mobile at the moment, so it’s not easy for me to read it.
Hi @youtux did you got the chance to have a look into the issue
Please reformat your code so that it's readable.
@Arundev404 This is not a bug. If you need - you could use custom converter which converts an empty string to None as described at https://github.com/pytest-dev/pytest-bdd#step-arguments