Auto-Completion¶
Context-aware completions help you write scenarios faster with fewer errors.
Triggering Completion¶
- Automatic: Completions appear as you type
- Manual: Press Ctrl+Space (or Cmd+Space on macOS)
Completion Types¶
Keywords¶
Step keywords are suggested at the start of lines:
Directives¶
Directives are suggested within steps:
Operation References¶
After typing call ^, operations from your OpenAPI spec are suggested:
Fragment References¶
After typing include, available fragments are suggested:
Assertion Keywords¶
After assert, assertion types are suggested:
Variable References¶
Variables defined in scope are suggested:
scenario: Test
given extract user ID
extract $.id => userId
then use the ID
call ^getUser
id: {{|}} # Suggests: userId
Completion Details¶
Each completion shows:
- Label: The completion text
- Kind: Icon indicating the type (keyword, function, variable)
- Detail: Additional information (e.g., HTTP method for operations)
- Documentation: Description or usage example
Examples¶
Full Scenario with Completions¶
- Type
scenario:and a name - Press Enter, then
g→ selectgiven - Type description, press Enter
- Type
c→ selectcall - Type
^→ select an operation - Continue building your test
Example Session¶
scenario: Create user test
| → Type 'g', select 'given'
given | → Type description
given user data is ready
| → Type 'c', select 'call'
call ^| → Select 'createUser'
call ^createUser
| → Type 't', select 'then'
then | → Type description
then user is created
| → Type 'a', select 'assert'
assert | → Select 'status'
assert status 201
Configuration¶
OpenAPI for Operations¶
Configure to enable operation completions:
Fragments Path¶
Configure where to find fragments:
Refreshing Completions¶
If new operations or fragments aren't appearing:
- Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Run:
- BerryCrush: Refresh OpenAPI - For operations
- BerryCrush: Refresh Fragments - For fragments
- BerryCrush: Refresh Custom Steps - For custom steps
Related Features¶
- Navigation - Navigate to definitions
- Snippets - Quick code templates