{
  "schemaVersion": 1,
  "id": "0b5c2f1e-7a4d-4c1e-9f0a-2d3b4c5d6e7f",
  "name": "Демо: тестовое приложение",
  "description": "Запускает TestApp, вводит имя, нажимает кнопку и проверяет результат",
  "variables": [
    { "name": "userName", "type": "string", "default": "Арген", "isArgument": true },
    { "name": "result", "type": "string", "default": null, "isArgument": false }
  ],
  "steps": [
    {
      "id": "s_start001",
      "type": "app.start",
      "props": { "path": "../testapp/Tulpar.TestApp.exe", "arguments": "" }
    },
    {
      "id": "s_wait0001",
      "type": "ui.waitElement",
      "displayName": "Дождаться окна",
      "props": {
        "selector": {
          "kind": "uia",
          "path": [ { "processName": "Tulpar.TestApp", "controlType": "Window", "name": "Tulpar Test App" } ]
        },
        "state": "appear",
        "timeoutMs": 10000,
        "throwOnTimeout": true
      }
    },
    {
      "id": "s_type0001",
      "type": "ui.typeInto",
      "props": {
        "selector": {
          "kind": "uia",
          "path": [
            { "processName": "Tulpar.TestApp", "controlType": "Window", "name": "Tulpar Test App" },
            { "controlType": "Edit", "automationId": "txtName" }
          ]
        },
        "text": "{{ userName }}",
        "clearBefore": true,
        "method": "auto"
      }
    },
    {
      "id": "s_click001",
      "type": "ui.click",
      "props": {
        "selector": {
          "kind": "uia",
          "path": [
            { "processName": "Tulpar.TestApp", "controlType": "Window", "name": "Tulpar Test App" },
            { "controlType": "Button", "automationId": "btnSend" }
          ]
        },
        "clickType": "left",
        "method": "auto"
      }
    },
    {
      "id": "s_gettxt01",
      "type": "ui.getText",
      "props": {
        "selector": {
          "kind": "uia",
          "path": [
            { "processName": "Tulpar.TestApp", "controlType": "Window", "name": "Tulpar Test App" },
            { "controlType": "Text", "automationId": "lblResult" }
          ]
        }
      },
      "out": { "text": "result" }
    },
    {
      "id": "s_check001",
      "type": "control.if",
      "props": { "condition": "result === `Привет, ${userName}!`" },
      "children": {
        "then": [
          { "id": "s_logok001", "type": "control.log", "props": { "level": "info", "message": "Проверка пройдена: {{ result }}" } }
        ],
        "else": [
          { "id": "s_throw001", "type": "control.throw", "props": { "message": "Неожиданный результат: {{ result }}" } }
        ]
      }
    },
    {
      "id": "s_close001",
      "type": "app.close",
      "props": { "processName": "Tulpar.TestApp", "force": false }
    }
  ]
}
