The Generic Dictionary provides built-in Cucumber steps for comparing two values (equality, inequality, contains, numeric greater/smaller). It is always available on the glue path — no Spring profile, bean, or wiring is required.
Available since version: 3.0.4 (the not equals / not contains comparison types were added later, in version 3.0.8)
How to use it: just write the sentences below in your feature file — no setup needed, in any dictionary profile (UI, API, web, ...).
Then:
| Key Sentence | Type | Description | Example |
|---|---|---|---|
user should be the {string} value {compareType} the {string} value |
Assertion | Compares the two values. Fails the test if the comparison is false. | Then user should be the "{{ACTUAL_AMOUNT}}" value equals the "1000" value |
if the {string} value {compareType} the {string} value |
Conditional | Checks the comparison but does not fail the test. If the comparison is false, the following steps in the scenario are skipped (conditional execution). | Then if the "{{STATUS}}" value equals the "approved" value |
{compareType} — allowed values:
| Value | Behaviour |
|---|---|
equals |
String equality; if both values are numeric, compared as numbers instead |
not equals |
Negation of equals |
contains |
The first value contains the second value as a substring |
not contains |
Negation of contains |
greater then |
Numeric comparison — both values must be numeric, or the step throws an error |
smaller then |
Numeric comparison — both values must be numeric, or the step throws an error |
Examples
# Assert equality (fails the scenario if not equal)
Then user should be the "{{SAVED_VALUE}}" value equals the "{{EXPECTED_VALUE}}" value
# Assert inequality
Then user should be the "{{SEGMENTREPORTID_AFTER}}" value not equals the "{{SEGMENTREPORTID_BEFORE}}" value
# Assert numeric greater than
Then user should be the "{{ACTUAL_AMOUNT}}" value greater then the "1000" value
# Assert string contains
Then user should be the "{{FULL_NAME}}" value contains the "John" value
# Conditional check - does not fail the scenario, only skips later steps if false
Then if the "{{STATUS}}" value equals the "approved" value
Notes
greater thenandsmaller thenparse both values as numbers (Double) — if either value is not numeric, the step throws an error.- Values passed as
{string}support{{variable}}-style substitution from the Store, same as other dictionaries. - Use these built-in steps instead of writing custom
equals/contains/greater thanassertions in a project-specific dictionary — they are already wired and cover the standard comparison cases.