-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #197 from reportportal/develop
Release
- Loading branch information
Showing
13 changed files
with
184 additions
and
74 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
*** Settings *** | ||
Documentation Example of 'Run Keyword And Ignore Error' keyword reporting | ||
*** Variables *** | ||
${countval} 0 | ||
|
||
*** Test Cases *** | ||
Rkie test | ||
Run Keyword And Ignore Error Fail on first try | ||
Fail on first try | ||
|
||
*** Keywords *** | ||
Fail on first try | ||
${counter} Evaluate ${countval} + 1 | ||
Set Suite Variable ${countval} ${counter} | ||
IF ${countval} < 2 | ||
Fail To less executions | ||
END |
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,6 @@ | ||
*** Settings *** | ||
Documentation This is a test suite with URLs: [https://www.google.com | Google] and [https://www.google.com] | ||
*** Test Cases *** | ||
Simple test | ||
Log Hello, world! |
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,40 @@ | ||
# Copyright 2024 EPAM Systems | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""This module contains functions to ease reporting to ReportPortal.""" | ||
|
||
import re | ||
from typing import Iterable, Tuple | ||
|
||
|
||
def replace_patterns(text: str, patterns: Iterable[Tuple[re.Pattern, str]]) -> str: | ||
"""Replace given patterns in the text.""" | ||
result = text | ||
for p, repl in patterns: | ||
result = p.sub(repl, result) | ||
return result | ||
|
||
|
||
BARE_LINK_PATTERN = re.compile(r'\[\s*([^]|]+)]') | ||
NAMED_LINK_PATTERN = re.compile(r'\[\s*([^]|]+)\|\s*([^]]+)]') | ||
|
||
ROBOT_MARKUP_REPLACEMENT_PATTERS = [ | ||
(BARE_LINK_PATTERN, r'<\1>'), | ||
(NAMED_LINK_PATTERN, r'[\2](\1)'), | ||
] | ||
|
||
|
||
def robot_markup_to_markdown(text: str) -> str: | ||
"""Convert Robot Framework's text markup to Markdown format.""" | ||
return replace_patterns(text, ROBOT_MARKUP_REPLACEMENT_PATTERS) |
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
from setuptools import setup | ||
|
||
|
||
__version__ = '5.5.4' | ||
__version__ = '5.5.5' | ||
|
||
|
||
def read_file(fname): | ||
|
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,39 @@ | ||
# Copyright 2023 EPAM Systems | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from unittest import mock | ||
|
||
from tests import REPORT_PORTAL_SERVICE | ||
from tests.helpers import utils | ||
|
||
|
||
@mock.patch(REPORT_PORTAL_SERVICE) | ||
def test_before_after_suite_with_steps(mock_client_init): | ||
mock_client = mock_client_init.return_value | ||
mock_client.start_test_item.side_effect = utils.item_id_gen | ||
|
||
result = utils.run_robot_tests(['examples/rkie_keyword.robot']) | ||
assert result == 0 | ||
|
||
launch_start = mock_client.start_launch.call_args_list | ||
launch_finish = mock_client.finish_launch.call_args_list | ||
assert len(launch_start) == len(launch_finish) == 1 | ||
|
||
item_start_calls = mock_client.start_test_item.call_args_list | ||
item_finish_calls = mock_client.finish_test_item.call_args_list | ||
assert len(item_start_calls) == len(item_finish_calls) == 13 | ||
|
||
statuses = [finish[1]['status'] for finish in item_finish_calls] | ||
assert statuses == ['PASSED'] * 2 + ['FAILED'] * 3 + ['PASSED'] * 3 + [ | ||
'SKIPPED'] * 2 + ['PASSED'] * 3 |
Oops, something went wrong.