0

Let's consider there are 100's of tests written in multiple test{N}.py files (some of the dependant of each other and hooked dependencies).

   pages
   |--page1.py
   |--page2.py
   tests
   |--config.py
   |--test1.py
   |--test2.py
   |--test3.py 
   run_all_tests.py
   drivers

Following the POM model. All test cases are appended in the run_all_tests.py.

Question 1. Every time when need to skip tests from execution, I skip those from test1.py, test2.py, test3.py, etc files with a marker. Is there any effective way to do so without touching test files?

Question 2 Can we execute test cases in sequence by providing sequence/execution order in the run_all_tests.py? (Like in TestNG one can execute from .xml file, can provide an order of execution and skip tests etc. features)

L3viathan
  • 26,748
  • 2
  • 58
  • 81
Prashant Morade
  • 31
  • 1
  • 1
  • 7
  • What do you mean by "POM model"? You don't need a file `run_all_tests.py`, the command `pytest` will automatically discover tests if their modules start with `test_`. – L3viathan Jul 28 '20 at 07:17
  • 3
    Question 1: https://docs.pytest.org/en/latest/example/pythoncollection.html `--ignore=tests/foobar/test_foobar_03.py --ignore=tests/hello/` Question 2: https://stackoverflow.com/questions/17571438/test-case-execution-order-in-pytest – Tin Nguyen Jul 28 '20 at 07:17

0 Answers0