*** Settings ***
Documentation    Config smoke test for automation profile service
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

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

*** Test Cases ***
Resolve Default Global Profile
    [Documentation]    Resolve the default global profile (manual)
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    resolve-default    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    resolve-default-ok

Resolve With Env Var Override
    [Documentation]    Env var overrides empty global default
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    resolve-env-override    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    resolve-env-override-ok

Precedence Resolution
    [Documentation]    Plan > action > project > global
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    precedence    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    precedence-ok

List Profiles
    [Documentation]    List all built-in profiles
    ${result}=    Run Process    ${PYTHON}    ${HELPER_SCRIPT}    list-profiles    cwd=${WORKSPACE}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    list-profiles-ok
