A VS Code extension for editing and running .feature files in projects
using Toolium or Toolium Telefónica.
For more about the framework, see the Toolium documentation
and the Toolium package on PyPI.
Install the extension
Download the .vsix from GitHub Releases.
Development builds are available through the
VSIX build instructions.
In VS Code, run Extensions: Install from VSIX... from the Command Palette
and select the downloaded file. If you installed a development build packaged
without a publisher, uninstall that copy before installing this one.
The extension requires VS Code 1.95 or later and registers .feature files
as Gherkin. If another extension assigns a different language, select
Gherkin in the status bar or set "files.associations": { "*.feature": "gherkin" }
in your settings.
Edit Gherkin features
The extension highlights Gherkin syntax and supports line comments, section folding,
and navigation in the Outline view. Syntax validation uses the dialect specified
by # language and defaults to English.
Run Toolium Cucumber: Find by Tag in This Feature to jump to a
section with a matching declared or inherited tag. The extension marks tags with
placeholders, such as @record:<figure>, as errors on regular scenarios.
The feature-level @US. tag is checked against concrete acceptance tags such
as @jira.ac.ORBIT-12#AC1,AC2. Use Update feature @US tag from the Quick Fix
menu to add missing story keys, remove duplicate Jira IDs, or create the
summary. Each Jira ID appears once across the feature-level @US. tags,
regardless of how many acceptance criteria refer to it. The action preserves
other existing story keys and ignores acceptance tags with placeholders.
Separate IDs in a summary with colons. Format Document normalizes comma
separators between concrete Jira IDs, removes duplicate IDs across the
feature header, and wraps long summaries onto lines that each start with
@US.. Set tooliumCucumber.formatter.jiraStoryLineLength to change the
default limit of 120 characters. Acceptance tags keep their own syntax.
Run Toolium Cucumber: Clean Feature @US Tag from the Command Palette to
remove duplicate story keys and keys with no concrete acceptance tag in the feature.
The cleanup can be run independently and only removes entries. An empty
summary tag is removed.
Find Jira bug references
Set tooliumCucumber.jira.issuePrefixes to the Jira project keys to search,
for example ["TOOLIUM"]. The setting has no default prefixes. Run
Toolium Cucumber: Find Jira Bug References and enter a complete ID such as
TOOLIUM-123. The command searches .feature files in workspace folders
that allow that prefix, including unsaved edits in open files.
The command finds IDs in @jira.link.detects tags, including colon-separated
lists. For a tag such as @jira.link.detects.TOOLIUM-42:<bug_id>, it also
checks the bug_id column of applicable Examples rows. Each destination
opens at the literal tag ID or the corresponding Examples cell.
To open a Jira issue, set
tooliumCucumber.jira.issueUrlTemplate to an HTTP(S) URL such as
https://jira.example.es/browse/(id). Run Toolium Cucumber: Open Jira Issue
from the editor context menu with the cursor on an issue ID or with the full
ID selected. You can also run it from the Command Palette and enter the ID at
the prompt. The URL template is empty by default.
Opening an issue only requires its full ID and the URL template. Prefixes
filter feature reference searches.
Use issuePrefixes when migrating from the deprecated bugPrefixes key.
An explicit empty issuePrefixes list disables reference searches.
The command uses the system browser by default. Set
tooliumCucumber.jira.openInIntegratedBrowser to true in your VS Code user
settings to open the issue in an integrated browser tab beside the active editor. If the
integrated browser is unavailable, the command uses the system browser.
To view the same issue inside VS Code Desktop, run Browser: Open Integrated
Browser and paste the full issue URL into the address bar. This manual flow
uses a built-in VS Code feature and requires no additional Toolium Cucumber
setting. You may need to sign in to Jira in the integrated browser.
VS Code integrated browser documentation
Navigate to a Python step
Place the cursor on a step and run Toolium Cucumber: Go to Step Definition
from the Command Palette. This works in scenarios, backgrounds, Toolium action
blocks such as Actions Before the Feature:, and literal Python strings
passed to execute_steps. If a shared Python caller is imported by multiple
suites, choose the suite first. If multiple Python functions match, choose a
destination from the list.
Python navigation supports single-line and multiline literals. Strings assembled
at runtime, f-strings, and concatenated literals are outside the current scope.
The index starts at the nearest steps directory above the feature. It reads
the suite's direct step files and environment.py, then follows static imports
to shared source and to Toolium packages available in the selected interpreter.
It recognizes literal given, when, then, and step patterns, including
common built-in parse field types and Toolium Telefónica's generic step
wrappers, including aliased catalog decorators. Exact texts are indexed by decorator, with
parameterized patterns compiled for reuse. Imported modules are read as source.
The index also follows imported decorator factories that statically forward the
original pattern to a supported Behave or Toolium decorator, including through a
helper function or a closure.
Dynamic registration, custom converters, and other matchers are outside this
initial implementation.
Navigation requires a trusted file-based workspace and Python 3.9 or later.
The extension looks for a nearby .venv and then uses Python on PATH. Set
tooliumCucumber.pythonInterpreter to select a different interpreter.
Use tooliumCucumber.stepImportPaths for extra source roots, such as an editable
package whose location is configured by a Python startup hook.
Follow editor links
Use Cmd-click on macOS or Ctrl-click on Windows and Linux to navigate from
a Gherkin step or a supported execute_steps literal to its Python definition.
Clicking a Toolium placeholder with the same modifier opens the resource instead,
including when the placeholder occurs inside a step. Jira IDs in @jira. and
@US. tags open the configured Jira URL.
Use the Testing gutter control or F5 to run a scenario, outline, or feature.
VS Code's multi-cursor setting determines the navigation modifier.
Complete and inspect steps
Type a step keyword and a space, or invoke Trigger Suggest from the Command
Palette. The suggestions use the definitions loaded for the current suite. Use
Tab to move through the inserted parameter fields. Hover over a resolved step
to see its Python function, pattern, source location, and docstring when
available.
In Python, completion also works on lines inside a multiline literal passed to
execute_steps, including static lines in a multiline f-string. Use Trigger
Suggest if suggestions do not open while typing
inside the string. Shared Python modules receive suggestions from the suites
that import them.
To show suggestions automatically in Python strings, set
editor.quickSuggestions.strings to "on" in the [python] settings block.
Configuration examples
- settings.example.json includes all current
Toolium Cucumber settings and the VS Code settings used for Gherkin editing,
formatting, Python string suggestions, and Testing gutter controls. Copy
it to
.vscode/settings.json or merge the relevant keys into your existing
workspace or user settings. VS Code applies the extension's defaults
when these settings are absent.
- launch.example.json includes launch configurations
for the scenario at the cursor, the active feature, a selected directory,
Jira filtering, legacy name matching, and terminal-only execution. Copy
it to
.vscode/launch.json or merge the entries you need into the existing
configurations array. The examples share a report path. Use distinct
paths for simultaneous launches.
Both files are included in the VSIX. Adjust the working directory,
environment file, and output path to match your project. To try Jira
navigation and reference searches, supply your Jira URL template and project
keys as described above. On Windows, use ; between paths in PYTHONPATH.
Select a scenario for F5
To run or debug from VS Code, install Microsoft's Python Debugger extension
and use an interpreter with your project's Behave and Toolium dependencies.
The Testing gutter controls require a trusted workspace.
In your debugpy launch configuration for the behave module, use a single
target argument to select the exact scenario under the cursor:
"args": ["${command:toolium-cucumber.scenarioTarget}"]
Replace the previous file and -n selector with this argument. Keep the
project's interpreter, working directory, environment, filters, and formatter
arguments. Save the feature before launching. The command uses the scenario's
header line from anywhere in its block, including its Examples. Selecting a
Scenario Outline runs all of its rows eligible under the project's skip rules.
Use the native play control in the editor gutter to run a scenario or outline.
Right-click the control to debug it. The scenarios in open feature files
also appear in the Testing view. Run ignores breakpoints and
Debug honors them. Both use the project's Behave launch configuration containing
${command:toolium-cucumber.scenarioTarget}. If several configurations use
that argument, VS Code prompts you to choose one. Existing name-based launches
can still use ${command:toolium-cucumber.scenarioName} with Behave's -n filter.
If the gutter control is hidden, check VS Code's testing.gutterEnabled setting.
Select scenarios by Jira issue ID
Create a separate Behave launch configuration and use these target arguments:
"args": ["${command:toolium-cucumber.featurePath}", "-t", "${command:toolium-cucumber.scenarioJiraTag}"]
Select an ID such as TOOLIUM-123, place the cursor on
@jira.TOOLIUM-123, or enter the ID when prompted. Keep the project's
other arguments, including the formatter if you use Scenario Results.
Behave applies the exact @jira.TOOLIUM-123 filter within the active feature.
Every eligible scenario matching the tag runs, including those that inherit
it. Acceptance and bug-link tags use different names.
Run the active feature with F5
Duplicate your Behave launch configuration, give it a name such as
Toolium Cucumber: Active Feature, and replace the file and scenario
selector arguments with the active feature path:
"args": ["${command:toolium-cucumber.featurePath}"]
Keep any other project arguments and the formatter arguments below if you
want live results. Select the new configuration in Run and Debug, open
a saved feature file, and press F5 from anywhere in the file. The command
validates the active feature, then Behave runs that file with the project's
usual filters and skip rules.
You can also click the play control beside the Feature: header to run the
whole file, or right-click it to debug. The control uses the debugpy launch
configuration containing ${command:toolium-cucumber.featurePath} and
launches Behave once for the file. The gutter skips configurations that
also use ${command:toolium-cucumber.scenarioJiraTag}. Select those
configurations in Run and Debug to run with a Jira filter.
Choose a directory to run with F5
In .vscode/launch.json, duplicate your Behave launch configuration and name
it Toolium Cucumber: Select Directory. Replace the existing file or
scenario selector with the directory picker:
"args": ["${command:toolium-cucumber.featureDirectory}"]
Select the configuration in Run and Debug and press F5 with a feature
open. The picker offers its directory, parent
directories up to the workspace root, or another directory through the
folder browser. Cancelling either picker stops the launch.
For a separate Toolium Cucumber: By Jira ID in Directory configuration,
use the picker and Jira tag filter together. With live results enabled,
the complete args array for this example is:
"args": [
"${command:toolium-cucumber.featureDirectory}",
"-t", "${command:toolium-cucumber.scenarioJiraTag}",
"--format", "toolium_cucumber_results:ResultsFormatter",
"--outfile", "${workspaceFolder}/acceptance/_output/behave-results.jsonl",
"--format", "pretty"
]
Place the cursor on a tag such as @jira.TOOLIUM-123 or select a Jira ID
before pressing F5. If neither is available, the launch prompts for the ID.
The directory picker defines where Behave searches for matching scenarios.
Keep your project's other arguments, working directory, and environment.
For live results, keep the formatter directory in PYTHONPATH as shown in
Collect Behave results.
Collect Behave results
To record results from an existing debugpy launch that uses the behave
module, append the packaged formatter directory to the launch configuration's
PYTHONPATH. Keep the existing arguments, interpreter, and environment. For
example, add these formatter arguments to a launch that uses the default
terminal formatter:
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "${workspaceFolder}:${command:toolium-cucumber.behaveFormatterPath}"
},
"args": [
"${command:toolium-cucumber.scenarioTarget}",
"--format", "toolium_cucumber_results:ResultsFormatter",
"--outfile", "${workspaceFolder}/acceptance/_output/behave-results.jsonl",
"--format", "pretty"
]
Use ; between Python import directories on Windows. If the launch already
specifies formatters and output files, keep their order and pair each formatter
with its output.
Set --outfile to the project's output directory. This example uses
acceptance/_output to keep the report alongside the Toolium logs. Behave
replaces the report at the configured path at the start of each run. You can
delete it between runs, and Behave will create it again on the next run. Use
a distinct report path for each simultaneous run.
The formatter writes one JSON object per line. The stream includes feature
locations, scenario and outline row identities, step results, durations in
seconds, and error messages when Behave exposes them. Locations use one-based
line numbers. runFinished marks formatter teardown. Behave continues to
apply the project's hooks, filters, and skip rules and print its normal
terminal output using the existing terminal formatter.
Switch the local test environment and language
Configure reusable environment and language pairs in VS Code settings:
"tooliumCucumber.execution.profiles": [
{ "label": "QA Spain", "environment": "qa", "language": "es-es", "tags": ["es_stb", "ap_stb"] },
{ "label": "Staging Brazil", "environment": "staging", "language": "pt-br" }
]
Optional tags appear in the picker and can be used to search for a profile.
They are reference labels for the picker. Behave tag filtering is configured
separately in the launch arguments.
Open Test Profiles in the VS Code Activity Bar and select Select Test Environment
and Language in the sidebar. You can also use the gear in a feature editor
or run Toolium Cucumber: Select Test Environment and Language from the
Command Palette. The picker shows the current environment and language from
the selected CFG. Choosing a preset updates the same file under
[TestExecution].
To select a specific CFG, set tooliumCucumber.execution.profileFile to a
path relative to the workspace folder:
"tooliumCucumber.execution.profileFile": "aura-tests/acceptance/settings/local-toolium.cfg"
With the setting empty, the selector looks for local-toolium.cfg in
tooliumCucumber.resources.tooliumPaths, offers a choice when several match,
and creates the local file beside toolium.cfg if needed.
Browse features and execution output
Open Test Profiles in the Activity Bar and expand Features to browse
subfolders and .feature files under acceptance/features. Select a feature
to open it in the editor. If you opened a parent folder in VS Code, configure
the path relative to that folder:
"tooliumCucumber.execution.featuresPath": "aura-tests/acceptance/features"
Open Test Profiles in the Activity Bar and expand Output to browse
logs and artifacts under acceptance/_output. Select a file to open it in
VS Code, or use the refresh button if a new file has not appeared yet.
Use the search icon in either view to find a file by name or path, including
in collapsed subfolders. Features searches .feature files, while
Output searches all files under its configured folder.
If you opened a parent folder in VS Code, set a path relative to that folder:
"tooliumCucumber.execution.outputPath": "aura-tests/acceptance/_output"
Create file filters
Add reusable filters to File Filters in the Test Profiles sidebar:
"tooliumCucumber.execution.fileFilters": [
{ "name": "Python", "baseFolder": "var", "filter": "*.py" },
{ "name": "Logs", "baseFolder": "aura-tests/acceptance/_output", "filter": "**/*.log" }
]
Each baseFolder is relative to the workspace folder. A pattern such as
*.py matches file names in that folder and its subfolders. A pattern such
as steps/**/*.py matches paths relative to baseFolder. Expand a filter to
browse its folders or use the search icon to find a matching file by name
or path.
View Scenario Results
While a Behave launch is active, the VS Code status bar shows an animated
indicator. The live results view also shows activity while waiting for results.
When the configured Behave launch starts, Toolium Cucumber opens
Scenario Results beside the editor and updates it as Behave records
results. The tab lists steps in execution order and groups Outline results
by Examples row. Expand any scenario or row to see its steps, durations,
and available failure details. Stopping the debugger preserves results
already recorded. The view distinguishes completed, cancelled, and
interrupted runs.
When the launch targets one scenario by line (for example via
scenarioTarget), the live view shows only that scenario or all its
Examples rows if it is an outline. Feature launches and saved reports show
all recorded scenarios. Add "--no-skipped" to the Behave arguments to omit
scenarios excluded by selection from Behave's output as well.
Use Only Failures to hide scenarios and Examples rows without a failure.
Next Failure jumps to the next failed step or scenario error and wraps
after the last one. The filter, expanded sections, and reading position are
preserved while the current report updates.
Set tooliumCucumber.execution.showScenarioResults to false in your
user or workspace settings to keep F5 executions in the integrated terminal
without opening or updating the results tab. The formatter still writes
the configured JSONL report, which can be opened manually.
When live results are enabled, tooliumCucumber.execution.hideTerminalOnStart
defaults to true. VS Code may briefly show the integrated terminal before
the extension hides it. Behave continues running there, and Show Terminal
reveals the output on demand. Set the option to false to keep both visible.
Click a scenario or outline title to open its source in the feature file.
Click an expanded outline row's name to open the corresponding Examples row.
Use the disclosure arrow to expand or collapse the results.
Expand an error to read all the text recorded by Behave. Go to Step
opens the reported line in the feature file. A scenario-level error, such as
a failure in before_scenario, appears above the step list. Go to Scenario
opens the reported scenario or Examples row. Navigation requires the source
file at the path in the report.
For results opened by the debugger, Show Terminal reveals the launch
terminal if VS Code can identify it. Otherwise, it reveals the active
integrated terminal if one is available.
To open a saved report, run Toolium Cucumber: Show Scenario Results from
the Command Palette and select its .jsonl file. The view expects a completed
report. The integrated terminal remains available for the full output.
Diagnose missing steps
In a trusted workspace, the extension checks the steps in an open feature
against its suite. It expands each populated Scenario Outline using its Examples
rows and reports missing columns referenced by the step text, tables, or doc
strings. When static discovery detects unsupported Python definitions or imports,
it reports incomplete validation on the relevant Python source lines in
Problems and suppresses undefined-step warnings.
For an undefined step, choose Create Python step definition from the Quick
Fix menu. The action creates a new module in the suite's steps directory
without overwriting existing files. If several example values are unresolved,
choose the value to scaffold.
In a .feature or Python file, place the cursor inside a resource placeholder.
Follow the Open Toolium resource editor link or run
Toolium Cucumber: Open Resource from the Command Palette or editor context
menu. When the editor link is unavailable, choose Open resource in the hover.
The context menu offers the command when the cursor is inside a recognized
placeholder. A single match opens directly. When several equally specific
destinations match, choose a file and line.
Hover over a literal LANG, CONF, TOOLIUM, or POE reference to preview its
value and source file. For LANG, an explicit suffix such as ::en takes
precedence over [TestExecution] language in the Toolium CFG files.
local-toolium.cfg overrides toolium.cfg in the same directory. If the
configured language is unavailable or cannot be inferred, the hover lists the
available translations, grouping languages with identical text, including YAML
aliases. An explicit language suffix requires an exact match.
tooliumCucumber.resources.languagePreviewMaxLength limits each translation to
150 characters by default. CONF shows matching scalar values per file, and POE
shows the definitions from the matching local exports.
| Reference |
Destination |
[LANG:observatory.status::en] |
A YAML mapping key or its explicit language. |
[CONF:observatory.lenses.0.name] |
An included JSON property or array entry. |
[POE:sky:chart.title] |
A matching identifier in a POEditor JSON array. |
[FILE:charts/list.txt], [FILE_UTF8:charts/list.txt], [BASE64:charts/image.png] |
An exact file under its configured base directory. |
[TOOLIUM:Observatory_mode] |
An explicit option in toolium.cfg or local-toolium.cfg. |
Type : or . in a bracketed LANG or CONF placeholder to complete its current
segment. Use :: to select an explicit LANG language. LANG and CONF navigation
can open the deepest existing parent when a segment is dynamic or missing.
Use Cmd-click on macOS, Ctrl-click on Windows and Linux, or Find All
References on YAML language keys, eligible CONF keys, POEditor identifiers,
and explicit TOOLIUM sections or options to find their usages in Python and
features. VS Code handles navigation when there are multiple matches.
These operations read current editor contents, including
unsaved resource changes, and work independently of the Python step index.
Resource settings use the tooliumCucumber.resources. prefix and are scoped to
the workspace folder containing the source or resource. Configure
resourcePaths, configurationPaths, poeditorPaths, and tooliumPaths to
override the resource directories. Configure filePath and base64Path for
direct files, and referencePaths for reverse searches. Defaults use the
acceptance/resources, acceptance/settings, acceptance/common, and
acceptance/features conventions. An empty directory list disables its search.
An empty path selects the workspace root. Private CONF filenames are excluded
by default via configurationExcludePatterns. A custom list replaces those
defaults. Configure baseConfigurationFiles to list shared CONF files
before environment-specific definitions. The same exclusions apply to both.
TOOLIUM searches for toolium.cfg and local-toolium.cfg directly in each
configured directory. Use poeditorSearchType, poeditorKeyField, and
poeditorPrefixes to configure POEditor matching.
Write feature blocks
In a .feature file, use Insert Snippet or type a snippet prefix and choose
the suggestion. Use Tab to move through its editable fields. The English
Gherkin snippets cover features, rules, backgrounds, scenarios, outlines, and
Examples. Try gherkin-scenario, gherkin-outline, or gherkin-examples.
The outline snippet links the example column name to its placeholder in the step.
For Toolium actions, use toolium-before-feature, toolium-after-feature,
toolium-before-scenario, or toolium-after-scenario.
Pressing Enter after a Gherkin section heading or Toolium action heading
indents the next line using the editor's indentation settings. Gherkin headings
are recognized across supported dialects.
Run Format Document in a .feature file to reindent Gherkin sections, tags,
steps, and arguments and align table columns. The formatter uses the editor's
tab size and indentation style by default. It preserves comments, Toolium action
bodies, doc string content, and table values. It skips files with syntax errors
and checks that formatting preserves the parsed feature.
The formatter leaves one blank line between consecutive scenarios or outlines
in the same feature or rule, before any leading tags or contiguous comments.
It also leaves one blank line between an outline's last step, including any
step argument, and its first Examples block.
It trims extra blank lines at the end of the file and preserves the final newline
if present. These rules also apply when general blank-line cleanup is disabled.
To customize the layout and format on save, add this example to your VS Code
settings:
{
"tooliumCucumber.formatter.paddingSymbol": "space",
"tooliumCucumber.formatter.tablePadding": 10,
"tooliumCucumber.formatter.consecutiveBlankLinesToOne": true,
"tooliumCucumber.formatter.paddings": [
{ "keyword": "Feature", "padding": 0 },
{ "keyword": "Scenario Outline", "padding": 2 },
{ "keyword": "Scenario", "padding": 2 },
{ "keyword": "Given", "padding": 4 },
{ "keyword": "When", "padding": 5 },
{ "keyword": "Then", "padding": 5 },
{ "keyword": "And", "padding": 6 },
{ "keyword": "Actions", "padding": 2 },
{ "keyword": "Examples", "padding": 4 }
],
"[gherkin]": {
"editor.defaultFormatter": "manon42bcn.toolium-cucumber",
"editor.formatOnSave": true
}
}
Padding counts are absolute from the start of the line. Set paddingSymbol
to editor to follow the editor, or use space or tab explicitly. Omitted
keywords use structural indentation, and tags align with their headings.
English keyword names also apply to localized features. A matching localized
keyword takes precedence. Actions covers the standard Toolium action
headings. Use a full heading name to override a specific action block.
tablePadding applies to Gherkin data tables and Examples tables. Set it to
null to inherit indentation from the enclosing step or Examples block.
Blank-line cleanup preserves lines inside doc strings and Toolium action bodies.