Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
add codacy badge, README fixes (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
allankp authored Oct 26, 2019
1 parent affe9a6 commit 3c98c68
Showing 1 changed file with 31 additions and 32 deletions.
63 changes: 31 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pytest-testrail
[![Build Status](https://travis-ci.org/allankp/pytest-testrail.svg?branch=master)](https://travis-ci.org/allankp/pytest-testrail)
[![PyPI version](https://badge.fury.io/py/pytest-testrail.svg)](https://badge.fury.io/py/pytest-testrail)
[![Downloads](https://pepy.tech/badge/pytest-testrail)](https://pepy.tech/project/pytest-testrail)

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/83b960043527429a8310cced2d8defcb)](https://www.codacy.com/manual/allankp/pytest-testrail?utm_source=github.com&utm_medium=referral&utm_content=allankp/pytest-testrail&utm_campaign=Badge_Grade)

This is a pytest plugin for creating/editing testplans or testruns based on pytest markers.
The results of the collected tests will be updated against the testplan/testrun in TestRail.
Expand All @@ -14,7 +14,6 @@ Installation

pip install pytest-testrail


Configuration
-------------

Expand All @@ -23,51 +22,51 @@ Configuration
Add a marker to the tests that will be picked up to be added to the run.

```python
from pytest_testrail.plugin import testrail
from pytest_testrail.plugin import testrail

@testrail('C1234', 'C5678')
def test_foo():
# test code goes here
@testrail('C1234', 'C5678')
def test_foo():
# test code goes here

# OR
# OR

from pytest_testrail.plugin import pytestrail
from pytest_testrail.plugin import pytestrail

@pytestrail.case('C1234', 'C5678')
def test_bar():
# test code goes here
@pytestrail.case('C1234', 'C5678')
def test_bar():
# test code goes here
```

Or if you want to add defects to testcase result:

```python

from pytest_testrail.plugin import pytestrail
from pytest_testrail.plugin import pytestrail

@pytestrail.defect('PF-524', 'BR-543')
def test_bar():
# test code goes here
@pytestrail.defect('PF-524', 'BR-543')
def test_bar():
# test code goes here
```

### Config for TestRail

* Settings file template config:

```ini
[API]
url = https://yoururl.testrail.net/
email = [email protected]
password = <api_key>

[TESTRUN]
assignedto_id = 1
project_id = 2
suite_id = 3
plan_id = 4
description = 'This is an example description'

[TESTCASE]
custom_comment = 'This is a custom comment'
[API]
url = https://yoururl.testrail.net/
email = [email protected]
password = <api_key>

[TESTRUN]
assignedto_id = 1
project_id = 2
suite_id = 3
plan_id = 4
description = 'This is an example description'

[TESTCASE]
custom_comment = 'This is a custom comment'
```

Or
Expand All @@ -81,7 +80,7 @@ Basically, the following command will create a testrun in TestRail, add all mark
Once the all tests are finished they will be updated in TestRail:

```bash
py.test --testrail --tr-config=<settings file>.cfg
py.test --testrail --tr-config=<settings file>.cfg
```

### All available options
Expand All @@ -106,5 +105,5 @@ py.test --testrail --tr-config=<settings file>.cfg
| --tr-close-on-complete | Close a test plan or test run on completion. |
| --tr-dont-publish-blocked | Do not publish results of "blocked" testcases in TestRail |
| --tr-skip-missing | Skip test cases that are not present in testrun |
| --tr-milestone-id | Identifier of milestone to be assigned to run |
| --tc-custom-comment | Custom comment, to be appended to default comment for test case (config file: custom_comment in TESTCASE section) |
| --tr-milestone-id | Identifier of milestone to be assigned to run |
| --tc-custom-comment | Custom comment, to be appended to default comment for test case (config file: custom_comment in TESTCASE section) |

0 comments on commit 3c98c68

Please sign in to comment.