-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5923e5c
commit 524beb8
Showing
10 changed files
with
103 additions
and
21 deletions.
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
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
.. code:: robotframework | ||
*** Settings *** | ||
Force Tags epic:Tag | ||
Force Tags allure.epic:Tag |
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
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 @@ | ||
|
||
.. code:: robotframework | ||
*** Test Cases *** | ||
First testcase | ||
No Operation | ||
Second testcase | ||
No Operation | ||
.. code:: robotframework | ||
*** Test Cases *** | ||
Test case with allure id | ||
[Tags] allure.id=123 | ||
No Operation | ||
One more case with allure id | ||
[Tags] allure.id=777 | ||
No Operation |
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,3 +1,4 @@ | ||
from allure_robotframework.robot_listener import allure_robotframework | ||
from allure_robotframework.allure_testplan import allure_testplan as testplan | ||
|
||
__all__ = ['allure_robotframework'] | ||
__all__ = ['allure_robotframework', "testplan"] |
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
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,27 @@ | ||
from robot.api import SuiteVisitor | ||
from allure_commons.utils import get_testplan | ||
from allure_robotframework.utils import allure_labels | ||
from allure_commons.types import LabelType | ||
|
||
|
||
# noinspection PyPep8Naming | ||
class allure_testplan(SuiteVisitor): | ||
def __init__(self): | ||
self.testplan = get_testplan() | ||
|
||
def start_suite(self, suite): | ||
if self.testplan: | ||
# included_tests = [test["selector"] for test in self.testplan] | ||
suite.filter(included_tests=self.included_tests(suite)) | ||
|
||
def included_tests(self, suite): | ||
included_tests = [""] | ||
for test in suite.tests: | ||
allure_id = None | ||
for label in allure_labels(test.tags): | ||
if label.name == LabelType.ID: | ||
allure_id = str(label.value) | ||
if allure_id and any([allure_id == item.get("id", None) for item in self.testplan]): | ||
included_tests.append(test.name) | ||
|
||
return included_tests or [test["selector"] for test in self.testplan] |
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
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
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,16 @@ | ||
*** Settings *** | ||
Library ../run_robot_library.py | ||
Library ../test_allure_library.py | ||
|
||
|
||
*** Variables ** | ||
${PLAN_A} \{ | ||
... "version":"1.0", | ||
... "tests": [ | ||
... { "id": "123", "selector": "Second testcase"} | ||
... ] | ||
... \} | ||
|
||
*** Test Case *** | ||
Failed Test Case With Message | ||
${allure_report} Run Robot With Allure examples/testplan/testplan.rst testplan=${PLAN_A} |