|
| 1 | +## TestiPy - Python Test Tool |
| 2 | + |
| 3 | +[](https://pypi.python.org/pypi/TestiPy) |
| 4 | +[](https://pypi.org/project/TestiPy) |
| 5 | + |
| 6 | +This documentation provides an overview of TestiPy, a Python tool designed for test selection, execution, and reporting. TestiPy offers features like test management, parallel execution, and integration with various reporting tools. It aims to streamline the testing process, making it easier to organize, execute, and analyze test results. |
| 7 | + |
1 | 8 |
|
2 | 9 | # 1. Installation |
3 | 10 | - ## From GitHub |
|
26 | 33 | ```bash |
27 | 34 | # goto your folder where you've cloned this repo |
28 | 35 | cd /where_you_have_cloned_this_repo |
29 | | - |
| 36 | +
|
30 | 37 | # run demo tests indicating where the tests are and using the web reporter |
31 | 38 | python testipy/run.py -tf testipy/tests -r web |
32 | 39 | ``` |
|
55 | 62 | -ef Exclude tests by @FEATURES tag |
56 | 63 | -itn Include tests by @TN tag (beginsWith) (ex: -itn 1.3.1.10) |
57 | 64 | -etn Exclude tests by @TN tag (beginsWith) |
58 | | - |
| 65 | + |
59 | 66 |
|
60 | 67 | # 2.2. Select Reporters |
61 | 68 | - ### options: |
|
72 | 79 |
|
73 | 80 | # 2.3. Run: |
74 | 81 | - ### options: |
75 | | - * **-rid** RunID (ex: -rid 17, if not passed then current hour and minute will be used ex: 2359) |
76 | | - * **-pn** ProjectName (ex: -pn jules) |
77 | | - * **-env** EnvironmentName to test (ex: -env dev) |
78 | | - * **-rf** ResultsFolder (ex: -rf "/qa/test_results/"), where the tests results will be stored |
79 | | - * **-tf** TestsFolder (ex: -tf "/qa/tests_scripts/jules/"), full path to where the tests are |
80 | | - * **-repeat** Run the exact same pipeline that amount of times (ex: -repeat 3) |
81 | | - * **-st** Suite Threads = 1..8 (ex: -st 4, meaning 4 suites can run in parallel) |
82 | | - |
| 82 | + * `-rid`: Run ID (e.g., `-rid 17`). If not provided, the current hour and minute will be used (e.g., `2359`). |
| 83 | + * `-pn`: Project Name (e.g., `-pn my_project`). |
| 84 | + * `-env`: Environment Name for testing (e.g., `-env qa`). |
| 85 | + * `-rf`: Results Folder (e.g., `-rf /path/to/results/`), where test results will be stored. |
| 86 | + * `-tf`: Tests Folder (e.g., `-tf /path/to/tests/`), the directory containing test scripts. |
| 87 | + * `-r` or `-reporter`: Add a reporter (e.g., `-r echo -r log -r web`). |
| 88 | + * Available reporters include: `echo`, `excel`, `log`, `portalio`, `slack`, `web`, `xml`. |
| 89 | + * `-repeat`: Number of times to repeat the test execution (e.g., `-repeat 3`). |
| 90 | + * `-st`: Suite Threads (1 to 8), controls the number of suites that can run in parallel (e.g., `-st 4`). |
| 91 | + |
83 | 92 | - ### flags |
84 | | - * **--dryrun** All tests will run but without really being executed (all of them will end with SKIPPED) |
85 | | - * **--debugcode** Disables the try/except on tests so errors are shown |
86 | | - * **--debug-testipy** will show the stacktrace for testipy classes |
87 | | - * **--1** Override test definitions of how many times tests will run (ncycle) |
88 | | - * **--prof** Create file .prof with profiling data |
89 | | - |
| 93 | + * `--dryrun`: Runs tests without actual execution (all tests are marked as 'SKIPPED'). |
| 94 | + * `--debugcode`: Disables try/except blocks in tests, showing detailed error messages. |
| 95 | + * `--debug-testipy`: Shows stack traces for TestiPy classes (useful for debugging the tool itself). |
| 96 | + * `--1`: Overrides the default number of test cycles (ncycles) defined in test suites, forcing all tests to run only once. |
| 97 | + * `--prof`: Generates a `.prof` file with profiling data. |
| 98 | + |
90 | 99 |
|
91 | 100 | # 3. Example of usage: |
92 | 101 | - #### Example of usage: |
93 | 102 | ``` |
94 | 103 | python3 run.py -env dev -reporter log -reporter web -rid 1 -tf "/home/testipy/my_test_scripts" -et NO_RUN -it DEV |
95 | 104 | ``` |
96 | | - - #### Storyboard: |
| 105 | + - #### Storyboard: |
97 | 106 | - If storyboard passed, tests will run by the order defined on json file |
98 | 107 | - If no storyboard is passed, then tests will run ordered (DESC) by package name, @PRIO defined on suite, then by @PRIO defined on test itself |
99 | 108 | - #### Results Folder: |
100 | 109 | - A folder will be created under the (specified -rf option) composed by: projectName_currentDate_RID (ex: testipy_20201231_00525) |
101 | 110 | - Under the folder defined above, subfolders can be created with package_name/suite_name containing the tests results (created by each reporter) |
102 | 111 | - #### Tests not ended: |
103 | 112 | - If a test ends without being formally ended (by a testFailed, testSkipped or testPassed), it will be passed by the executor |
104 | | - |
| 113 | + |
| 114 | + |
| 115 | +In addition to the reporter-specific outputs, TestiPy creates a `results.yaml` file in the results folder, containing a summary of the overall test execution results. |
| 116 | + |
| 117 | +This tool provides a flexible and customizable framework for Python testing, offering features for test organization, execution control, and comprehensive reporting through various channels. |
| 118 | + |
| 119 | + |
| 120 | +For integrations with Behave framework, [check the example here](https://github.com/pjn2work/testipy-tests) |
| 121 | + |
105 | 122 |
|
106 | 123 | # 4. Suite Example |
107 | 124 | ``` python |
|
0 commit comments