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 is not found when using Scenario Outline and "/" characters in the Examples #655

Open
marcinosb opened this issue Nov 24, 2023 · 6 comments

Comments

@marcinosb
Copy link

Hello,

pytest-bdd: 7.0.0

I am having a simple Scenario Outline which is using table like this:

        | Popup    | Country  | Site                             | Locator                       |
        | False      | US           | https://my-site.com  | <selenium_locator>  |

In this case I am getting everytime: pytest_bdd.exceptions.StepDefinitionNotFoundError exception.
Removing // from the https://my-site.com seems to help and the step works perfectly fine in that case.

Are there any characters that are not allowed to be used in the Scenario Outline examples?

Thanks!
Marcin

@youtux
Copy link
Contributor

youtux commented Dec 2, 2023

interesting, this seems a bug indeed, I'll have a look

@kotavi
Copy link

kotavi commented Feb 28, 2024

I have similar issue but with "#". I'm validating a text on the screen

And User verifies that "UP/DN NX/PR #JMP Add Brkup Del Edit  [1]" is on line "7" on the screen

@given(parsers.cfparse('User verifies that "{text}" is on line "{line}" on the screen'))

But I get

E           KeyError: 'pytestbdd_then_User verifies that "UP/DN NX/PR'

..\..\sepac-pytest-bdd-autotests\venv\lib\site-packages\_pytest\fixtures.py:599: KeyError

any suggestions?

@youtux
Copy link
Contributor

youtux commented Mar 1, 2024

@kotavi that happens because pytest-bdd treats everything after # as comment (like in python). That's unrelated to the original issue

@kotavi
Copy link

kotavi commented Mar 1, 2024

@youtux is there an existing issue for this or should I create a new one? "#" should be accepted as a part of the input in the step definition

@youtux
Copy link
Contributor

youtux commented Mar 2, 2024

Did you try escaping it with a backslash, like \#?

@kotavi
Copy link

kotavi commented Mar 5, 2024

when I do '#' it's treated as a string with '', so I just added a workaround in the step definition code.

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

No branches or pull requests

3 participants