Skip to content

Support for robotframework 4.x #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
python: [python38, python39]
rfVersion: [3.1.2, 3.2, 3.2.1, 3.2.2]
rfVersion: ['3.1.2', '3.2', '3.2.1', '3.2.2', '4.0', '4.0.1', '4.0.2', '4.0.3', '4.1']
runs-on: windows-latest
name: Windows (${{ matrix.python }}, robotframework-${{ matrix.rfVersion }})
defaults:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
fail-fast: false
matrix:
python: [python38, python39]
rfVersion: [3.1.2, 3.2, 3.2.1, 3.2.2]
rfVersion: ['3.1.2', '3.2', '3.2.1', '3.2.2', '4.0', '4.0.1', '4.0.2', '4.0.3', '4.1']
runs-on: ubuntu-latest
name: Linux (${{ matrix.python }}, robotframework-${{ matrix.rfVersion }})
steps:
Expand All @@ -80,7 +80,7 @@ jobs:
fail-fast: false
matrix:
python: [python38, python39]
rfVersion: [3.1.2, 3.2, 3.2.1, 3.2.2]
rfVersion: ['3.1.2', '3.2', '3.2.1', '3.2.2', '4.0', '4.0.1', '4.0.2', '4.0.3', '4.1']
runs-on: macos-latest
name: MacOS (${{ matrix.python }}, robotframework-${{ matrix.rfVersion }})
steps:
Expand Down
8 changes: 2 additions & 6 deletions src/oxygen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from .version import VERSION
from .base_handler import BaseHandler
from .oxygen import listener, OxygenLibrary
from .robot_interface import RobotInterface
from .version import VERSION

__all__ = ['BaseHandler', 'listener', 'OxygenLibrary', 'RobotInterface']
__all__ = ['BaseHandler', 'listener', 'OxygenLibrary']
__version__ = VERSION



16 changes: 10 additions & 6 deletions src/oxygen/base_handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import re

from .robot_interface import RobotInterface
from .robot_interface import (RobotInterface, get_keywords_from,
set_special_keyword)


class BaseHandler(object):
DEFAULT_CLI = {tuple(['resultfile']): {}}
Expand Down Expand Up @@ -43,7 +45,9 @@ def check_for_keyword(self, test, data):

test: A Robot test
'''
for curr, keyword in enumerate(test.keywords):
test_keywords = get_keywords_from(test)

for curr, keyword in enumerate(test_keywords):
keyword_name = self._normalize_keyword_name(keyword.name)
if not (keyword_name == self.keyword):
continue
Expand All @@ -52,8 +56,8 @@ def check_for_keyword(self, test, data):
# ALL keywords, setup or not, preceding the trigger will be treated
# as setup keywords later. Same goes for keywords succeeding the
# trigger; they will become teardown keywords.
setup_keywords = test.keywords[:curr]
teardown_keywords = test.keywords[(curr+1):]
setup_keywords = test_keywords[:curr]
teardown_keywords = test_keywords[(curr+1):]

self._report_oxygen_run(keyword, setup_keywords, teardown_keywords)

Expand Down Expand Up @@ -107,10 +111,10 @@ def _build_results(self, keyword, setup_keyword, teardown_keyword):
self._set_suite_tags(result_suite, *(self._tags + list(test.tags)))

if setup_keyword:
result_suite.keywords.append(setup_keyword)
set_special_keyword(result_suite, 'setup', setup_keyword)

if teardown_keyword:
result_suite.keywords.append(teardown_keyword)
set_special_keyword(result_suite, 'teardown', teardown_keyword)

self._inject_suite_report(test, result_suite)

Expand Down
Loading