API Documentation

Suite Resource

Search our documentation:

Toggle Documentation Menu

API: Suite Resource

Jump to...


List Suites

Fetch an array of all the suites in your account.

Request
GEThttps://api.ghostinspector.com/v1/suites/?apiKey=<apiKey>
Parameters
apiKey
Your API key provided in your account
Response
{
  "code": "SUCCESS",
  "data": [
    {
      "_id": "53322c9fe3db0fcd624cc0a6",
      "organization": {
        "_id": "52df0d27fbaced54db000006",
        "name": "Organization Name"
      },
      "dateCreated": "2014-03-26T01:25:51.804Z",
      "testCount": 3,
      "name": "Sample Suite #1"
    },
    {
      "_id": "53371f015e626de203bbb3f6",
      "organization": {
        "_id": "52df0d27fbaced54db000006",
        "name": "Organization Name"
      },
      "dateCreated": "2014-03-29T19:29:05.645Z",
      "testCount": 2,
      "name": "Sample Suite #2"
    }
  ]
}


Get Suite

Fetch a single suite

Request
GEThttps://api.ghostinspector.com/v1/suites/<suiteId>/?apiKey=<apiKey>
Parameters
apiKey
Your API key provided in your account
suiteId
The ID of the suite to fetch
Response
{
  "code": "SUCCESS",
  "data": {
    "_id": "53322c9fe3db0fcd624cc0a6",
    "organization": {
      "_id": "52df0d27fbaced54db000006",
      "name": "Organization Name"
    },
    "dateCreated": "2014-03-26T01:25:51.804Z",
    "testCount": 3,
    "name": "Sample Suite"
  }
}


Execute Suite

Execute all the tests in a suite and returns an array of results.

Note: We execute tests concurrently, however this request can still take some time to return. In general, it will return in the time that it takes to run your longest test; however, this can vary depending on the load on our system and the number of tests being run. We’d suggest programming your request to deal with response times up to 20 minutes. If all the suite's tests are not completed within 20 minutes, the API will send a timeout error (although your tests will still be triggered).
Request
GEThttps://api.ghostinspector.com/v1/suites/<suiteId>/execute/?apiKey=<apiKey>&startUrl=<startUrl>
Parameters
apiKey
Your API key provided in your account
suiteId
The ID of the suite to execute
startUrl
(Optional) Alternate start URL to use for all tests in this execution only
viewport
(Optional) Alternate screen size to use for all tests in this execution only. This should be a string formatted as {width}x{height}, for example 1024x768.
userAgent
(Optional) Alternate user agent to use for all tests in this execution only
region
(Optional) Geo-location for test execution. The following options are available: us-east-1 (default), us-west-1, ca-central-1, eu-central-1, eu-west-1, eu-west-2, ap-northeast-1, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-south-1, sa-east-1
httpAuthUsername
(Optional) Alternate HTTP authentication username to use for this execution only
httpAuthPassword
(Optional) Alternate HTTP authentication password to use for this execution only
disableNotifications
(Optional) Use 1 to disable all notifications for this execution only
immediate
(Optional) Use 1 to initiate the execution, then immediate return a response (without results)
dataFile
(Optional) A CSV file containing a row of variable values for each suite run as outlined in our data-driven testing section. A POST request must be used when sending this file. When included, an array of suite results will be returned instead of an array of test result.
[varName]
(Optional) Pass in custom variables for the suite run that are accessible in your steps via {{varName}}. For example, including &firstName=Justin in the API call will create a {{firstName}} variable with the value Justin in each test run.
Response
{
  "code": "SUCCESS",
  "data": [
    {
      "_id": "53516d4fe0d6891bf054be20",
      "dateExecutionFinished": "2014-04-18T18:22:28.867Z",
      "dateExecutionStarted": "2014-04-18T18:22:07.487Z",
      "startUrl": "http://www.wiregrassweddings.com/",
      "endUrl": "https://www.wiregrassweddings.com/cart/",
      "test": {
        "_id": "5336e4e3a8f4f9d571af19f8",
        "name": "Wiregrass Weddings",
        "suite": "5330e25967076985585532fb",
        "organization" : "52df0d27fbaced54db000006"
      },
      "screenshot": {
        "small": {
          "depth": 8,
          "format": "PNG",
          "oname": "53516d4fe0d6891bf054be20.png",
          "mtime": "2014-04-18T18:22:29.000Z",
          "ctime": "2014-04-18T18:22:29.000Z",
          "size": 54219,
          "path": "/screenshots/53516d4fe0d6891bf054be20-small.png",
          "defaultUrl": "https://ghostinspector.s3.amazonaws.com/screenshots/53516d4fe0d6891bf054be20-small.png",
          "dims": {
            "w": 320,
            "h": 347
          }
        },
        "original": {
          "depth": 8,
          "format": "PNG",
          "oname": "53516d4fe0d6891bf054be20.png",
          "mtime": "2014-04-18T18:22:28.000Z",
          "ctime": "2014-04-18T18:22:28.000Z",
          "size": 235950,
          "path": "/screenshots/53516d4fe0d6891bf054be20-original.png",
          "defaultUrl": "https://ghostinspector.s3.amazonaws.com/screenshots/53516d4fe0d6891bf054be20-original.png",
          "dims": {
            "w": 1024,
            "h": 1109
          }
        }
      },
      "screenshotCompareDifference": null,
      "screenshotComparePassing": null,
      "video": {
        "dims": {
          "w": 1024,
          "h": 768
        },
        "path": "/videos/53516d4fe0d6891bf054be20.mp4",
        "url": "https://ghostinspector.s3.amazonaws.com/videos/53516d4fe0d6891bf054be20.mp4"
      },
      "passing": true,
      "console": [...],
      "steps": [...],
      "extractions": {...},
      "viewportSize": {
        "height": 768,
        "width": 1024
      }
    },
    {
      "_id": "53516d4f6d82171cf09d9a19",
      "dateExecutionFinished": "2014-04-18T18:22:18.280Z",
      "dateExecutionStarted": "2014-04-18T18:22:07.203Z",
      "startUrl": "https://www.google.com/",
      "endUrl": "https://www.google.com/#q=ghosts",
      "test": {
        "_id": "5335c6a5f6d88b3069f1ac06",
        "name": "Google Test",
        "suite": "5330e25967076985585532fb",
        "organization" : "52df0d27fbaced54db000006"
      },
      "screenshot": {
        "small": {
          "depth": 8,
          "format": "PNG",
          "oname": "53516d4f6d82171cf09d9a19.png",
          "mtime": "2014-04-18T18:22:18.000Z",
          "ctime": "2014-04-18T18:22:18.000Z",
          "size": 111737,
          "path": "/screenshots/53516d4f6d82171cf09d9a19-small.png",
          "defaultUrl": "https://ghostinspector.s3.amazonaws.com/screenshots/53516d4f6d82171cf09d9a19-small.png",
          "dims": {
            "w": 320,
            "h": 720
          }
        },
        "original": {
          "depth": 8,
          "format": "PNG",
          "oname": "53516d4f6d82171cf09d9a19.png",
          "mtime": "2014-04-18T18:22:18.000Z",
          "ctime": "2014-04-18T18:22:18.000Z",
          "size": 447220,
          "path": "/screenshots/53516d4f6d82171cf09d9a19-original.png",
          "defaultUrl": "https://ghostinspector.s3.amazonaws.com/screenshots/53516d4f6d82171cf09d9a19-original.png",
          "dims": {
            "w": 1024,
            "h": 2305
          }
        }
      },
      "screenshotCompareDifference": null,
      "screenshotComparePassing": null,
      "video": {
        "dims": {
          "w": 1024,
          "h": 768
        },
        "path": "/videos/53516d4fe0d6891bf054be20.mp4",
        "url": "https://ghostinspector.s3.amazonaws.com/videos/53516d4fe0d6891bf054be20.mp4"
      },
      "passing": true,
      "console": [...],
      "steps": [...],
      "extractions": {...},
      "viewportSize": {
        "height": 768,
        "width": 1024
      }
    }
  ]
}


List Suite Tests

Fetch an array of all the tests in a suite.

Request
GEThttps://api.ghostinspector.com/v1/suites/<suiteId>/tests/?apiKey=<apiKey>
Parameters
apiKey
Your API key provided in your account
suiteId
The ID of the suite containing the tests
Response
{
  "code": "SUCCESS",
  "data": [
    {
      "_id": "53323248ca5ec57161cf2637",
      "dateExecutionFinished": "2014-04-18T01:17:55.617Z",
      "dateExecutionStarted": "2014-04-18T01:17:27.569Z",
      "startUrl": "http://www.sampledomain1.com/",
      "suite": {
        "_id": "5330e25967076985585532fb",
        "name": "Suite Name"
      },
      "organization": {
        "_id": "52df0d27fbaced54db000006",
        "name": "Organization Name"
      },
      "dateCreated": "2014-03-26T01:50:00.968Z",
      "notifications": 0,
      "screenshotComparePassing": null,
      "screenshotCompareThreshold": 0.2,
      "screenshotCompareEnabled": false,
      "passing": false,
      "viewportSize": {
        "height": 768,
        "width": 1024
      },
      "testFrequency": 0,
      "name": "Test #1"
    },
    {
      "_id": "533232a2ca5ec57161cf263f",
      "dateExecutionFinished": "2014-04-18T01:22:30.420Z",
      "dateExecutionStarted": "2014-04-18T01:22:13.400Z",
      "startUrl": "http://www.sampledomain2.com/",
      "suite": {
        "_id": "5330e25967076985585532fb",
        "name": "Suite Name"
      },
      "organization": {
        "_id": "52df0d27fbaced54db000006",
        "name": "Organization Name"
      },
      "dateCreated": "2014-03-26T01:51:30.443Z",
      "notifications": 0,z
      "screenshotComparePassing": true,
      "screenshotCompareThreshold": 0.2,
      "screenshotCompareEnabled": true,
      "passing": true,
      "viewportSize": {
        "height": 768,
        "width": 1024
      },
      "testFrequency": 0,
      "name": "Test #2"
    }
  ]
}


List Suite Results

Fetch an array of suite results for a suite.

Request
GEThttps://api.ghostinspector.com/v1/suites/<suiteId>/results/?apiKey=<apiKey>
Parameters
apiKey
Your API key provided in your account
suiteId
The ID of the suite containing the results
Response
{
  "code": "SUCCESS",
  "data": [
    {
      "_id": "58337b24195c506820c7cbfd",
      "suite": {
        "_id": "57b0f2b6ed9a72081f9ca18d",
        "organization": "547fb82d92423992d52a4fea",
        "name": "Sample Suite"
      },
      "dateCreated": "2016-11-21T22:54:28.553Z",
      "dateExecutionFinished": "2016-11-21T22:55:08.841Z",
      "dateExecutionStarted": "2016-11-21T22:54:28.553Z",
      "executionTime": 40288,
      "countScreenshotCompareUnknown": 5,
      "countScreenshotCompareFailing": 0,
      "countScreenshotComparePassing": 0,
      "countUnknown": 0,
      "countFailing": 1,
      "countPassing": 4,
      "screenshotComparePassing": null,
      "passing": false
    },
    {
      "_id": "58337aac195c506820c7cbf7",
      "suite": {
        "_id": "57b0f2b6ed9a72081f9ca18d",
        "organization": "547fb82d92423992d52a4fea",
        "name": "Sample Suite"
      },
      "dateCreated": "2016-11-21T22:52:28.626Z",
      "dateExecutionFinished": "2016-11-21T22:53:08.912Z",
      "dateExecutionStarted": "2016-11-21T22:52:28.626Z",
      "executionTime": 40286,
      "countScreenshotCompareUnknown": 5,
      "countScreenshotCompareFailing": 0,
      "countScreenshotComparePassing": 0,
      "countUnknown": 0,
      "countFailing": 1,
      "countPassing": 4,
      "screenshotComparePassing": null,
      "passing": false
    }
  ]
}


Download Suite Tests in Selenium 1 Format (HTML)

Download a zip file of all tests in Selenium 1 format (HTML).

Request
GEThttps://api.ghostinspector.com/v1/suites/<suiteId>/export/selenium-html/?apiKey=<apiKey>
Parameters
apiKey
Your API key provided in your account
suiteId
The ID of the suite containing the tests
Response
[ Zip file containing all tests in Selenium HTML format will be returned ]


Download Suite Tests in Selenium 2 Format (JSON)

Download a zip file of all tests in Selenium 2 format (JSON).

Request
GEThttps://api.ghostinspector.com/v1/suites/<suiteId>/export/selenium-json/?apiKey=<apiKey>
Parameters
apiKey
Your API key provided in your account
suiteId
The ID of the suite containing the tests
Response
[ Zip file containing all tests in Selenium JSON format will be returned ]