Skip to main content

robotframework-allurevisitor

PyPI version Python versions License: Apache-2.0

Generate Allure results from Robot Framework, for Allure 2 and Allure 3. Two entry points share one Robot → Allure mapping and write the same *-result.json / *-container.json / *-attachment.* files via the official allure-python-commons engine:

  • rf-allure post-processes an existing output.xml (from CI, a rerun, or a pabot run) — no re-run needed.
  • robotframework_allurevisitor.Listener writes results during a run and also records runtime-only data (allure.attach, allure.dynamic.*, allure.step). It replaces the allure-robotframework listener; see the migration guide.

Installation

pip install robotframework-allurevisitor

This installs the rf-allure console script (with allurevisitor as an alias). Rendering the report additionally requires an Allure report generator — either Allure 3 (npm install -g allure, needs Node) or Allure 2 (npm install -g allure-commandline, needs Node and Java). Both are tested.

Requirements

  • Python >=3.13
  • uv for working on the project from source

From source

uv sync

Usage

Command line (rf-allure, with allurevisitor as an alias):

uv run rf-allure path/to/output.xml -o allure-results --clean

Then render the report with either generator:

# Allure 3
npx allure generate allure-results -o allure-report
npx allure open allure-report

# Allure 2
npx allure-commandline generate --clean -o allure-report allure-results
npx allure-commandline open allure-report

Programmatic:

from robotframework_allurevisitor import generate

generate("output.xml", "allure-results", clean=True)

Live listener

robot --listener robotframework_allurevisitor.Listener tests/           # -> output/allure
robot --listener robotframework_allurevisitor.Listener:build/allure tests/

Options follow the directory as name=value: clean=True empties the directory first; broken_heuristic=True reports library/syntax/import/timeout failures as broken. With the listener active, Python libraries can use the allure API and suites can use the keyword library:

*** Settings ***
Library    robotframework_allurevisitor.AllureLibrary

*** Test Cases ***
Example
    Attach         some text    name=note    attachment_type=TEXT
    Attach File    ${OUTPUT DIR}/data.json    attachment_type=JSON

Select tests from an Allure test plan with ALLURE_TESTPLAN_PATH=plan.json robot --prerunmodifier robotframework_allurevisitor.testplan …. Coming from allure-robotframework? See the migration guide.

CLI options

Option Description
sources One or more output.xml files or globs (positional).
-o, --output Results directory (default allure-results).
--clean Remove existing files in the results directory first.
--merge Merge the sources like rebot --merge (last wins) into one result per test; without it, repeated tests become retries. See re-execution.
--thread Thread label, e.g. a pabot worker id (drives the Timeline view).
--issue-pattern Pattern turning issue tags into Allure issue links.
--link-pattern Pattern turning link tags into Allure links.
--broken-heuristic Report library/syntax/import/timeout failures as broken instead of failed.
--environment KEY=VALUE Environment entry shown in the report (repeatable); writes environment.properties.
--executor JSON Executor info (inline JSON or a JSON file path); writes executor.json.

The same options are keyword arguments of generate() (merge=True, broken_heuristic=True, environment={...}, executor={...}).

What gets converted

The output matches the official allure-robotframework listener wherever the difference would only be presentation, so reports look the same as with the listener.

  • Suites → containers, with Suite Setup/Teardown as the container's befores/afters. Each test also gets its own container carrying the test's [Setup]/[Teardown], so both show up as Set up / Tear down.
  • Tests → results, with parentSuite/suite/subSuite labels from the test full name (same rules as the listener), framework/language/host (and optional thread) labels, and a stable historyId = md5(full_name).
  • Tags → labels and links via allure_commons.mapping.parse_tag: allure.label.<name>:…, allure.epic|feature|story|severity|id:…, allure.issue|tms|link:…, bare severities (critical, …), plus the legacy issue:[name]url, tms:[name]url, and link:[name]url forms. Other tags become tag labels; a skipped tag forces status skipped.
  • Keywords and control structures (FOR/IF/WHILE/TRY/GROUP/VAR/…) → nested steps, with keyword assignment in the step name and arguments as step parameters arg1..N.
  • Status: PASS→passed, SKIP/NOT RUN/NOT SET→skipped, FAIL→failed. With --broken-heuristic, library/import/syntax/timeout errors → broken.
  • Timestamps come from the result data (epoch ms), never wall-clock, so conversion is reproducible.
  • Log messages → one Keyword Log HTML attachment per step (FAIL/ERROR in red; plain-text messages are HTML-escaped). Set ALLURE_MAX_STEP_MESSAGE_COUNT=N to show steps with at most N messages as message sub-steps instead.
  • Screenshots embedded in log messages (<img src=…>, e.g. from SeleniumLibrary or Browser) → image attachments, resolved relative to the output.xml folder.
  • Playwright traces from robotframework-browser (New Context tracing=True) → trace attachments (application/vnd.allure.playwright-trace) that open in the Playwright Trace Viewer from Allure 2 (2.35+) and Allure 3. Traces are found from Browser's trace file will be saved to: … log message and attached to the keyword or setup that opened the context — including contexts opened in Suite Setup. If the run's output folder was moved (e.g. a downloaded CI artifact), traces are looked up in browser/traces/ next to output.xml.

What cannot be converted

output.xml only contains what Robot Framework logged. These features happen at runtime, so only the live listener records them; rf-allure cannot recover them from output.xml:

  • AllureLibrary keywords (Attach, Attach File, Global Attach, …) and allure.attach(...) / allure.attach.file(...) from Python libraries;
  • allure.dynamic.* (labels, links, title, description) and @allure.step / with allure.step(...) from Python code;
  • test-plan filtering (ALLURE_TESTPLAN_PATH), which changes what runs.

Anything a library logs (screenshots, links, HTML) is converted.

Changes in 0.2.0

0.2.0 aligns the output with allure-robotframework and changes some results compared with 0.1.0: test setup/teardown are fixtures instead of steps, log messages are aggregated per step, step parameters are arg1..N instead of arg0..N, deep suite hierarchies label like the listener, and failures are failed unless --broken-heuristic is given. See CHANGELOG.md.

Parallel runs and re-execution

These workflows are tested end to end with robotframework-browser screenshots and Playwright traces, on Allure 2 and Allure 3, for both the converter and the listener.

Constraints these workflows depend on:

  • Rerun into its own --outputdir. Browser deletes browser/ (screenshots, traces) in its output directory at the start of every run, so a rerun into the same directory destroys the first run's artifacts.
  • Run pabot with --artifactsinsubfolders when you convert its output. Without it, pabot's merged output.xml points at screenshots that stay in pabot_results/<n>/, and Robot's log.html breaks the same way. The converter warns about every screenshot it cannot find. Traces are found either way.
  • Merge with rf-allure --merge, not rebot --merge. A rebot-merged file cannot say which run's directory a relative screenshot path belongs to. Both runs use the same file names, so the converter warns for every re-executed test.

pabot

# Listener: every process writes to one results directory, with a thread label per process.
pabot --listener robotframework_allurevisitor.Listener:allure-results tests/

# Converter
pabot --artifacts png,zip --artifactsinsubfolders --outputdir out tests/
rf-allure out/output.xml -o allure-results --clean

Re-executing failed tests

robot --outputdir out tests/
robot --rerunfailed out/output.xml --outputdir out/rerun tests/

The tests that failed in out/ and passed in out/rerun/ can be reported in two ways:

# Retries (recommended): every attempt is kept. Allure shows the latest attempt and
# lists the earlier ones as retries. historyId matches a single run, so history works.
rf-allure out/output.xml out/rerun/output.xml -o allure-results --clean

# Merged: one result per test, last wins, like `rebot --merge`, but each test keeps
# the screenshots and traces of the run it came from.
rf-allure --merge out/output.xml out/rerun/output.xml -o allure-results --clean

With the listener, pass the same results directory to both runs (and no clean=True). The attempts appear as retries:

robot --listener robotframework_allurevisitor.Listener:allure-results --outputdir out tests/
robot --listener robotframework_allurevisitor.Listener:allure-results \
      --rerunfailed out/output.xml --outputdir out/rerun tests/

A file merged by rebot --merge converts too: the merge note becomes plain text. It is still better to give rf-allure the original outputs, because of the screenshot paths described above.

pabot and re-execution together

pabot --artifacts png,zip --artifactsinsubfolders --outputdir out tests/
pabot --artifacts png,zip --artifactsinsubfolders \
      --rerunfailed out/output.xml --outputdir out/rerun tests/
rf-allure out/output.xml out/rerun/output.xml -o allure-results --clean           # retries
rf-allure --merge out/output.xml out/rerun/output.xml -o allure-results --clean   # merged

The listener works the same way: give both pabot runs the same --listener robotframework_allurevisitor.Listener:allure-results.

Each source is converted on its own, so a test's name, suite labels, and historyId are the same whether a file is converted alone or with others. Converting each pabot worker's own pabot_results/<n>/output.xml with a distinct --thread also works. Never convert both the worker files and the merged file into one results directory: the same tests would be counted twice.

History and categories: Allure 2 vs Allure 3

Both generators read the same results; they differ in how trends and categories are configured. The stable historyId/testCaseId this tool writes is what lets either one link runs together.

  • Allure 2: copy the previous report's history/ directory into allure-results before allure generate. Categories come from a categories.json file in allure-results.
  • Allure 3: history is a file configured in allurerc.mjs and appended on every generate; categories are also configured there (a categories.json in the results is ignored by the default report).
// allurerc.mjs (Allure 3)
export default {
  name: "Robot Framework",
  historyPath: "./history.jsonl",
};

Development

uv run pytest          # tests
uv run ruff check .    # lint
uv run ruff format .   # format

End-to-end tests

The e2e tests run the whole pipeline — Robot Framework → the packaged rf-allure CLI → real reports from both Allure 2 and Allure 3 — and check each report's own data (Allure 2: widgets/summary.json, data/test-cases/; Allure 3: summary.json, data/test-results/): status counts, labels, links, description, fixtures, steps, screenshots, Keyword Log, and environment.

uv run pytest -m e2e          # only the end-to-end tests
uv run pytest -m "not e2e"    # skip them (hermetic fast lane)

Generators are resolved per major version: an allure executable on PATH of that version, else npx allure (Allure 3, needs Node) or npx allure-commandline (Allure 2, needs Node and Java). Versions are pinned via ALLURE3_VERSION / ALLURE2_VERSION (defaults 3.20.1 / 2.46.1). An unavailable generator skips its tests; a generator that runs but fails fails them. CI sets ALLURE_REQUIRE_GENERATORS=1 so an unavailable generator fails as well.

The browser tests run real robotframework-browser suites with tracing and screenshots, under pabot, with re-execution, and with both, and check each attempt's screenshots and traces in both reports, for both the converter and the listener. They need the optional dependency group (Browser and pabot):

uv sync --group browser
uv run --group browser rfbrowser init chromium
uv run --group browser pytest -m browser

See AGENTS.md for architecture and contribution notes.

Metadata

Release files for robotframework-allurevisitor 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robotframework-allurevisitor 0.4.0
File Size Uploaded Provenance Actions
robotframework_allurevisitor-0.4.0.tar.gz 160.5 kB Without provenance Details for robotframework_allurevisitor-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for robotframework-allurevisitor 0.4.0
File Interpreter ABI Platform Actions
robotframework_allurevisitor-0.4.0-py3-none-any.whl Python 3 none any Details for robotframework_allurevisitor-0.4.0-py3-none-any.whl

Total release size: 193.5 kB

Release files / robotframework_allurevisitor-0.4.0.tar.gz

Download URL robotframework_allurevisitor-0.4.0.tar.gz
Size 160.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7618c85f40b0e6ee6b4d3cbcdc4816edf6b7fb8fed2b7736f509f530a056b8ca
BLAKE2b-256 checksum
How to use checksums
c8398f28efc3eaec3e96cd2c49c52c88629891e5a6cb7250f11e9166ed17cf1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / robotframework_allurevisitor-0.4.0-py3-none-any.whl

Download URL robotframework_allurevisitor-0.4.0-py3-none-any.whl
Size 33.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93910c1d6f067975f2e9332da099342b5eedfdefa9ad62cb5da9e7608bdd4b71
BLAKE2b-256 checksum
How to use checksums
ed4d03b605b62df4d70c21f8250371ea538282d1da488fab70faaecb9f7b1b75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for robotframework-allurevisitor 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page