Skip to content
Novus Examples
robot1.2 KB

Robot Framework — Checkout Suite

A complete Robot Framework suite with all four common sections, scalar, list and dictionary variables, a continued line using ..., and user keywords with arguments. Robot separates arguments on two or more spaces, so a parser splitting on a single space merges every keyword call into one token.

Preview — first 44 linesrobot
*** Settings ***
Documentation     Checkout totals for the Novus Checkout Service, a fictional shop.
Library           CartLibrary
Library           Collections
Suite Setup       Start Sample Service
Suite Teardown    Stop Sample Service
Test Timeout      30 seconds

*** Variables ***
${BASE URL}       https://www.example.com
${TAX RATE}       20
@{SKUS}           NX-1042    NX-2087
&{PRICES}         NX-1042=12.99    NX-2087=4.50

*** Test Cases ***
Applies The Unit Price
    [Documentation]    A single item shows its own price as the subtotal.
    [Tags]    pricing    smoke
    Empty The Cart
    Add To Cart    NX-1042    1
    Subtotal Should Be    12.99

Applies Tax To The Subtotal
    [Tags]    pricing
    Empty The Cart
    Add To Cart    NX-1042    1
    Tax Should Be    2.60
    Total Should Be    15.59

Rejects A Negative Quantity
    [Tags]    pricing    validation
    Empty The Cart
    Run Keyword And Expect Error    ValueError: quantity must be positive
    ...    Add To Cart    NX-1042    -1

*** Keywords ***
Empty The Cart
    Remove All Items

Subtotal Should Be
    [Arguments]    ${expected}
    ${actual} =    Get Subtotal
    Should Be Equal As Numbers    ${actual}    ${expected}

Specifications

Seed
61200
Encoding
UTF-8
Line Endings
LF
Syntax
space-separated plain text
Sections
4
Test Cases
3
Keywords
2
Libraries
2
Variables
4
Argument Separator
four spaces
Has Continuation
true
Has Suite Setup
true

Testing contract

Expected to pass
Scenario
Parse a Robot Framework suite into tests, keywords and variables.
Expected result
3 test cases and 2 user keywords are found, ${TAX RATE} resolves to 20, and the ... line is joined to the keyword call above it rather than read as a fourth test.

What is a .robot file?

A .robot file is a Robot Framework test suite written in the framework's plain-text tabular syntax. Sections introduced by headers such as *** Settings ***, *** Variables ***, *** Test Cases ***, and *** Keywords *** hold library imports, variable definitions, keyword-driven test cases, and user-defined keywords, with arguments separated by two or more spaces. Tags, documentation, setup, and teardown are declared inline as settings.

How to use this file

Use an example .robot file to test Robot Framework parsers, linters, and editor tooling — checking section handling, the two-space argument separator, variable substitution, and keyword resolution against a suite whose structure is documented.

How to use this file for testing

“Robot Framework — Checkout Suite” is a deterministic Novus Examples fixture for Code parsing, Editor testing, Conversion testing. Short, known-correct source files in many languages with classes, functions, generics, enums, and error handling — for testing parsers, linters, formatters, language detection, and diff viewers.

Documented properties for this file: seed 61200 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Test and coverage reports document their totals (suites, cases, passes, failures, skips, covered lines) in the spec table. Point your CI dashboard, coverage gate, or report converter at the file and assert those counts survive; format twins carry identical numbers so a conversion can be scored exactly.

Generated by generation/testing.py. Free for any use, no attribution required — license.