{
  "schema_version": 1,
  "name": "Basic login",
  "version": 1,
  "description": "Open a site, sign in with credentials bound from variables (never hard-code passwords in a template), stop safely if a verification checkpoint appears.",
  "vars": {
    "login_url": "https://example.com/login",
    "username_field": "Username",
    "password_field": "Password",
    "submit_text": "Sign in",
    "user": "REPLACE_WITH_USERNAME",
    "pass": "REPLACE_WITH_PASSWORD"
  },
  "on_error": "screenshot_and_stop",
  "steps": [
    {
      "open": {}
    },
    {
      "goto": {
        "url": "{{login_url}}"
      }
    },
    {
      "wait_for": {
        "text": "{{submit_text}}",
        "timeout": 15
      }
    },
    {
      "type": {
        "into": "{{username_field}}",
        "text": "{{user}}"
      }
    },
    {
      "type": {
        "into": "{{password_field}}",
        "text": "{{pass}}",
        "enter": true
      }
    },
    {
      "if": {
        "text_present": "Verify"
      },
      "then": [
        {
          "stop": {
            "reason": "verification checkpoint — not bypassing"
          }
        }
      ]
    },
    {
      "screenshot": {
        "path": "after-login.png"
      }
    },
    {
      "close": {}
    }
  ]
}
