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

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

Open
Arundev404 opened this issue Aug 9, 2022 · 4 comments

Comments

@Arundev404
Copy link

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)
@youtux
Copy link
Contributor

youtux commented Aug 10, 2022

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
Copy link
Author

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

@youtux
Copy link
Contributor

youtux commented Aug 19, 2022

Please reformat your code so that it's readable.

@elchupanebrej
Copy link

elchupanebrej commented Oct 17, 2022

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants