swagger: '2.0'
info:
  version: 1.0-20180811
  title: Testify REST API
  description: >-
    API specification for recording tests and results.

host: testify.msb-lab.com
basePath: /reporter/1.0
schemes:
  - https

  
#BEGIN PATHS
paths:
  /startrun:
    post:
      consumes:
        - application/x-www-form-urlencoded
      produces: 
        - application/json
      tags:
        - Start/Stop
      description: Start of a test run.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - in: formData
          name: runID
          type: "string"
          description: "The ID of the run (a group of tests) to create."
          required: true
        - in: formData
          name: environment
          type: "string"
          description: "This the environment the tests were run against."
        - in: formData
          name: buildNumber
          type: "string"
          description: "The build number of the automation tests."
      responses:
        '200':
          description: OK
          schema:
            type: string
        '401':
          description: Invalid login
        '500':
          description: Server error

  /endrun:
    post:
      consumes:
        - application/x-www-form-urlencoded
      produces: 
        - application/json
      tags:
        - Start/Stop
      description: End a test run.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - in: formData
          name: runID
          type: "string"
          description: "The ID of the run (a group of tests) to end."
          required: true
      responses:
        '200':
          description: OK
          schema:
            type: string
        '401':
          description: Invalid login
        '500':
          description: Server error
  /uploadresult:
    post:
      consumes:
        - multipart/form-data
      produces: 
        - application/json
      tags:
        - Data
      description: Start of a test run.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - in: formData
          name: runID
          type: "string"
          description: "The ID of the run (a group of tests) to end."
          required: true
        - in: formData
          name: resultID
          type: "string"
          description: "The ID of a test result "
          required: true
        - in: formData
          name: teamID
          type: "string"
          description: "id of the team the test belongs to"
          required: true
        - in: formData
          name: status
          type: "string"
          description: "result of a test"
          enum:
            - "pass"
            - "fail"
            - "retry"
            - "skip"
          required: true
        - in: formData
          name: startDate
          type: "string"
          description: "start time of the test in the following format yyyy-MM-dd HH:mm:ss.SSS"
        - in: formData
          name: duration
          type: "string"
          description: "number of milliseconds the test ran"
        - in: formData
          name: description
          type: "string"
          description: "description of the test"
        - in: formData
          name: suite
          type: "string"
          description: "name of the suite the test was run under"
        - in: formData
          name: class
          type: "string"
          description: "class name of the test"
        - in: formData
          name: method
          type: "string"
          description: "method name of the test"
        - in: formData
          name: category
          type: "string"
          description: "type of test (e.g. Store, Invoice, Nutrition)"
        - in: formData
          name: exception
          type: "string"
          description: "stack trace of the test assertion"
        - in: formData
          name: exceptionType
          type: "string"
          description: "user defined string specifying the type of excexption (e.g. timeout, ajax not complete, chromedriver)"
        - in: formData
          name: encodeException
          type: "boolean"
          description: "encode html tags in exception text"
          default: true
        - in: formData
          name: screenShot
          type: file
          description: "The file to upload." 
        - in: formData
          name: ipAddress
          type: "string"
          description: "IP Address from where the test was ran from"
      responses:
        '200':
          description: OK
          schema:
            type: string
        '401':
          description: Invalid login
        '500':
          description: Server error
  /uploadsuitelog:
    post:
      consumes:
        - multipart/form-data
      produces: 
        - application/json
      tags:
        - Data
      description: Upload a suite log after suite has completed.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - in: formData
          name: runID
          type: "string"
          description: "The ID of the run (a group of tests) to end."
          required: true
        - in: formData
          name: suiteName
          type: "string"
          description: "name of the suite the test was run under"
          required: true
        - in: formData
          name: suiteLog
          type: file
          description: "The file to upload." 
          required: true
      responses:
        '200':
          description: OK
          schema:
            type: string
        '401':
          description: Invalid login
        '500':
          description: Server error
#END PATHS

