pytest-bdd icon indicating copy to clipboard operation
pytest-bdd copied to clipboard

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

Open Arundev404 opened this issue 3 years ago • 4 comments
trafficstars

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 <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)

  1. In the run time of the test ,the null value is getting as " " (double qoutes)

Arundev404 avatar Aug 09 '22 18:08 Arundev404

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.

youtux avatar Aug 10 '22 10:08 youtux

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

Arundev404 avatar Aug 17 '22 12:08 Arundev404

Please reformat your code so that it's readable.

youtux avatar Aug 19 '22 19:08 youtux

@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

elchupanebrej avatar Oct 17 '22 18:10 elchupanebrej