{"id":15144506,"url":"https://github.com/eficode/robotframework-oxygen","last_synced_at":"2025-04-19T16:12:15.199Z","repository":{"id":44895481,"uuid":"263863465","full_name":"eficode/robotframework-oxygen","owner":"eficode","description":"Oxygen is a Robot Framework tool that empowers the user to convert the results of any testing tool or framework to Robot Framework's reporting to consolidate all test reporting together regardless of tools used.","archived":false,"fork":false,"pushed_at":"2024-06-26T17:22:30.000Z","size":2726,"stargazers_count":28,"open_issues_count":12,"forks_count":8,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-12-13T12:48:36.382Z","etag":null,"topics":["quality-metrics","reporting","robot-framework","robotframework","testing","testing-tools"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eficode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-05-14T08:52:38.000Z","updated_at":"2024-08-22T21:34:09.000Z","dependencies_parsed_at":"2023-10-17T01:58:00.964Z","dependency_job_id":"232bf2a7-4d2e-4b2c-b629-7673ac7caac5","html_url":"https://github.com/eficode/robotframework-oxygen","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eficode%2Frobotframework-oxygen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eficode%2Frobotframework-oxygen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eficode%2Frobotframework-oxygen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eficode%2Frobotframework-oxygen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eficode","download_url":"https://codeload.github.com/eficode/robotframework-oxygen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231248775,"owners_count":18347530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["quality-metrics","reporting","robot-framework","robotframework","testing","testing-tools"],"created_at":"2024-09-26T10:41:50.443Z","updated_at":"2024-12-25T15:08:39.720Z","avatar_url":"https://github.com/eficode.png","language":"Python","readme":"# Oxygen\n\nOxygen is a [Robot Framework](https://robotframework.org/) tool that empowers the user to convert the results of any testing tool or framework to [Robot Framework's reporting](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#screenshots). This consolidates all test reporting together regardless of tools used.\n\nOxygen has built-in support for three testing frameworks: [JUnit](https://junit.org/junit5/), [Gatling](https://gatling.io/), and [Zed Attack Proxy (ZAP)](https://www.zaproxy.org/).\n\nOxygen is designed to be extensible. Users can create their own *handlers* for other testing framework or tools to transform their reporting into the Robot Framework's `log.html` and `report.html`.\n\n# Table of Contents\n1. [Installation](#installation)\n1. [Keyword documentation](#keyword-documentation)\n1. [Usage](#usage)\n1. [Developing Oxygen](#developing-oxygen)\n1. [License](#license)\n1. [Acknowledgements](#acknowledgments)\n\n# Installation\n\nTo install Oxygen, run the following:\n```\n$ pip install robotframework-oxygen\n```\n\n## Pre-requisites\n\n- Oxygen is supported on Windows, Linux and MacOS\n- [Python 3.10](http://python.org) or above\n- [pip](https://pypi.python.org/pypi/pip) for easy installation\n- [Robot Framework](http://robotframework.org)\n- [additional dependencies](requirements.txt)\n\nTo check the Python version on the command line, run:\n```\n$ python --version\n```\n\n# Keyword documentation\n\n[Keyword Documentation](http://eficode.github.io/robotframework-oxygen/)\n\n# Usage\n\n## Example: Robot Framework running other test tools\n\nMain usage scenario for Oxygen is the ability to write acceptance test cases that run your tests in other test tools and integrate the resulting test report as part of Robot Framework's. This means you are able to run all of your testing from Robot Framework and thus having all test reporting consolidated together.\n\nAfter installing Oxygen, it can be used in the Robot Framework suite to write test cases. For example, to build acceptance tests that run different sets of JUnit tests:\n\n``` RobotFramework\n*** Settings ***\nLibrary    oxygen.OxygenLibrary\n\n*** Test cases ***\n\nJUnit unit tests should pass\n    [Tags]    testset-1\n    Run JUnit    path/to/mydir/results.xml    java -jar junit.jar --reports-dir=path/to/mydir\n\nJUnit integration tests should pass\n    [Tags]    testset-2\n    Run JUnit    path/to/anotherdir/results.xml    java -jar junit.jar --reports-dir=path/to/anotherdir\n```\n\nThen, run the suite by providing Oxygen as [a listener](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#listener-interface):\n\n```\n$ robot --listener oxygen.listener my_tests.robot\n```\n\nOpening the Robot Framework `log.html` and `report.html`, you should see that test case `JUnit unt tests should pass` has been replaced by Oxygen with test cases matching with what is in the `path/to/mydir/results.xml` JUnit report file. Similarly, test case `JUnit integration tests should pass` has been replaced with results from `path/to/anotherdir/results.xml`; each JUnit test case with its relevant information has a counterpart in the `log.html`. Each JUnit test case is also tagged with the tags from the original Robot Framework test case.\n\nThe example above, for the brevity, shows incomplete commands to run JUnit tool from command line. Please refer to [keyword documentation](#keyword-documentation) for more detailed documentation about keyword's arguments, as well as documentation for [Gatling](https://gatling.io/) and [ZAP](https://www.zaproxy.org/) related keywords. And, of course, refer to the particular tool documentation as well.\n\n## Using from command line\n\nIn case where you want to run your other testing tools separately, but yet combine results into unified Robot Framework `log.html` and `report.html`, you can use Oxygen's command line interface to convert single result file to single corresponding Robot Framework `output.xml`:\n\n```\n$ python -m oxygen oxygen.junit my_junit_results.xml\n```\n\nAs a convention, the resulting Robot Framework xml file will be named by adding a suffix to the end. In the example above, the resulting Robot Framework xml file would be named `my_junit_results_robot_output.xml`.\n\n**Note** that resulting xml file will also be created at the same location as the original result file. Therefore, when original result files are in another directory:\n\n```\n$ python -m oxygen oxygen.gatling path/to/results.log\n```\n\nThen `results_robot_output.xml` will be created under `path/to/`.\n\n## Extending Oxygen: writing your own handler\n\n### [Read the developer guide on how to write your own handler](DEVGUIDE.md)\n\nYou might also want to look at [specification for handler results](handler_result_specification.md)\n\n### Configuring your handler to Oxygen\n\nOxygen knows about different handlers based on the [`config.yml`](https://github.com/eficode/robotframework-oxygen/blob/master/config.yml) file. This configuration file can be interacted with through Oxygen's command line.\n\nThe configuration has the following parts:\n```yml\noxygen.junit:           # Python module. Oxygen will use this key to try to import the handler\n  handler: JUnitHandler # Class that Oxygen will initiate after the handler is imported\n  keyword: run_junit    # Keyword that should be used to run the other test tool\n  tags:                 # List of tags that by default should be added to the test cases converted with this handler\n    - oxygen-junit\noxygen.zap:\n  handler: ZAProxyHandler\n  keyword: run_zap\n  tags: oxygen-zap\n  accepted_risk_level: 2         # Handlers can have their own command line arguments\n  required_confidence_level: 1   # See https://github.com/eficode/robotframework-oxygen/blob/master/DEVGUIDE.md for more information\n```\n\n#### `--add-config`\n\nThis argument is used to add new handler configuration to Oxygen:\n\n```bash\n$ python -m oxygen --add-config path/to/your_handler_config.yml\n```\n\nThis file is read and appended to the Oxygen's `config.yml`. Based on the key, Oxygen will try to import you handler.\n\n### `--reset-config`\n\nThis argument is used to return Oxygen's `config.yml` back to the state it was when the tool was installed:\n\n```bash\n$ python -m oxygen --reset-config\n```\n\nThe command **does not** verify the operation from the user, so be careful.\n\n### `--print-config`\n\nThis argument prints the current configuration of Oxygen:\n```bash\n$ python -m oxygen --print-config\nUsing config file: /path/to/oxygen/src/oxygen/config.yml\noxygen.gatling:\n  handler: GatlingHandler\n  keyword: run_gatling\n  tags: oxygen-gatling\noxygen.junit:\n  handler: JUnitHandler\n  keyword: run_junit\n  tags:\n  - oxygen-junit\noxygen.zap:\n  accepted_risk_level: 2\n  handler: ZAProxyHandler\n  keyword: run_zap\n  required_confidence_level: 1\n  tags: oxygen-zap\n\n$\n```\nBecause you can add the configuration to the same handler multiple times, note that only the last entry is in effect.\n\n## `utils` module\n\nIn [utils module](https://github.com/eficode/robotframework-oxygen/blob/master/src/oxygen/utils.py), you will find assortment of functionalities that you might want to leverage when writing your own handler.\n\n### `run_command_line()`\n\nMost of the time, handlers want to run the other test tool through command line. For this, `utils` provides `run_command_line()` that wraps Python's [`subprocess`](https://docs.python.org/3/library/subprocess.html) module for more easier to use when writing your handler.\n\n`run_command_line()` takes following arguments:\n- `cmd`: the command to be executed in a subprocess\n- `check_return_code`: if set to `True`, will raise an exception if the `cmd` fails in the subprocess. **Note** that this fails the keyword and, thus, the execution of the test case is stopped. If you want to enable test case to continue even after `run_command_line()` has failed, you should disable it by setting `False`. It is often a good idea to allow user using your handler's keyword to decide how they want the command line execution to affect the test case\n- `env`: a dictionary of environment variables that should be passed to the subprocess. By default, `run_command_line()` inherits the environment from the current Python process as well as from modifications done by the Robot Framework command line arguments (ie. `--pythonpath`)\n\n# Developing Oxygen\n\nClone the Oxygen repository to the environment where you want to the run the tool.\n\nOxygen requires a set of dependencies to be installed. Dependencies are listed in the `requirements.txt` file:\n```\n$ pip install -r requirements.txt\n```\n\nOxygen uses task runner tool [`invoke`](http://www.pyinvoke.org/) to run tests, build the project, etc.\n\nPlease refer to the available tasks for the project:\n```\n$ invoke --list\n```\n\nand the task file [`tasks.py`](https://github.com/eficode/robotframework-oxygen/blob/master/tasks.py).\n\n\n# License\n\nDetails of project licensing can be found in the [LICENSE](LICENSE) file in the project repository.\n\n# Acknowledgments\n\nOxygen tool was developed by Eficode Oy as part of [Testomat project](https://www.testomatproject.eu/) with funding by [Business Finland](https://www.businessfinland.fi/).\n","funding_links":[],"categories":["Integrations and Examples"],"sub_categories":["Integrations"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feficode%2Frobotframework-oxygen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feficode%2Frobotframework-oxygen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feficode%2Frobotframework-oxygen/lists"}