*** Settings ***
Documentation     Integration tests for project CLI commands.
Resource          ${CURDIR}/common.resource
Suite Setup       Setup Test Environment
Suite Teardown    Cleanup Test Environment

*** Variables ***
${HELPER_SCRIPT}    robot/helper_project_cli.py

*** Test Cases ***
Project CLI CRUD Round Trip
    [Documentation]    Verify project create, list, show, delete via CLI helper
    [Tags]    cli    project    crud    roundtrip
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    project-crud    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    project-crud-ok

Project CLI Link Lifecycle
    [Documentation]    Verify project link, unlink, and delete via CLI helper
    [Tags]    cli    project    link    lifecycle
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    link-lifecycle    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    link-lifecycle-ok

Project CLI Spec Dict
    [Documentation]    Verify _project_spec_dict output keys
    [Tags]    cli    project    spec-dict
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    spec-dict    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    spec-dict-ok
