This nose plugin purpose is to send a test result data to TestRail.
Using pip:
pip install git+https://bitbucket.org/50onred/nose-testrail.git@master#egg=krypton-master
- nose
- Python 2.7
- testrail account
Some environment variables are needed to run this plugin.
TESTRAIL_HOST
: URL of your testrail application (example:example.testrail.com
)TESTRAIL_USERNAME
: Username/Email of the accountTESTRAIL_PASSWORD
: PasswordTESTRAIL_RUN_ID
: TestRail test run ID
Decorator case_id
needs to be specified in each test. Test that doesn't have this decorator will be run in the test execution however the result will net be sent.
Example Test test_hello.py:
from unittest import TestCase
from nose_testrail.plugin import case_id
import time
class TestOne(TestCase):
@case_id(1)
def test_pass(self):
time.sleep(4)
self.assertTrue(True)
@case_id(2)
def test_failed(self):
time.sleep(7)
self.assertTrue(False)
To send test result to TestRail option --with-nose-testrail
is required.
nosetests test_hello.py --with-nose-testrail
This plugin will send the following information.
- Test Result: PASS/FAILED
- Comment: If test failed sending traceback
- Elapsed: Duration of each test.