Ghost Inspector – Cloud-Based solution for Web Automated Testing (Part II)

16 Nov, 2017 | 3 minutes read

Short Description

This article is a continuation of my previous one about Ghost Inspector. Here are described available reporting options, as well as, integration of Ghost Inspector with Jenkins for achieving Continues Delivery and Continuous Testing paradigm.

Ghost Inspector Plugin for Jenkins

Ghost Inspector offers you the opportunity to run your Test Suits from Jenkins. For that purpose, there is an official plugin for running Ghost Inspector Tests inside your Jenkins CI build process. First, you need to download ghost-inspector.hpi plugin file. The plugin can be installed from the Jenkins UI.

Steps for plugin installation in Jenkins:

  • Navigate to “Manage Jenkins” and then click on “Manage Plugins”.
Manage Jenkins
(Image 1 – Manage Jenkins)
  • After “Manage Plugins” screen is displayed, click on the “Advanced” tab and scroll down till “Upload Plugin” section. Here you will have to upload already downloaded ghost-inspector.hpi plugin file.
Upload Plugin in Jenkins
(Image 2 – Upload Plugin in Jenkins)

Configuring the Ghost Inspector plugin

Since the Ghost Inspector plugin is already installed, you should have a new build step option for running Tests. The next step is to create your Jenkins project.

Jenkins Project Creation
(Image 3 – Jenkins Project Creation)

Open the Project configuration from the Jenkins Dashboard and scroll down to the “Build” section. Click on “Add build step” and select the option “Run Ghost Inspector Test Suite”.

Add build step - Run Ghost Inspector Test Suite
(Image 4 – Add build step – Run Ghost Inspector Test Suite)

Now you will have to enter your API Key and Suite ID. You can find these values under Test suite and Account settings in your Ghost Inspector account.

Suite ID in Ghost Inspector
(Image 5 – Suite ID in Ghost Inspector)
API Key in Ghost Inspector
(Image 6 – API Key in Ghost Inspector)

At the end save your configuration changes in Jenkins after adding Ghost Inspector API Key and Suite ID.

Run Ghost Inspector Test Suite
(Image 7 – Run Ghost Inspector Test Suite)

E-mail Notification Setup in Ghost Inspector

If you want to receive email notifications about the results of the triggered test suite you can set it in Ghost Inspector. Notifications can be controlled on the test, suite and organization level. On Suite level under “Settings” there is “Notifications” option, so here you can enable email notifications, select frequency and add Recipient E-mail(s). For Email Alerts frequency are offered following options:

  • Send once if a test fails
  • Send once if a test fails, than once when everything passes again
  • Continue to send every time a test fails, than once when everything passes again
  • Send every time a suite is executed
  • Send every time a test is executed
Ghost Inspector-Notifications

Figure 8. Ghost Inspector-Notifications

So now if you schedule a build of your project in Jenkins, you can see the results in the Jenkins Console Output and also you will receive an email notification with the test results.

Test Suite Results in Jenkins Console Output
(Image 9 – Test Suite Results in Jenkins Console Output)
 Email with test results
(Image 10 – Email with test results)

If the user clicks on the link of the email results, he will be redirected to Ghost Inspector Test results and can see the results.

Test Results in Ghost Inspector
(Image 11 – Test Results in Ghost Inspector)

Conclusion

Ghost Inspector has very good integration with Jenkins and can be easily utilized as part of a continuous delivery process for web applications in the domain of automated test execution. In addition with its easy-to-configure e-mail reporting capabilities, it can provide information on the build status in terms of the status of executed tests. As I have stated in my previous blog, Ghost Inspector is a very solid test automation tool for web applications, which requires no configuration, is easy to learn and use, has good documentation, and with many useful options for test development or test status reporting. The main drawback is it limited browser support. As it can be seen from https://ghostinspector.com/docs/faq/#collapseFour currently supported browsers are Firefox and Chrome, where Chrome is supported only for paid versions. However, Ghost Inspector provides the capability for exporting developed tests in Selenium format if cross-browser testing is required.