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.
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 |
Beta Was this translation helpful? Give feedback.
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 theparameterized
library. The second uses@pytest.mark.parametrize
because that works in combination with thesb
pytest fixture.