---
"Test array access":
  - do:
      cluster.health:
          wait_for_status: yellow

  - do:
      watcher.execute_watch:
        body:  >
          {
            "watch": {
              "trigger": {
                "schedule": {
                  "interval": "1s"
                }
              },
              "input": {
                "simple" : {
                  "objects" : [
                    {
                      "field": "value1"
                    },
                    {
                      "field": "value2"
                    }
                  ]
                }
              },
              "condition": {
                "always" : {}
              },
              "actions": {
                "output": {
                  "logging" : {
                    "text" : "{{ctx.payload.objects.0.field}} {{ctx.payload.objects.1.field}}"
                  }
                }
              }
            }
          }

  - match: { watch_record.result.actions.0.logging.logged_text: "value1 value2" }
