Robot Framework

pip install tracera-robot

Requires Python ≥ 3.11 and Robot Framework ≥ 7 (see Autotest adapters). tracera-robot on PyPI.

Register the listener:

robot --listener tracera_robot.listener.TraceraListener suite.robot

Optional companion library for comment, error, attachment, Tracera Step, and Tracera Test Case:

*** Settings ***
Library    tracera_robot.keywords.TraceraKeywords

Environment variables and run mode: Autotest adapters.

Bind testCaseId and autotestName

Prefer tags on the test.

*** Test Cases ***
Login
    [Tags]    tracera.id:42    tracera.name:e2e/login
    Log    hello

URL-encode spaces and special characters in tracera.name when needed (e2e%2Flogin). If tracera.name is omitted, autotestName takes the value of the Robot test name.

Skip

Use stock Robot Skip. The skip reason is added to the result as comment.

*** Test Cases ***
Login
    [Tags]    tracera.id:42    tracera.name:e2e/login
    Skip    env not ready — https://example.com/skip

Steps

Keywords in the test become steps under the result’s Test section. Test Setup and Test Teardown map to the result’s Setup and Teardown; Suite Setup and Suite Teardown are not reported.

*** Settings ***
Test Setup       Open Shop
Test Teardown    Cleanup

*** Keywords ***
Open Shop
    Log    opening

Add To Cart
    Log    adding

Cleanup
    Log    done

*** Test Cases ***
Checkout
    [Tags]    tracera.id:10    tracera.name:e2e/checkout
    Add To Cart

By default the step title is the keyword name (Add To Cart). For a different title:

*** Settings ***
Library    tracera_robot.keywords.TraceraKeywords

*** Test Cases ***
Checkout
    [Tags]    tracera.id:10
    Tracera Step    add sku-1    Add To Cart

That runs Add To Cart; the step title in the result is add sku-1.

Python helpers can also use tracera.step or @tracera.step("…") from core.

Also reported: FOR, IF, WHILE, TRY, ELSE, EXCEPT, and FINALLY (not loop iterations). Calls from TraceraKeywords are not reported as steps.

Comments, errors, and attachments

Comments, errors, and attachments: Autotest adapters.

*** Settings ***
Library    tracera_robot.keywords.TraceraKeywords

*** Keywords ***
Open Login
    Tracera Comment    landed on login
    Tracera Attach Text    suite-log.txt    finished login flow

*** Test Cases ***
Login
    [Tags]    tracera.id:42    tracera.name:e2e/login
    Tracera Comment    result-level note
    Tracera Error    result-level error text
    Open Login

Attach a file with Tracera Attach File ${path} image/png.

Parameterized tests

With Robot [Template], [Tags] on the test apply to every argument line under the template:

*** Test Cases ***
Login row
    [Tags]    tracera.id:42    tracera.name:e2e/login
    [Template]    Open Path
    /login
    /login/sso

*** Keywords ***
Open Path
    [Arguments]    ${path}
    Log    ${path}

For a different case id per argument line, use a separate test with its own [Tags] (as in Bind).