- 12 Oct 2023
- 3 Minutes to read
- Print
- DarkLight
Bamboo
- Updated on 12 Oct 2023
- 3 Minutes to read
- Print
- DarkLight
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
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
Deploy the bamboo server
Add a remote agent to the Bamboo server that is configured on your system.
Create a new build plan for your project.
Select a project and configure your plan
Link your repository to your build plan
Authenticate your repository
If the "Source code checkout" task is not added by default, add it manually to your job tasks.
Add another task of “script” to your job tasks, and insert the following script into it:
- 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
- For windows
cd %bamboo.build.working.directory% set PATH=%APPDATA%\npm;%PATH% npm install npm run android
- 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 ```
- For Linux
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
- Save the changes and then proceed to run the build. The logs will reflect the build progress
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.