{
  "swagger": "2.0",
  "info": {
    "description": "Web-Function-Test-API",
    "version": "1.0.0",
    "title": "Web-Function-Test-API",
    "contact": {
      "email": "wuhd@cn.ibm.com"
    }
  },
  "tags": [
    {
      "name": "File",
      "description": "Test File Data"
    },
    {
      "name": "Case",
      "description": "Test Case Data"
    },
    {
      "name": "Component",
      "description": "Test Component Data"
    },
    {
      "name": "Param",
      "description": "Test Case Data"
    },
    {
      "name": "Plan",
      "description": "Test Plan Data"
    }
    ,
    {
      "name": "Report",
      "description": "Test Report"
    }
  ],
  "schemes": [
    "http"
  ],
  "paths": {
    "/report": {
      "get": {
        "tags": [
          "Report"
        ],
        "summary": "返回所有的report",
        "description": "返回所有的report",
        "operationId": "getAllReport",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/File"
              }
            }
          }
        }
      }
    },
    "/report/{reportname}": {
      "get": {
        "tags": [
          "Report"
        ],
        "summary": "返回指定report的内容",
        "description": "返回指定report的内容",
        "operationId": "getReportByName",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "reportname",
            "description": "report name",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/file/list": {
      "get": {
        "tags": [
          "File"
        ],
        "summary": "返回所有的file",
        "description": "返回所有的file",
        "operationId": "getFileList",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/File"
              }
            }
          }
        }
      }
    },
    "/file/{filename}": {
      "delete": {
        "tags": [
          "File"
        ],
        "summary": "删除指定文件",
        "description": "删除指定文件",
        "operationId": "deleteFileByName",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "filename",
            "description": "file name",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "202": {
            "description": "正常",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "文件不存在",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ErrorResponse"
              }
            }
          }
        }
      }
    },
    "/component": {
      "get": {
        "tags": [
          "Component"
        ],
        "summary": "返回所有的component",
        "description": "返回所有的component",
        "operationId": "createComponent",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Component"
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Component"
        ],
        "summary": "创建compoennt",
        "description": "创建compoennt",
        "operationId": "createComponent",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Component"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "$ref": "#/definitions/Component"
            }
          },
          "500": {
            "description": "异常",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        }
      }
    },
    "/component/{id}": {
      "get": {
        "tags": [
          "Component"
        ],
        "summary": "返回指定id的component",
        "description": "返回指定id的component",
        "operationId": "getComponentById",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "$ref": "#/definitions/Component"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Component"
        ],
        "summary": "更新指定id的component",
        "description": "更新指定id的component",
        "operationId": "updateComponentById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "component id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "in": "body",
            "name": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Component"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "$ref": "#/definitions/Component"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Component"
        ],
        "summary": "更新指定id的component",
        "description": "更新指定id的component",
        "operationId": "deleteComponentById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "component id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "type": "object",
              "properties": {
                "deleteresult": {
                  "type": "string"
                },
                "deleteddata": {
                  "$ref": "#/definitions/Component"
                }
              }
            }
          }
        }
      }
    },
    "/case": {
      "get": {
        "tags": [
          "Case"
        ],
        "summary": "返回所有的case",
        "description": "返回所有的case",
        "operationId": "createCase",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Case"
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Case"
        ],
        "summary": "创建case",
        "description": "创建case",
        "operationId": "createCase",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Case"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "$ref": "#/definitions/Case"
            }
          }
        }
      }
    },
    "/case/{id}": {
      "get": {
        "tags": [
          "Case"
        ],
        "summary": "返回指定id的case",
        "description": "返回指定id的case",
        "operationId": "getCaseById",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "$ref": "#/definitions/Case"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Case"
        ],
        "summary": "更新指定caseid的Case",
        "description": "更新指定caseid的Case",
        "operationId": "updateCaseById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "case id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "in": "body",
            "name": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Case"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "$ref": "#/definitions/Case"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Case"
        ],
        "summary": "更新指定id的case",
        "description": "更新指定id的case",
        "operationId": "deleteCaseById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "case id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "type": "object",
              "properties": {
                "deleteresult": {
                  "type": "string"
                },
                "deleteddata": {
                  "$ref": "#/definitions/Case"
                }
              }
            }
          }
        }
      }
    },
    "/param": {
      "get": {
        "tags": [
          "Param"
        ],
        "summary": "返回所有的param",
        "description": "返回所有的param",
        "operationId": "createParam",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Param"
              }
            }
          }
        }
      }
    },
    "/param/{caseid}": {
      "get": {
        "tags": [
          "Param"
        ],
        "summary": "返回指定caseid的param",
        "description": "返回指定caseid的param",
        "operationId": "getParamByCaseId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "caseid",
            "description": "case id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "$ref": "#/definitions/Param"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Param"
        ],
        "summary": "更新指定caseid的param",
        "description": "更新指定caseid的param",
        "operationId": "updateParamByCaseId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "case id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "in": "body",
            "name": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Param"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "$ref": "#/definitions/Param"
            }
          }
        }
      }
    },
    "/plan": {
      "get": {
        "tags": [
          "Plan"
        ],
        "summary": "返回所有的plan",
        "description": "返回所有的plan",
        "operationId": "createPlan",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Plan"
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Plan"
        ],
        "summary": "创建plan",
        "description": "创建plan",
        "operationId": "createPlan",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Plan"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "$ref": "#/definitions/Plan"
            }
          }
        }
      }
    },
    "/plan/{id}": {
      "get": {
        "tags": [
          "Plan"
        ],
        "summary": "返回指定id的plan",
        "description": "返回指定id的plan",
        "operationId": "getPlanById",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "$ref": "#/definitions/Plan"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Component"
        ],
        "summary": "更新指定id的plan",
        "description": "更新指定id的plan",
        "operationId": "updatePlanById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "plan id",
            "required": true,
            "type": "integer",
            "format": "int32"
          },
          {
            "in": "body",
            "name": "body",
            "description": "",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Plan"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "$ref": "#/definitions/Plan"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Plan"
        ],
        "summary": "更新指定id的plan",
        "description": "更新指定id的plan",
        "operationId": "deletePlanById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "plan id",
            "required": true,
            "type": "integer",
            "format": "int32"
          }
        ],
        "responses": {
          "200": {
            "description": "正常",
            "schema": {
              "type": "object",
              "properties": {
                "deleteresult": {
                  "type": "string"
                },
                "deleteddata": {
                  "$ref": "#/definitions/Plan"
                }
              }
            }
          }
        }
      }
    }
  },

  "definitions": {
    "File": {
      "type": "object",
      "properties": {
        "filename": {
          "type": "string"
        },
        "size": {
          "type": "integer",
          "format": "int32"
        },
        "createtimestamp": {
          "type": "string"
        },
        "modifytimestamp": {
          "type": "string"
        }
      }
    },
    "Case": {
      "type": "object",
      "required": [
        "description",
        "components"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "createtimestamp": {
          "type": "string"
        },
        "updatetimestamp": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "components": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "componentid": {
                "type": "string"
              },
              "index": {
                "type": "integer",
                "format": "int32"
              }
            }
          }
        }
      }
    },
    "Component": {
      "type": "object",
      "required": [
        "description",
        "actions"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "createtimestamp": {
          "type": "string"
        },
        "updatetimestamp": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "actions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "description": {
                "type": "string"
              },
              "actionType": {
                "type": "string",
                "enum": ["openUrl", "click", "input", "checkbox", "verifyText", "fileUpload", "select", "hover", "conditionCheck"]
              },
              "actionParam": {
                "type": "string"
              },
              "objectXpath": {
                "type": "string"
              },
              "ObjectParams": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "frame": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "Param": {
      "type": "object",
      "required": [
        "caseid",
        "description",
        "params"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "createtimestamp": {
          "type": "string"
        },
        "updatetimestamp": {
          "type": "string"
        },
        "caseid": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "params": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "Plan": {
      "type": "object",
      "required": [
        "description",
        "cases"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "createtimestamp": {
          "type": "string"
        },
        "updatetimestamp": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "cases": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "ErrorResponse": {
      "type": "object",
      "properties": {
        "errorInfo": {
          "type": "object",
            "properties": {
              "statusCode": {
                "type": "integer",
                "format": "int32"
              },
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
        },
        "errorDetail": {
          "type": "string"
        }
      }
    }
  }
}