-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add Robot Framework project with examples
- Loading branch information
Showing
7 changed files
with
182 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Examples | ||
|
||
This directory contains examples of how to use the `qase-pytest`. | ||
This directory contains examples of how to use the Qase Python reporters. | ||
|
||
- [pytest](./pytest/README.md) - Examples written in Pytest. Can be used with `pytest-xdist` library. | ||
- [behave](./behave/README.md) - Examples written in Behave. | ||
- [robot](./robot/README.md) - Examples written in Robot Framework. Can be used with `pabot` library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# How to run these examples | ||
|
||
1. Clone the repository | ||
|
||
```bash | ||
git clone https://github.com/qase-tms/qase-python.git | ||
``` | ||
|
||
2. Move to the directory with the examples | ||
|
||
```bash | ||
cd qase-python/examples/robot | ||
``` | ||
|
||
3. Install the required packages | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
4. Add the Qase token and project code to the ENV variables | ||
|
||
```bash | ||
export QASE_MODE=testops | ||
export QASE_TESTOPS_API_TOKEN=your_token | ||
export QASE_TESTOPS_PROJECT=your_project_code | ||
``` | ||
|
||
5. Run the tests | ||
|
||
```bash | ||
robot --listener qase.robotframework.Listener . | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"mode": "testops", | ||
"fallback": "off", | ||
"debug": true, | ||
"testops": { | ||
"project": "<project_code>", | ||
"api": { | ||
"token": "<token>", | ||
"host": "qase.io" | ||
}, | ||
"run": { | ||
"title": "robot framework examples" | ||
}, | ||
"batch": { | ||
"size": 200 | ||
} | ||
}, | ||
"report": { | ||
"driver": "local", | ||
"connection": { | ||
"local": { | ||
"path": "./build/qase-report", | ||
"format": "json" | ||
} | ||
} | ||
}, | ||
"environment": "local" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
robotframework==7.1.1 | ||
qase-robotframework==3.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
*** Settings *** | ||
Library steps.py | ||
|
||
*** Variables *** | ||
${var1} 1 | ||
${var2} 1 | ||
${var3} 2 | ||
|
||
*** Test Cases *** | ||
Parametrized Test success | ||
[Tags] qase.params:[var1, var2] | ||
Check numbers ${var1} ${var2} ${var3} | ||
Passed Step | ||
|
||
Parametrized Test failed | ||
[Tags] qase.params:[var1, var2] | ||
Check numbers ${var1} ${var2} ${var3} | ||
Failed Step | ||
|
||
|
||
*** Keywords *** | ||
Check numbers | ||
[Arguments] ${var1} ${var2} ${var3} | ||
Should Be Equal As Numbers ${var1} ${var2} | ||
Should Be Equal As Numbers ${var3} ${var3} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
*** Settings *** | ||
Library steps.py | ||
|
||
*** Test Cases *** | ||
|
||
Test without metadata success | ||
Step 01 | ||
Step 02 | ||
Passed step | ||
|
||
Test without metadata failed | ||
Step 01 | ||
Step 02 | ||
Failed Step | ||
|
||
|
||
Test with QaseID success | ||
[Tags] Q-10 | ||
Step 01 | ||
Step 02 | ||
Passed step | ||
|
||
|
||
Test with QaseID failed | ||
[Tags] Q-11 | ||
Step 01 | ||
Step 02 | ||
Failed Step | ||
|
||
|
||
Ignored test success | ||
[Tags] qase.ignore | ||
Step 01 | ||
Step 02 | ||
Passed step | ||
|
||
|
||
Ignored test failed | ||
[Tags] qase.ignore | ||
Step 01 | ||
Step 02 | ||
Failed Step | ||
|
||
|
||
Test with fields success | ||
[Tags] qase.fields:{ "preconditions": "Create object", "description": "It is simple test" } | ||
Step 01 | ||
Step 02 | ||
Passed step | ||
|
||
|
||
Test with fields failed | ||
[Tags] qase.fields:{ "preconditions": "Create object", "description": "It is simple test" } | ||
Step 01 | ||
Step 02 | ||
Failed Step | ||
|
||
|
||
Test with all metadata success | ||
[Tags] Q-12 qase.fields:{ "preconditions": "Create object", "description": "It is simple test" } | ||
Step 01 | ||
Step 02 | ||
Passed step | ||
|
||
|
||
Test with all metadata failed | ||
[Tags] Q-13 qase.fields:{ "preconditions": "Create object", "description": "It is simple test" } | ||
Step 01 | ||
Step 02 | ||
Failed Step |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from robot.api.deco import keyword | ||
|
||
|
||
@keyword("Step 01") | ||
def step01(): | ||
pass | ||
|
||
|
||
@keyword("Step 02") | ||
def step02(): | ||
pass | ||
|
||
|
||
@keyword("Passed step") | ||
def passed_step(): | ||
pass | ||
|
||
|
||
@keyword("Failed step") | ||
def failed_step(): | ||
assert False |