195fbac109
CI / lint (pull_request) Successful in 40s
CI / helm (pull_request) Successful in 38s
CI / build (pull_request) Successful in 48s
CI / quality (pull_request) Successful in 1m0s
CI / typecheck (pull_request) Successful in 1m29s
CI / security (pull_request) Successful in 1m28s
CI / push-validation (pull_request) Successful in 20s
CI / unit_tests (pull_request) Successful in 5m8s
CI / docker (pull_request) Successful in 1m27s
CI / integration_tests (pull_request) Successful in 8m39s
CI / coverage (pull_request) Successful in 11m1s
CI / status-check (pull_request) Successful in 3s
Add domain-scenario Gherkin tags to all A2A, session, and CLI feature files (30 files) so tests can be filtered individually via behave. - 8 A2A feature files: @a2a tag - 7 session feature files: @session tag - 15 CLI feature files: @cli tag ISSUES CLOSED: #9124
135 lines
5.6 KiB
Gherkin
135 lines
5.6 KiB
Gherkin
@cli
|
|
Feature: CLI output formats parity
|
|
As a developer using the CleverAgents CLI
|
|
I want all action and plan commands to support --format json|yaml|plain|table|rich
|
|
So that I can integrate CLI output with external tooling
|
|
|
|
Background:
|
|
Given a CLI output format test runner
|
|
And a mocked lifecycle service for format tests
|
|
|
|
# Action list --format json
|
|
Scenario: Action list outputs valid JSON
|
|
Given there are actions for format testing
|
|
When I run action list with --format json
|
|
Then the output should be valid JSON
|
|
And the JSON should contain key "namespaced_name"
|
|
|
|
# Action show --format yaml
|
|
Scenario: Action show outputs valid YAML
|
|
Given there is a single action for format testing
|
|
When I run action show with --format yaml
|
|
Then the output should be valid YAML
|
|
And the YAML should contain key "namespaced_name"
|
|
|
|
# Plan list --format json
|
|
Scenario: Plan list outputs valid JSON
|
|
Given there are plans for format testing
|
|
When I run plan list with --format json
|
|
Then the output should be valid JSON
|
|
And the JSON should contain key "plan_id"
|
|
|
|
# Plan status --format json (single plan)
|
|
Scenario: Plan status single plan outputs valid JSON
|
|
Given there is a single plan for format testing
|
|
When I run plan status with plan id and --format json
|
|
Then the output should be valid JSON
|
|
And the JSON should contain key "processing_state"
|
|
|
|
# Plan status --format plain (single plan)
|
|
Scenario: Plan status single plan outputs plain text
|
|
Given there is a single plan for format testing
|
|
When I run plan status with plan id and --format plain
|
|
Then the format output should contain "plan_id:"
|
|
And the format output should contain "processing_state:"
|
|
|
|
# Action list --format table
|
|
Scenario: Action list outputs table format
|
|
Given there are actions for format testing
|
|
When I run action list with --format table
|
|
Then the format output should contain "namespaced_name"
|
|
|
|
# Action list --format plain
|
|
Scenario: Action list outputs plain format
|
|
Given there are actions for format testing
|
|
When I run action list with --format plain
|
|
Then the format output should contain "namespaced_name:"
|
|
|
|
# Action archive --format json
|
|
Scenario: Action archive outputs valid JSON
|
|
Given there is an archivable action for format testing
|
|
When I run action archive with --format json
|
|
Then the output should be valid JSON
|
|
And the JSON should contain key "archived"
|
|
|
|
# Plan status list all --format json
|
|
Scenario: Plan status no args outputs valid JSON for list
|
|
Given there are plans for format status listing
|
|
When I run plan status without id and --format json
|
|
Then the output should be valid JSON
|
|
And the JSON should contain key "plan_id"
|
|
|
|
# Plan use --format json
|
|
Scenario: Plan use outputs valid JSON
|
|
Given there is an action for plan use format test
|
|
When I run plan use with --format json
|
|
Then the output should be valid JSON
|
|
And the JSON should contain key "plan_id"
|
|
|
|
# Plan cancel --format json
|
|
Scenario: Plan cancel outputs valid JSON
|
|
Given there is a plan for cancel format test
|
|
When I run plan cancel with --format json
|
|
Then the output should be valid JSON
|
|
And the JSON should contain key "processing_state"
|
|
|
|
# Format consistency: same data, different renders
|
|
Scenario: JSON and YAML contain the same action keys
|
|
Given there is a single action for format testing
|
|
When I run action show with --format json
|
|
And I save the output keys as json_keys
|
|
And I run action show with --format yaml
|
|
And I save the output keys as yaml_keys
|
|
Then json_keys and yaml_keys should match
|
|
|
|
# Direct formatting module tests
|
|
Scenario: Format output handles all format types for dict
|
|
When I call format_output with a dict and format json
|
|
Then the format result should be valid JSON dict
|
|
When I call format_output with a dict and format yaml
|
|
Then the format result should be valid YAML dict
|
|
When I call format_output with a dict and format plain
|
|
Then the format result should contain plain key-value pairs
|
|
When I call format_output with a dict and format table
|
|
Then the format result should contain table output
|
|
|
|
# fix(cli): format_output() rich format must produce styled output, not JSON
|
|
Scenario: Format output rich format produces styled terminal output not JSON
|
|
When I call format_output with a dict and format rich
|
|
Then the format result should contain rich styled output
|
|
And the format result should not be valid JSON
|
|
|
|
# fix(cli): format_output() color format must produce ANSI-colored output not plain text
|
|
Scenario: Format output color format produces ANSI-colored output not plain text
|
|
When I call format_output with a dict and format color
|
|
Then the format result should contain color styled output
|
|
And the format result should not be plain text only
|
|
|
|
Scenario: Format output handles list data
|
|
When I call format_output with a list and format plain
|
|
Then the format result should contain separator lines
|
|
|
|
Scenario: Format output rich format handles list data
|
|
When I call format_output with a list and format rich
|
|
Then the format result should contain rich styled list output
|
|
And the format result should not be valid JSON
|
|
|
|
Scenario: Format output color format handles list data
|
|
When I call format_output with a list and format color
|
|
Then the format result should contain color styled list output
|
|
And the format result should not be plain text only
|
|
|
|
Scenario: Serialize value handles enums and nested dicts
|
|
When I call serialize_value with enum and nested data
|
|
Then the serialized result should have string enum values
|