{
  "schema_version": 1,
  "name": "Log in and confirm the session",
  "version": 1,
  "description": "Sign in, stop safely if a verification checkpoint appears, then confirm the account is really logged in before doing anything else. Credentials are bound to variables — replace them or load from your own store; never hard-code real passwords.",
  "vars": {
    "login_url": "https://example.com/login",
    "username_field": "Username",
    "password_field": "Password",
    "submit_text": "Sign in",
    "logged_in_marker": "My account",
    "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" } } ] },
    { "wait_for": { "text": "{{logged_in_marker}}", "timeout": 20 } },
    { "if": { "text_present": "{{logged_in_marker}}" },
      "then": [ { "set": { "name": "status", "value": "logged_in" } } ],
      "else": [ { "set": { "name": "status", "value": "login_failed" } },
                { "stop": { "reason": "did not reach the logged-in state" } } ] },
    { "screenshot": { "path": "session.png" } },
    { "close": {} }
  ]
}
