Bamboo
  • 12 Oct 2023
  • 3 Minutes to read
  • Dark
    Light

Bamboo

  • Dark
    Light

Article Summary

Overview

Bamboo is a tool for continuous integration (CI) that helps automate the process of building, testing, integrating, and managing the release of software applications. It facilitates the creation of a pipeline for continuous delivery.

Integrating pCloudy with Bamboo allows you to conduct testing of web and native applications on 5000 device-browser combinations through an Appium server located on pCloudy cloud servers. To achieve this, you only need to establish a connection between your pCloudy account and Bamboo, which enables you to initiate tests on pCloudy from Bamboo.

Prerequisites

  • You need to have a Bamboo server installed on your system.

  • You can use any of the following operating systems

    1. Windows
    2. Linux
    3. Mac OS X.
  • Install Node.js version 20 on your system.

  • Install NPM (Node Package Manager) on your system. It's recommended to use the latest version available.

  • You should have an account with a supported repository provider such as GitHub or Bitbucket.

  • You should have access to the Sample-Mocha-project repository in your repository provider account.

Steps to Integrate pCloudy With Bamboo

  1. Deploy the bamboo server

  2. Add a remote agent to the Bamboo server that is configured on your system.

  3. Create a new build plan for your project.
    image.png

  4. Select a project and configure your plan
    image.png

  5. Link your repository to your build plan
    image.png

  6. Authenticate your repository
    image.png

  7. If the "Source code checkout" task is not added by default, add it manually to your job tasks.
    image.png

  8. Add another task of “script” to your job tasks, and insert the following script into it:

    1. For Linux
      #!/bin/bash
      
      export PATH=/home/administrator/.nvm/versions/node/v20.0.0/bin:$PATH
      cd ${bamboo.build.working.directory}
      npm install
      npm run android
      
    2. For windows
      cd %bamboo.build.working.directory%
      set PATH=%APPDATA%\npm;%PATH%
      npm install
      npm run android
      
    3. For Mac OS X
        cd ${bamboo.build.working.directory}
        export PATH=/Users/<username>/.nvm/versions/node/v20.0.0/bin:$PATH
        npm install
        npm run android
        ```
    

The script sets the environment variable to Node.js version 20.0.0, goes to the build plan's working directory, installs dependencies using npm install, and runs tests with npm run android. However, the path in the export PATH command may vary based on the Node.js installation location on your system
image.png

  1. Save the changes and then proceed to run the build. The logs will reflect the build progress
    image.png

For every push in the repository the build will trigger in the background

Note that these steps are essential for setting up the integration between pCloudy and Bamboo. By following these steps, you can leverage the benefits of pCloudy's cloud-based testing infrastructure and run your Mocha-Test-code on multiple device-browser combinations. This can help you identify issues early in the development process and improve the overall quality of your code.

The given code shows the desired capabilities needed to execute the Sample-test.

capabilities = {
        "browserName": "",
        "pCloudy_Username": "Enter-Email",
        "pCloudy_ApiKey": "Enter API-Key",
        "pCloudy_ApplicationName": "pCloudyAppiumDemo.apk",
        "pCloudy_DurationInMinutes": "10",
        "pCloudy_DeviceFullName":  
"GOOGLE_Pixel2XL_Android_11.0.0_d22ac",
        "platformName": "Android",
        "automationName": "uiautomator2",
        "newCommandTimeout": "600",
        "launchTimeout": "90000",
        "appPackage": "com.pcloudy.appiumdemo",
        "appActivity": "com.ba.mobile.LaunchActivity",
        "pCloudy_EnableVideo" : "true", # optional
    };

The "pCloudy_Username" and "pCloudy_ApiKey" fields can be customized as per the user's credentials.

Parallel Test

To enable parallel testing, you need to upload the parallel-Test-code to your repository. Once you have done this, you will need to specify the desired capabilities required to execute the Sample-test. .

commonCapabilities: {
              browserName: "",
              pCloudy_Username:"Enter-Email",
              pCloudy_ApiKey: "Enter API KEY",
              pCloudy_ApplicationName: "pCloudyAppiumDemo.apk",
              pCloudy_DurationInMinutes: "10",
              platformName: "Android",
              automationName: "uiautomator2",
              newCommandTimeout: "600",
              launchTimeout : "90000",
              appPackage: "com.pcloudy.appiumdemo",
              appActivity: "com.ba.mobile.LaunchActivity",
              pCloudy_EnableVideo : "true",
        },
        multiCapabilities: [
          {
              "pCloudy_DeviceFullName": "GOOGLE_Pixel7Pro_Android_13.0.0_dbf82",
          },
          {
              "pCloudy_DeviceFullName": "MOTOROLA_Edge30Ultra_Android_12.0.0_15b11",
          }

The commonCapabilities field contains properties such as browserName, pCloudy_Username, and pCloudy_ApiKey, which need to be customized as per your credentials. In the multiCapabilities field, you can add as many devices as you require by specifying the pCloudy_DeviceFullName property for each device. This will enable you to execute the Sample-test on multiple device-browser combinations in parallel, leveraging the benefits of pCloudy's cloud-based testing infrastructure.


Was this article helpful?

What's Next