Overview

Bamboo is a continuous integration server developed by Atlassian, that allows you to build, test, and deploy your web applications.

Prerequisites

  • We presume you have a working project to test that has been pushed to Github. And your tests are running properly in your local system.

  • Java and a database (eg: postgres, MySQL etc) must be installed; walkthrough the guide for supported versions

Setup Guide

I’m taking the nightwatch-examples repo for demonstration. Now, let's configure CI by following the procedures below :

Step 1: Installation and Configuration of Bamboo

  • Download the file and follow the installation instructions as per your operating system.

  • In order to complete the installation procedure, you must set up a database, which you may do by following this tutorial.

  • And this article will also assist you in getting started with the remote agent.

  • After completion of installation; you should follow the guide to run the setup wizard.

Step 2 : Sign In and create a plan

After installation, now you can sign in to the admin and create a plan after clicking the button displayed in the image below :

  1. Fill out the form accordingly by providing the information requested and then save the details.

  2. Link your repository with the project by filling in the following form and then save and continue the provided info

  3. And then select the agent environment

Step 3: Create tasks

  1. Create tasks where the source code checkout task will be default in our case. And to add new tasks click on Add task button

  2. Select npm task type by searching for it.

    image9
  3. In order to install all the dependencies you need to complete the form by typing install in the command input box and selecting Node.js executable, either custom or default.

    image10

    Note : In case while executing these commands you are getting errors in deafult Node.js executable. You may try using node version manager to install Node.js and get its path using which node command.

    image8

    And then add this path to create a new executable, as seen in the image below.

    image3
  4. In order to run the test cases you need to add another npm task type and type test in the command input box.

    But if you want to run the tests in headless mode or want to pass more arguments you may use the script task type in place of npm.

    npm install npx 
    npx nightwatch --headless
  5. Finally click on the create button and try running your tasks.

Step 4 : View the results of Bamboo Integration

Bamboo-results