allankp / pytest-testrail

pytest plugin for integration with TestRail, for creating testruns and updating results
MIT License
95 stars 125 forks source link

Annotate tests with associated test suite #141

Open davebrochu-es opened 3 years ago

davebrochu-es commented 3 years ago

Is your feature request related to a problem? Please describe. Many teams use multiple test suites in TestRail for given projects. In an automated test project, it is possible that one directory or file contains tests that belong to one suite while another directory or file contains tests that belong to a different suite. If a regression tests is run where ALL automated tests are run, it isn't possible using this plugin to upload test result. This is due to a limitation where the user must specify from the command line/config the suite-id that ALL tests being run are associated with.

The only way around this is to run different suites independently using pytest, each time supplying the suite-id that is relevant for the tests selected.

Describe the solution you'd like Similar to the @pytestrail.case and @pytestrail.defect decorators, a decorator to specify the suite a test belongs to would be useful. @pytestrail.suite_id.

davebrochu-es commented 3 years ago

Looking at the TestRail API, add_run requires a suite_id, which is likely where this requirement in the pytestrail plugin originates from. In order to support this, the plugin would need to create multiple test runs, given that each requires its own suite_id.