-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Test parametrization #1257
-
What is the correct way to parametrize tests? In the examples, I found @parameterized.expand, however I am not able to identify the specific test case with pytest (pytest myFile.py::MyClass:theTest). I also tried to use @pytest.mark.parametrize from pytest, but it wont recognize the arguments in the test (probably due to the BaseTest class?)
Beta Was this translation helpful? Give feedback.
All reactions
Hi @jirikralik Here are two examples to take a look at:
https://github.com/seleniumbase/SeleniumBase/blob/master/examples/parameterized_test.py
https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_pytest_parametrize.py
They each use a different syntax format of SeleniumBase. For the first, which uses BaseCase
inheritance, you need to use the parameterized
library. The second uses @pytest.mark.parametrize
because that works in combination with the sb
pytest fixture.
Replies: 1 comment
-
Hi @jirikralik Here are two examples to take a look at:
https://github.com/seleniumbase/SeleniumBase/blob/master/examples/parameterized_test.py
https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_pytest_parametrize.py
They each use a different syntax format of SeleniumBase. For the first, which uses BaseCase
inheritance, you need to use the parameterized
library. The second uses @pytest.mark.parametrize
because that works in combination with the sb
pytest fixture.
Beta Was this translation helpful? Give feedback.