|
1 | 1 | # pytest-gui
|
2 |
| -GUI for running Python Unit Tests |
| 2 | + |
| 3 | +This provides a GUI based test runner for Python Unittests and py.tests. |
| 4 | + |
| 5 | +* Load Test cases from any directory. |
| 6 | +* Run single test, multiple selected tests or all tests. |
| 7 | +* Auto-Discover test cases recursively; in any subdirectory under current directory. |
| 8 | +* Display status of every test run, including test output, description, duration and any errors. |
| 9 | +* Status text at the bottom showing how many test cases are run, passed, failed or skipped. |
| 10 | +* Status bar shown while tests are running - showing progress bar on test completion. |
| 11 | + |
| 12 | +## Getting Started |
| 13 | + |
| 14 | +* Clone the pytest-gui repository |
| 15 | +* Install dependencies (`pip install -r requirements.txt`) |
| 16 | +* Run command and select the directory to search/run tests from (`python main.py`) |
| 17 | + |
| 18 | +## General Usage |
| 19 | + |
| 20 | +Initial screen consists of a left side pane, showing all the test cases that are discovered |
| 21 | +in the selected directory. By default, this would load tests from **_../tests_** directory. We can |
| 22 | +load tests from any other directory using the _Reload Tests_ button. |
| 23 | + |
| 24 | +On left side we can select one or multiple test cases. To select multiple test cases, click the control |
| 25 | +button and select more test cases. If a parent of a test case is selected, then all tests under that |
| 26 | +parent are selected to run. |
| 27 | + |
| 28 | +## Commands. |
| 29 | + |
| 30 | +### Run Button |
| 31 | + |
| 32 | +The Run button provides option to run selected test cases. This would run all test cases that are selected. |
| 33 | +If any higher level tests are selected (either a test class or a test file), then all tests under that test |
| 34 | +are executed. |
| 35 | + |
| 36 | +### Re-run Button |
| 37 | + |
| 38 | +The Re-run button runs only failures. If no tests have been run, this is similar to Run-All button whereby |
| 39 | +it would run all test cases. |
| 40 | + |
| 41 | +### Run-all Button |
| 42 | + |
| 43 | +This would run all test cases. |
| 44 | + |
| 45 | +### Stop Button |
| 46 | + |
| 47 | +This would stop any running test cases. The status of already run test cases would remain as is. |
| 48 | + |
| 49 | +## Test Case Status |
| 50 | + |
| 51 | +There are 4 test cases statuses and they are appropriately color-coded. |
| 52 | + |
| 53 | +* **_Unrun_**: Test cases are not run yet. They would be highlighted with black color. |
| 54 | +* **_Pass_**: Test cases are run and passing. They would be highlighted with green color. We also show a green circle on the right pane in details section. |
| 55 | +* **_Fail_**:Test cases are run and failing. They would be highlighted with red color. We also show a red circle on the right pane in details section. |
| 56 | +* **_Skip_**: Test cases are skipped using @unittest.skip directive. They would be highlighted with blue color. We also see a blue circle on the right pane in details section. |
0 commit comments