Files
cleveragents-core/features/cli_init_yes_flag.feature
T
brent.edwards 4e3bf7d3ad test(cli): add failing tests for agents init --yes missing option
Add TDD-style Behave BDD tests for the missing agents init --yes flag
(bug #522). Five Gherkin scenarios cover: exit code validation, prompt
suppression, -y alias, output summary fields, and interactive-mode
regression guard. Includes Robot Framework smoke tests (tagged @wip)
and ASV benchmarks.

Configure behave.ini to exclude @wip scenarios globally and noxfile.py
to exclude wip-tagged Robot suites, so TDD-failing tests do not break CI.

Review feedback addressed:
- Remove unnecessary # type: ignore from benchmark (outside Pyright scope)
- Fix Then...Then to Then...And in Gherkin (L1)
- Fix CHANGELOG 'three scenarios' to 'five scenarios' (L2)
- Add behave.ini documentation for @wip workaround (Aditya F1)
- Rename Scenario 2 title to 'suppresses interactive prompts' (Aditya F2)

Closes #536
2026-03-06 20:28:37 +00:00

57 lines
2.6 KiB
Gherkin

# These tests target bug #522 and are expected to fail until the fix is applied.
#
# NOTE FOR FIX AUTHOR (#522):
# Scenarios 1-4 will fail for TWO independent reasons:
# (a) The --yes / -y flag is not yet implemented (NoSuchOption).
# (b) The current init_command output format (project.py) does not match
# the spec-defined output at docs/specification.md:1381-1402.
# The fix must address both: add the --yes flag AND remodel the output to
# match the spec (Data Dir, Config, Database, Directories fields with the
# "Initialized (non-interactive)" status message).
Feature: CLI init --yes flag for non-interactive initialization
As a developer using CleverAgents in CI or scripts
I want to run "agents init --yes" for non-interactive initialization
So that I can skip interactive prompts and use sensible defaults
@tdd @bug522 @wip
Scenario: agents init --yes completes without error
Given I have a temporary project directory for init
When I run agents init with the --yes flag
Then the init command should exit with code 0
And the project service initialize_project should have been called
@tdd @bug522 @wip
Scenario: --yes suppresses interactive prompts
Given I have a temporary project directory for init
When I run agents init with the --yes flag
Then the init command should exit with code 0
And the init output should contain "Initialized (non-interactive)"
And no interactive prompt should have been presented
@tdd @bug522 @wip
Scenario: -y short-form alias completes without error
Given I have a temporary project directory for init
When I run agents init with the -y flag
Then the init command should exit with code 0
And the init output should contain "Initialized (non-interactive)"
And the project service initialize_project should have been called
@tdd @bug522 @wip
Scenario: Output includes expected initialization summary
Given I have a temporary project directory for init
When I run agents init with the --yes flag
Then the init command should exit with code 0
And the init output should contain "Data Dir:"
And the init output should contain "Config:"
And the init output should contain "Database:"
And the init output should contain "Directories:"
And the init output should contain "logs, cache, sessions, contexts"
And the init output should contain "Initialized"
@tdd @bug522
Scenario: Interactive mode without --yes presents a prompt
Given I have a temporary project directory for init
When I run agents init without the --yes flag
Then the init command should exit with code 0
And the init output should indicate interactive mode