Ghost Inspector Integration

Ghost Inspector lets you create and manage UI tests that check specific functionality in your website or application. It executes these tests continuously from the cloud and alert you if anything breaks.

What does Opsgenie offer Ghost Inspector users?

Ghost Inspector sends webhook notifications on test executions. With Opsgenie's Ghost Inspector integration, Opsgenie acts as a dispatcher for these alerts, determines the right people to notify based on on-call schedules– notifies via email, text messages (SMS), phone calls, and iPhone & Android push notifications, and escalates alerts until the alert is acknowledged or closed.

Opsgenie also attaches screenshot images from tests to the alert. Links to the images are also provided in the alert.

Functionality of the integration

  • When a test fails in Ghost Inspector, an alert is created in Opsgenie automatically through the integration.

Add Ghost Inspector integration in Opsgenie

  1. Please create an Opsgenie account if you haven't done so already.
  2. Go to Opsgenie Ghost Inspector Integration page.

For Free and Essentials plans, you can only add the integrations from the Team Dashboards, please use the alternative instructions given below to add this integration.

  1. Specify who is notified of Ghost Inspector alerts using the Teams field. Auto-complete suggestions are provided as you type.

An alternative for Step 2) and Step 3) is to add the integration from the Team Dashboard of the team which will own the integration. To add an integration directly to a team, navigate to the Team Dashboard and open Integrations tab. Click Add Integration and select the integration that you would like to add.

  1. Copy the integration URL. URL includes Opsgenie's endpoint as well as the API key.
  2. Click Save Integration.

Configuration on Ghost Inspector

  1. In Ghost Inspector App, create a new test suite and define new test in it, if not already created.
  2. Go to the settings of a test.
  3. Find Webhook Settings at the bottom of the settings page.
  4. Paste the URL you copied before into Add Webhook URL field and click the plus icon.
  5. Click Save.

Sample payload sent from Ghost Inspector to Opsgenie Close

{
  "type": "result",
  "data": {
    "__v": 0,
    "executionTime": 21641,
    "dateExecutionFinished": "2014-12-26T12:44:16.238Z",
    "endUrl": "https://www.opsgenie.com/alert/create",
    "dateExecutionStarted": "2014-12-26T12:43:54.597Z",
    "startUrl": "https://www.opsgenie.com/auth/login",
    "test": {
      "_id": "549d11f534fd04ab414f1bd7",
      "name": "Create Alert",
      "suite": "549d10e134fd04ab414f1bd6",
      "organization": "549c158c8eebf29b7976b7b8"
    },
    "screenshotCompare": {
      "compareSmall": {
        "depth": 8,
        "format": "PNG",
        "oname": "549d580a52a9666f152ffb33-compare.png",
        "mtime": "2014-12-26T12:44:18.000Z",
        "ctime": "2014-12-26T12:44:18.000Z",
        "size": 27425,
        "path": "/screenshots/549d580a52a9666f152ffb33-compareSmall.png",
        "defaultUrl": "https://ghostinspector.s3.amazonaws.com/screenshots/549d580a52a9666f152ffb33-compareSmall.png",
        "dims": {
          "w": 320,
          "h": 240
        }
      },
      "compareOriginal": {
        "depth": 8,
        "format": "PNG",
        "oname": "549d580a52a9666f152ffb33-compare.png",
        "mtime": "2014-12-26T12:44:18.000Z",
        "ctime": "2014-12-26T12:44:18.000Z",
        "size": 41948,
        "path": "/screenshots/549d580a52a9666f152ffb33-compareOriginal.png",
        "defaultUrl": "${url}?",
        "dims": {
          "w": 1024,
          "h": 768
        }
      }
    },
    "screenshot": {
      "small": {
        "depth": 8,
        "format": "PNG",
        "oname": "549d580a52a9666f152ffb33.png",
        "mtime": "2014-12-26T12:44:17.000Z",
        "ctime": "2014-12-26T12:44:17.000Z",
        "size": 11532,
        "path": "/screenshots/549d580a52a9666f152ffb33-small.png",
        "defaultUrl": "https://ghostinspector.s3.amazonaws.com/screenshots/549d580a52a9666f152ffb33-small.png",
        "dims": {
          "w": 320,
          "h": 240
        }
      },
      "original": {
        "depth": 8,
        "format": "PNG",
        "oname": "549d580a52a9666f152ffb33.png",
        "mtime": "2014-12-26T12:44:16.000Z",
        "ctime": "2014-12-26T12:44:16.000Z",
        "size": 34474,
        "path": "/screenshots/549d580a52a9666f152ffb33-original.png",
        "defaultUrl": "${url}",
        "dims": {
          "w": 1024,
          "h": 768
        }
      }
    },
    "_id": "549d580a52a9666f152ffb33",
    "video": {
      "path": "/videos/549d580a52a9666f152ffb33.mp4",
      "url": "https://ghostinspector.s3.amazonaws.com/videos/549d580a52a9666f152ffb33.mp4",
      "dims": {
        "w": 1024,
        "h": 768
      }
    },
    "screenshotCompareDifference": 0.118959,
    "screenshotComparePassing": false,
    "passing": false,
    "console": [],
    "urls": [
      "https://www.opsgenie.com/auth/login",
      "https://www.opsgenie.com/auth/signIn",
      "https://www.opsgenie.com/customer/welcome",
      "https://www.opsgenie.com/alert/index",
      "https://www.opsgenie.com/alert/create"
    ],
    "steps": [
      {
        "target": "#login",
        "command": "click",
        "value": "",
        "url": "https://www.opsgenie.com/auth/login",
        "dateExecuted": "2014-12-26T12:43:56.719Z",
        "_id": "549d580c52a9666f152ffb34",
        "passing": true,
        "optional": false,
        "private": false,
        "sequence": 0
      },
      {
        "target": "#login",
        "command": "assign",
        "value": "abc@gmail.com",
        "url": "https://www.opsgenie.com/auth/login",
        "dateExecuted": "2014-12-26T12:43:57.897Z",
        "_id": "549d580d52a9666f152ffb35",
        "passing": true,
        "optional": false,
        "private": false,
        "sequence": 1
      },
      {
        "target": "#password",
        "command": "assign",
        "value": "123",
        "url": "https://www.opsgenie.com/auth/login",
        "dateExecuted": "2014-12-26T12:43:58.518Z",
        "_id": "549d580e52a9666f152ffb36",
        "passing": true,
        "optional": false,
        "private": true,
        "sequence": 2
      },
      {
        "target": "#password",
        "command": "keypress",
        "value": "13",
        "url": "https://www.opsgenie.com/auth/login",
        "dateExecuted": "2014-12-26T12:43:59.098Z",
        "_id": "549d580f52a9666f152ffb37",
        "passing": true,
        "optional": false,
        "private": false,
        "sequence": 3
      },
      {
        "target": "a[href=/alert/create] > .l.title",
        "command": "click",
        "value": "",
        "url": "https://www.opsgenie.com/alert/index",
        "dateExecuted": "2014-12-26T12:44:03.269Z",
        "_id": "549d581352a9666f152ffb38",
        "passing": true,
        "optional": false,
        "private": false,
        "sequence": 4
      },
      {
        "target": "#message",
        "command": "click",
        "value": "",
        "url": "https://www.opsgenie.com/alert/create",
        "dateExecuted": "2014-12-26T12:44:04.767Z",
        "_id": "549d581452a9666f152ffb39",
        "passing": true,
        "optional": false,
        "private": false,
        "sequence": 5
      },
      {
        "target": "#message",
        "command": "assign",
        "value": "asdasd",
        "url": "https://www.opsgenie.com/alert/create",
        "dateExecuted": "2014-12-26T12:44:05.569Z",
        "_id": "549d581552a9666f152ffb3a",
        "passing": true,
        "optional": false,
        "private": false,
        "sequence": 6
      },
      {
        "target": "input[type=subm]",
        "command": "click",
        "value": "",
        "url": "https://www.opsgenie.com/alert/create",
        "error": "Element not found",
        "dateExecuted": "2014-12-26T12:44:15.885Z",
        "_id": "549d581f52a9666f152ffb3b",
        "passing": false,
        "optional": false,
        "private": false,
        "sequence": 7
      },
      {
        "target": ".alerts > .alertrow.clearfix.row:nth-of-type(2) > div:nth-of-type(2) > a.message.unseen",
        "command": "assertTextPresent",
        "value": "asdasd",
        "_id": "549d581f52a9666f152ffb3c",
        "passing": null,
        "optional": false,
        "private": false,
        "sequence": 8
      },
      {
        "target": "a[href=/alert/create] > .l.title",
        "command": "assertTextPresent",
        "value": "New Alert",
        "_id": "549d581f52a9666f152ffb3d",
        "passing": null,
        "optional": false,
        "private": false,
        "sequence": 9
      }
    ],
    "viewportSize": {
      "width": 1024,
      "height": 768
    }
  }
}

This payload is parsed by Opsgenie as:

{
  "passing": true,
  "screenshotComparePassing": false,
  "executionTime": 21641,
  "dateExecutionStarted": "2014-12-26T12:43:54.597Z",
  "startUrl": "https://www.opsgenie.com/auth/login",
  "testId": "549d11f534fd04ab414f1bd7",
  "testName": "Create Alert",
  "testSuite": "549d10e134fd04ab414f1bd6",
  "testOrganization": "549c158c8eebf29b7976b7b8",
  "steps": [
    {
      "target": "#login",
      "command": "click",
      "value": "",
      "url": "https://www.opsgenie.com/auth/login",
      "dateExecuted": "2014-12-26T12:43:56.719Z",
      "_id": "549d580c52a9666f152ffb34",
      "passing": true,
      "optional": false,
      "private": false,
      "sequence": 0
    },
    {
      "target": "#login",
      "command": "assign",
      "value": "abc@gmail.com",
      "url": "https://www.opsgenie.com/auth/login",
      "dateExecuted": "2014-12-26T12:43:57.897Z",
      "_id": "549d580d52a9666f152ffb35",
      "passing": true,
      "optional": false,
      "private": false,
      "sequence": 1
    },
    {
      "target": "#password",
      "command": "assign",
      "value": "123",
      "url": "https://www.opsgenie.com/auth/login",
      "dateExecuted": "2014-12-26T12:43:58.518Z",
      "_id": "549d580e52a9666f152ffb36",
      "passing": true,
      "optional": false,
      "private": true,
      "sequence": 2
    },
    {
      "target": "#password",
      "command": "keypress",
      "value": "13",
      "url": "https://www.opsgenie.com/auth/login",
      "dateExecuted": "2014-12-26T12:43:59.098Z",
      "_id": "549d580f52a9666f152ffb37",
      "passing": true,
      "optional": false,
      "private": false,
      "sequence": 3
    },
    {
      "target": "a[href=/alert/create] > .l.title",
      "command": "click",
      "value": "",
      "url": "https://www.opsgenie.com/alert/index",
      "dateExecuted": "2014-12-26T12:44:03.269Z",
      "_id": "549d581352a9666f152ffb38",
      "optional": false,
      "private": false,
      "sequence": 4
    },
    {
      "target": "#message",
      "command": "click",
      "value": "",
      "url": "https://www.opsgenie.com/alert/create",
      "dateExecuted": "2014-12-26T12:44:04.767Z",
      "_id": "549d581452a9666f152ffb39",
      "passing": true,
      "optional": false,
      "private": false,
      "sequence": 5
    },
    {
      "target": "#message",
      "command": "assign",
      "value": "asdasd",
      "url": "https://www.opsgenie.com/alert/create",
      "dateExecuted": "2014-12-26T12:44:05.569Z",
      "_id": "549d581552a9666f152ffb3a",
      "passing": true,
      "optional": false,
      "private": false,
      "sequence": 6
    },
    {
      "target": "input[type=subm]",
      "command": "click",
      "value": "",
      "url": "https://www.opsgenie.com/alert/create",
      "error": "Element not found",
      "dateExecuted": "2014-12-26T12:44:15.885Z",
      "_id": "549d581f52a9666f152ffb3b",
      "passing": false,
      "optional": false,
      "private": false,
      "sequence": 7
    },
    {
      "target": ".alerts > .alertrow.clearfix.row:nth-of-type(2) > div:nth-of-type(2) > a.message.unseen",
      "command": "assertTextPresent",
      "value": "asdasd",
      "_id": "549d581f52a9666f152ffb3c",
      "passing": null,
      "optional": false,
      "private": false,
      "sequence": 8
    },
    {
      "target": "a[href=/alert/create] > .l.title",
      "command": "assertTextPresent",
      "value": "New Alert",
      "_id": "549d581f52a9666f152ffb3d",
      "passing": null,
      "optional": false,
      "private": false,
      "sequence": 9
    }
  ],
  "testUrl": "https://app.ghostinspector.com/results/549d11f534fd04ab414f1bd7",
  "screenshotUrl": "${url}",
  "screenshotCompareUrl": "https://ghostinspector.s3.amazonaws.com/screenshots/549d580a52a9666f152ffb33-compareSmall.png"
}

Sample Alert