Syntax Highlighting¶
The BerryCrush plugin provides rich syntax highlighting for .scenario and .fragment files.
File Types¶
Scenario Files (.scenario)¶
Used for test scenarios containing features, scenarios, and test steps.
Icon: ![]()
Fragment Files (.fragment)¶
Used for reusable step fragments that can be included in scenarios.
Icon: ![]()
Color Scheme¶
The plugin uses distinct colors for different syntax elements:
| Element | Default Color | Example |
|---|---|---|
| Block Keywords | Blue | scenario:, fragment: |
| Step Keywords | Blue | given, when, then, and, but |
| Directives | Purple | assert, extract, include, call |
| Operation References | Orange | ^createUser, ^getPetById |
| Variables | Green | {{userId}}, {{authToken}} |
| Strings | Brown | "value", 'value' |
| Numbers | Magenta | 200, 3.14 |
| JSONPath | Cyan | $.name, $.items[0].id |
| Comments | Gray | # This is a comment |
| Tags | Yellow | @smoke, @critical |
Customizing Colors¶
You can customize the colors in IntelliJ settings:
- Go to Settings → Editor → Color Scheme → BerryCrush
- Select an element type
- Modify foreground/background colors
- Apply changes
Block Keywords¶
These keywords start new blocks:
scenario: Create user
given ...
fragment: setup-steps # Fragment block (in .fragment files)
given ...
Step Keywords¶
Step keywords are interchangeable (they have the same behavior):
given precondition step
call ^createUser
when action step
call ^getUser
then assertion step
assert status 200
and additional step
assert $.name exists
but contrasting step
assert $.deleted equals false
Directives¶
Special keywords that perform actions:
call ^operationId # API call
assert status 200 # Assertion
assert $.name equals "John"
extract $.id => userId # Extract value
include login-fragment # Include fragment
body: {"key": "value"} # Inline body
References¶
Operation References¶
References to OpenAPI operations (clickable for navigation):
Fragment References¶
References to fragment definitions:
Variables¶
Dynamic values using mustache syntax:
given I have a user ID
userId = "123"
when I retrieve the user
call ^getUser
id: {{userId}} # Variable reference
extract $.name => name
assert $.greeting equals "Hello {{name}}" # Interpolation in string
Comments¶
Single-line comments start with #:
# This is a full-line comment
scenario: My Test # Inline comment
# Multi-line comments:
# Each line needs
# its own hash symbol
Data Tables¶
Key-value pairs for parameters:
Doc Strings¶
Multi-line strings using triple quotes:
given I create a user
call ^createUser
body:
"""
{
"name": "John",
"email": "john@example.com"
}
"""
Tags¶
Tags for categorization and filtering:
JSONPath Expressions¶
Expressions for accessing JSON values:
assert $.name equals "John" # Root property
assert $.users[0].name exists # Array index
assert $.items[*].id exists # All items
extract $..id => allIds # Deep search
Troubleshooting¶
Highlighting Not Working¶
- Verify file extension is
.scenarioor.fragment - Check plugin is enabled in Settings → Plugins
- Try File → Invalidate Caches / Restart
Colors Look Wrong¶
- Check your color scheme supports the plugin
- Reset to defaults: Settings → Editor → Color Scheme → BerryCrush → Reset
Specific Elements Not Highlighted¶
Some elements require valid syntax. Check for: - Missing colons after keywords - Unclosed strings or brackets - Invalid JSON in doc strings