{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$ref": "#/definitions/TestSuite",
  "definitions": {
    "TestSuite": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "useCssOverride": {
          "type": "boolean"
        },
        "urlReplacements": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UrlReplacements"
          }
        },
        "cssOverridePath": {
          "type": "string"
        },
        "hideSelectors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "removeSelectors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "viewportNames": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "scenarios": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TesScenario"
          }
        },
        "debug": {
          "type": "boolean"
        },
        "asyncCaptureLimit": {
          "type": "number"
        },
        "asyncCompareLimit": {
          "type": "number"
        },
        "browser": {
          "type": "string",
          "oneOf": [
            {
              "enum": [
                "chromium",
                "firefox",
                "webkit"
              ]
            }
          ]
        },
        "misMatchThreshold": {
          "type": "number"
        },
        "postInteractionWait": {
          "type": "number"
        },
        "bypassCsp": {
          "type": "boolean"
        },
        "state": {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[a-z0-9_-]+$"
            },
            {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[a-z0-9_-]+$"
              }
            }
          ]
        },
        "ignoreSslErrors": {
          "type": "boolean"
        },
        "basicAuth": {
          "$ref": "#/definitions/BasicAuthConfig"
        }
      },
      "required": [
        "scenarios"
      ],
      "title": "TestSuite"
    },
    "TesScenario": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "url": {
          "type": "string"
        },
        "label": {
          "type": "string",
          "pattern": "^[a-z0-9_-]+$"
        },
        "description": {
          "type": "string"
        },
        "delay": {
          "type": "number"
        },
        "useCssOverride": {
          "type": "boolean"
        },
        "cssOverridePath": {
          "type": "string"
        },
        "cookiePath": {
          "type": "string"
        },
        "jsOnReadyPath": {
          "type": "string"
        },
        "hideSelectors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "removeSelectors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "clickSelector": {
          "type": "string"
        },
        "viewportNames": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9_-]+$"
        },
        "needs": {
          "oneOf": [
            {
              "type": "string",
              "pattern": "^[a-z0-9_-]+$"
            },
            {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[a-z0-9_-]+$"
              }
            }
          ]
        },
        "noScrollTop": {
          "type": "boolean"
        },
        "selectors": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ],
          "title": "Selectors",
          "description": "Array of selectors to capture. Defaults to document if omitted. Use \"viewport\" to capture the viewport size."
        },
        "actions": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "$ref": "#/definitions/CheckAction"
              },
              {
                "$ref": "#/definitions/ClickAction"
              },
              {
                "$ref": "#/definitions/GotoAction"
              },
              {
                "$ref": "#/definitions/HideAction"
              },
              {
                "$ref": "#/definitions/HoverAction"
              },
              {
                "$ref": "#/definitions/InputAction"
              },
              {
                "$ref": "#/definitions/InputFileAction"
              },
              {
                "$ref": "#/definitions/persistAction"
              },
              {
                "$ref": "#/definitions/PressAction"
              },
              {
                "$ref": "#/definitions/RemoveAction"
              },
              {
                "$ref": "#/definitions/ScrollAction"
              },
              {
                "$ref": "#/definitions/SelectByLabelAction"
              },
              {
                "$ref": "#/definitions/SelectByValueAction"
              },
              {
                "$ref": "#/definitions/UncheckAction"
              },
              {
                "$ref": "#/definitions/WaitAction"
              }
            ]
          },
          "title": "Actions",
          "description": "Documentation: https://tuyen.blog/optimizely-cms/testing/create-action/"
        },
        "misMatchThreshold": {
          "type": "number"
        },
        "postInteractionWait": {
          "type": "number"
        },
        "bypassCsp": {
          "type": "boolean"
        },
        "basicAuth": {
          "$ref": "#/definitions/BasicAuthConfig"
        }
      },
      "required": [
        "url"
      ],
      "title": "URL"
    },
    "UrlReplacements": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ref": {
          "type": "string",
          "format": "uri",
          "qt-uri-protocols": [
            "https"
          ]
        },
        "test": {
          "type": "string",
          "format": "uri",
          "qt-uri-protocols": [
            "https"
          ]
        }
      },
      "required": [
        "ref",
        "test"
      ],
      "title": "URL Replacements"
    },
    "BasicAuthConfig": {
      "description": "HTTP Basic Authentication credentials. Provide a single entry to protect one origin, or an array of entries to protect several origins; the entry matching the scenario's origin is selected at runtime.",
      "oneOf": [
        {
          "$ref": "#/definitions/BasicAuth"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/definitions/BasicAuth"
          }
        }
      ]
    },
    "BasicAuth": {
      "type": "object",
      "additionalProperties": false,
      "description": "HTTP Basic Authentication credentials applied before navigation. Each value may reference an environment variable with ${VAR} or $VAR so secrets stay out of committed YAML. Origin must be the protected origin (scheme://host:port).",
      "properties": {
        "origin": {
          "type": "string",
          "description": "Protected origin (scheme://host:port). May contain ${VAR}/$VAR references (including embedded, e.g. https://${HOST}); it is expanded and normalized to an origin at runtime."
        },
        "username": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      },
      "required": [
        "origin",
        "username",
        "password"
      ],
      "title": "BasicAuth"
    },
    "CheckAction": {
      "type": "object",
      "description": "Documentation: https://tuyen.blog/optimizely-cms/testing/create-action/#spoiler--check",
      "additionalProperties": false,
      "properties": {
        "check": {
          "type": "string"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "check"
      ]
    },
    "ClickAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "click": {
          "type": "string"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "click"
      ]
    },
    "HideAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "hide": {
          "type": "string"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "hide"
      ]
    },
    "GotoAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "goto": {
          "type": "string"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "goto"
      ]
    },
    "HoverAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "hover": {
          "type": "string"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "hover"
      ]
    },
    "InputAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "input": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "append": {
          "type": "boolean"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "input",
        "value"
      ]
    },
    "InputFileAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "input": {
          "type": "string"
        },
        "file": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "useFileChooser": {
          "type": "boolean"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "input",
        "file"
      ]
    },
    "PressAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "press": {
          "type": "string"
        },
        "key": {
          "type": "string"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "press",
        "key"
      ]
    },
    "RemoveAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "remove": {
          "type": "string"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "remove"
      ]
    },
    "ScrollAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "scroll": {
          "type": "string"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "scroll"
      ]
    },
    "SelectByValueAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "select": {
          "type": "string"
        },
        "value": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "select",
        "value"
      ]
    },
    "SelectByLabelAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "select": {
          "type": "string"
        },
        "label": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "select",
        "label"
      ]
    },
    "UncheckAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "uncheck": {
          "type": "string"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "uncheck"
      ]
    },
    "WaitAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "wait": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            }
          ]
        },
        "url": {
          "type": "string"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "wait"
      ]
    },
    "persistAction": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "persist": {
          "type": "string",
          "pattern": "^[a-z0-9_-]+$"
        },
        "frame": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        }
      },
      "required": [
        "persist"
      ]
    }
  }
}