API Documentation

Suite Result Resource

Search our documentation:

Toggle Documentation Menu

API: Suite Result Resource

Jump to...
  • Get - Fetch a single suite result
  • Cancel - Cancel an active suite run
  • List Test Results - Fetch an array of test results for a suite result
  • Get XUnit Report - Fetch an XML report of the suite result in XUnit v2 format


Get Suite Result

Fetch a single suite result

Request
GEThttps://api.ghostinspector.com/v1/suite-results/<suiteResultId>/?apiKey=<apiKey>
Parameters
apiKey
Your API key provided in your account
suiteResultId
The ID of the suite result to fetch
Response
{
  "code": "SUCCESS",
  "data": {
    "_id": "5967eaeebfebc5ba07c5b0ec",
    "suite": {
      "_id": "5967e6e7bfebc5ba07c5b0e3",
      "organization": "547fb82d92423992d52a4fea",
      "name": "API Samples"
    },
    "name": "API Samples",
    "startUrl": "",
    "dateCreated": "2017-07-13T21:49:34.373Z",
    "dateExecutionFinished": "2017-07-13T21:49:59.571Z",
    "dateExecutionStarted": "2017-07-13T21:49:34.373Z",
    "executionTime": 25198,
    "countScreenshotCompareUnknown": 0,
    "countScreenshotCompareFailing": 0,
    "countScreenshotComparePassing": 2,
    "countUnknown": 0,
    "countFailing": 0,
    "countPassing": 2,
    "screenshotComparePassing": true,
    "passing": true,
    "user": {
      "_id": "52df0d27fbaced54db000006",
      "name": "Sample User"
    }
  }
}


Cancel Suite Run

Cancel an active suite run

Request
POSThttps://api.ghostinspector.com/v1/suite-results/<suiteResultId>/cancel/?apiKey=<apiKey>
Parameters
apiKey
Your API key provided in your account
suiteResultId
The ID of the suite result to cancel
Response
{
  "code": "SUCCESS",
  "data": {
    "_id": "5967eaeebfebc5ba07c5b0ec",
    "suite": {
      "_id": "5967e6e7bfebc5ba07c5b0e3",
      "organization": "547fb82d92423992d52a4fea",
      "name": "API Samples"
    },
    "name": "API Samples",
    "startUrl": "",
    "dateCreated": "2017-07-13T21:49:34.373Z",
    "dateExecutionFinished": "2017-07-13T21:49:59.571Z",
    "dateExecutionStarted": "2017-07-13T21:49:34.373Z",
    "executionTime": 5382,
    "countScreenshotCompareUnknown": 2,
    "countScreenshotCompareFailing": 0,
    "countScreenshotComparePassing": 0,
    "countUnknown": 2,
    "countFailing": 0,
    "countPassing": 0,
    "screenshotComparePassing": null,
    "passing": null,
    "user": {
      "_id": "52df0d27fbaced54db000006",
      "name": "Sample User"
    }
  }
}


Suite Results – List Test Results

Fetch an array containing the test results in a suite result. Results are returned in the order they were created when the suite was triggered (typically alphabetical order by test name).

Request
GEThttps://api.ghostinspector.com/v1/suite-results/<suiteResultId>/results/?apiKey=<apiKey>
Parameters
apiKey
Your API key provided in your account
suiteResultId
The ID of the suite result containing the test results
count
The number of results to return (default 10, maximum 50)
offset
The number of results to offset the returned set by (default 0)
Response
{
  "code": "SUCCESS",
  "data": [
    {
      "_id": "5967f147bfebc5ba07c5b0f2",
      "uuid": "8d01572f-def6-42c6-9d6d-7cda00d5eb71",
      "test": {
        "_id": "5967e6fbbfebc5ba07c5b0e4",
        "suite": "5967e6e7bfebc5ba07c5b0e3",
        "organization": "547fb82d92423992d52a4fea",
        "name": "Test #1"
      },
      "suiteResult": "5967f147bfebc5ba07c5b0f1",
      "name": "Test #1",
      "browser": "slimerjs-52",
      "globalStepDelay": 250,
      "maxWaitDelay": 15000,
      "maxAjaxDelay": 10000,
      "finalDelay": 5000,
      "autoRetry": true,
      "failOnJavaScriptError": false,
      "screenshotCompareEnabled": true,
      "screenshotCompareThreshold": 0.1,
      "startUrl": "https://ghostinspector.com",
      "region": "us-east-1",
      "dateCreated": "2017-07-13T22:16:39.635Z",
      "screenshotCompareDifference": 0,
      "screenshotComparePassing": true,
      "passing": true,
      "console": [],
      "urls": [
        "https://ghostinspector.com/",
        "https://ghostinspector.com/learn-more/"
      ],
      "filters": [],
      "steps": [
        {
          "command": "click",
          "target": ".site-header [href=\"/learn-more/\"]",
          "value": "",
          "variableName": "",
          "url": "https://ghostinspector.com/",
          "dateExecuted": "2017-07-13T22:16:52.689Z",
          "passing": true,
          "optional": false,
          "private": false,
          "sequence": 0
        }
      ],
      "viewportSize": {
        "height": 768,
        "width": 1024
      },
      "user": {
        "_id": "52df0d27fbaced54db000006",
        "name": "Sample User"
      },
      "dateExecutionStarted": "2017-07-13T22:16:46.789Z",
      "executionHost": "prod012.ghostinspector.net",
      "dateExecutionFinished": "2017-07-13T22:16:58.910Z",
      "endUrl": "https://ghostinspector.com/learn-more/",
      "executionTime": 12121,
      "extractions": {},
      "screenshot": {
        "original": {
          "size": 585097,
          "dims": {
            "h": 3576,
            "w": 1024
          },
          "defaultUrl": "https://ghostinspector-prod.s3.amazonaws.com/screenshots/8d01572f-def6-42c6-9d6d-7cda00d5eb71-original.png",
          "path": "/screenshots/8d01572f-def6-42c6-9d6d-7cda00d5eb71-original.png"
        },
        "small": {
          "size": 218373,
          "dims": {
            "h": 1118,
            "w": 320
          },
          "defaultUrl": "https://ghostinspector-prod.s3.amazonaws.com/screenshots/8d01572f-def6-42c6-9d6d-7cda00d5eb71-small.png",
          "path": "/screenshots/8d01572f-def6-42c6-9d6d-7cda00d5eb71-small.png"
        }
      },
      "screenshotCompareBaselineResult": "5967eaeebfebc5ba07c5b0ed",
      "video": {
        "path": "/videos/8d01572f-def6-42c6-9d6d-7cda00d5eb71.mp4",
        "url": "https://ghostinspector-prod.s3.amazonaws.com/videos/8d01572f-def6-42c6-9d6d-7cda00d5eb71.mp4",
        "dims": {
          "w": 1024,
          "h": 768
        }
      }
    },
    {
      "_id": "5967f147bfebc5ba07c5b0f3",
      "uuid": "8085ac60-6578-4401-93bc-627efc51b10b",
      "test": {
        "_id": "5967e75abfebc5ba07c5b0e7",
        "suite": "5967e6e7bfebc5ba07c5b0e3",
        "organization": "547fb82d92423992d52a4fea",
        "name": "Test #2"
      },
      "suiteResult": "5967f147bfebc5ba07c5b0f1",
      "name": "Test #2",
      "browser": "slimerjs-52",
      "globalStepDelay": 250,
      "maxWaitDelay": 15000,
      "maxAjaxDelay": 10000,
      "finalDelay": 5000,
      "autoRetry": true,
      "failOnJavaScriptError": false,
      "screenshotCompareEnabled": true,
      "screenshotCompareThreshold": 0.1,
      "startUrl": "http://ghostinspector.com/docs/",
      "region": "us-east-1",
      "dateCreated": "2017-07-13T22:16:39.711Z",
      "screenshotCompareDifference": 0.001,
      "screenshotComparePassing": true,
      "passing": true,
      "console": [
        {
          "output": "Sample console error...",
          "error": false,
          "url": "https://ghostinspector.com/docs/?q=frames",
          "dateExecuted": "2017-07-13T22:16:52.665Z"
        }
      ],
      "urls": [
        "http://ghostinspector.com/docs/",
        "https://ghostinspector.com/docs/?q=frames"
      ],
      "filters": [],
      "steps": [
        {
          "command": "assign",
          "target": ".header-search-input",
          "value": "frames",
          "variableName": "",
          "url": "https://ghostinspector.com/docs/",
          "dateExecuted": "2017-07-13T22:16:51.385Z",
          "passing": true,
          "optional": false,
          "private": false,
          "sequence": 0
        },
        {
          "command": "click",
          "target": ".header-search-button",
          "value": "",
          "variableName": "",
          "url": "https://ghostinspector.com/docs/",
          "dateExecuted": "2017-07-13T22:16:52.185Z",
          "passing": true,
          "optional": false,
          "private": false,
          "sequence": 1
        },
        {
          "command": "assertTextPresent",
          "target": ".content .search-input",
          "value": "frames",
          "variableName": "",
          "url": "https://ghostinspector.com/docs/?q=frames",
          "dateExecuted": "2017-07-13T22:16:54.028Z",
          "passing": true,
          "optional": false,
          "private": false,
          "sequence": 2
        },
        {
          "command": "extract",
          "target": "title",
          "value": "",
          "variableName": "pageTitle",
          "url": "https://ghostinspector.com/docs/?q=frames",
          "extracted": "Documentation - Ghost Inspector",
          "dateExecuted": "2017-07-13T22:16:54.503Z",
          "passing": true,
          "optional": false,
          "private": false,
          "sequence": 3
        }
      ],
      "viewportSize": {
        "height": 768,
        "width": 1024
      },
      "user": {
        "_id": "52df0d27fbaced54db000006",
        "name": "Sample User"
      },
      "dateExecutionStarted": "2017-07-13T22:16:48.066Z",
      "executionHost": "prod012.ghostinspector.net",
      "dateExecutionFinished": "2017-07-13T22:17:00.081Z",
      "endUrl": "https://ghostinspector.com/docs/?q=frames",
      "executionTime": 12015,
      "extractions": {
        "pageTitle": "Documentation - Ghost Inspector"
      },
      "screenshot": {
        "original": {
          "size": 237259,
          "dims": {
            "h": 2232,
            "w": 1024
          },
          "defaultUrl": "https://ghostinspector-prod.s3.amazonaws.com/screenshots/8085ac60-6578-4401-93bc-627efc51b10b-original.png",
          "path": "/screenshots/8085ac60-6578-4401-93bc-627efc51b10b-original.png"
        },
        "small": {
          "size": 92210,
          "dims": {
            "h": 698,
            "w": 320
          },
          "defaultUrl": "https://ghostinspector-prod.s3.amazonaws.com/screenshots/8085ac60-6578-4401-93bc-627efc51b10b-small.png",
          "path": "/screenshots/8085ac60-6578-4401-93bc-627efc51b10b-small.png"
        }
      },
      "screenshotCompareBaselineResult": "5967ee29d078e8ba058b2458",
      "video": {
        "path": "/videos/8085ac60-6578-4401-93bc-627efc51b10b.mp4",
        "url": "https://ghostinspector-prod.s3.amazonaws.com/videos/8085ac60-6578-4401-93bc-627efc51b10b.mp4",
        "dims": {
          "w": 1024,
          "h": 768
        }
      }
    }
  ]
}


Suite Results – Get XUnit XML Report

Fetch an XML report (XUnit v2) for the latest suite result.

Request
GEThttps://api.ghostinspector.com/v1/suite-results/<suiteResultId>/xunit/?apiKey=<apiKey>
Parameters
apiKey
Your API key provided in your account
suiteResultId
The ID of the suite result containing the test results
Response
<assemblies>
  <assembly test-framework="Ghost Inspector" name="Ghost Inspector Suites" run-date="2018-10-03" run-time="17:17:24" time="45.071" passed="2" failed="0" skipped="0" total="2" config-file="/no-config-file" environment="browser">
    <collection name="Promises - Chrome" time="45.071" passed="2" failed="0" skipped="0" total="2">
      <test name="Promises - Chrome" type="browser" method="Promises - Chrome" time="26.205" result="Pass">
        <traits>
          <trait/>
        </traits>
      </test>
      <test name="Verify > Promises - Chrome" type="browser" method="Verify > Promises - Chrome" time="10.386" result="Pass">
        <traits>
          <trait/>
        </traits>
      </test>
    </collection>
    <errors/>
  </assembly>
</assemblies>