pytest-dev / pytest-bdd

BDD library for the pytest runner
https://pytest-bdd.readthedocs.io/en/latest/
MIT License
1.31k stars 221 forks source link

New pytest bdd 6.0.1 doesnt take null values from the Examples within the scenario outline #551

Open Arundev404 opened 2 years ago

Arundev404 commented 2 years ago

Steps to reproduce

  1. Within a Pytest feature file try to have a scenario outline
  2. 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 into password and valid credential on the other textbox Then verify wrong_password will display a 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)

  1. In the run time of the test ,the null value is getting as " " (double qoutes)
youtux commented 2 years ago

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.

Arundev404 commented 2 years ago

Hi @youtux did you got the chance to have a look into the issue

youtux commented 2 years ago

Please reformat your code so that it's readable.

elchupanebrej commented 2 years ago

@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