-
Notifications
You must be signed in to change notification settings - Fork 970
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
pytest.mark.parametrize is broken #395
Comments
@frafra See https://github.com/seleniumbase/SeleniumBase/blob/master/examples/parameterized_test.py which lets you parameterize tests with the “parameterized” package. |
@frafra To invoke pytest fixtures directly, such as pytest.mark.parameterize, see this example: import pytest
@pytest.mark.parametrize('value', ["pytest", "selenium"])
def test_sb_fixture_with_no_class(sb, value):
sb.open("https://google.com/ncr")
sb.update_text('input[title="Search"]', value + '\n')
sb.assert_text(value, "div#center_col")
class Test_SB_Fixture():
@pytest.mark.parametrize('value', ["pytest", "selenium"])
def test_sb_fixture_inside_class(self, sb, value):
sb.open("https://google.com/ncr")
sb.update_text('input[title="Search"]', value + '\n')
sb.assert_text(value, "div#center_col") Its uses seleniumbase as a fixture to allow the use of any pytest fixture. ( |
Here's an example of correct pytest.mark.parameterize usage with SeleniumBase: |
Thank you :-) but |
@frafra That's due to a bug with pytest itself. See pytest-dev/pytest#541 I've created a few different workarounds: 1, by using the |
pytest.mark.parametrize
works with pytest:...but it doesn't with seleniumbase:
Error message:
The text was updated successfully, but these errors were encountered: