Good day. I am engaged in testing, I use Selenium and Python.
It became necessary to record all the tests in 1 file and run the script with the parameters and so that the selected tests were performed.
I feel that there is a lack of fundamental knowledge, but googling on specifics, did not lead to an answer, nor to the direction of where to look.
Now my tests are broken down into different files, and each one has hardcodes where to enter, what kind of login password and so on.
class loginTest(unittest.TastCase): def setUp(self): #открываю браузер и нужную страницу def test_1(self): # логинюсь и выполняю набор кейсов def test_2(self): # логинюсь и выполняю набор кейсов def test_3(self): # логинюсь и выполняю набор кейсов def test_4(self): # логинюсь и выполняю набор кейсов def tearnDown(self): #Забираю из памяти теста лог, организую отчёт if __name__ == '__main__': unittest.main() What I want to do looks mock-up like this, but how can I choose when I run the script, run test 1 and 4 or any other set, there are no ideas. Who faced such, prompt, I will be glad even to the link where it is possible to read.
python -m unittest test_module.TestClass.test_method. This is what you need? - Anton Komyshan