CAPABILITY GENERATOR

LambdaTest DocumentationAutomation Testing ● Bitbucket Pipelines Integration With LambdaTest

Bitbucket Pipelines Integration With LambdaTest


Bitbucket Pipelines offers a free, automated continuous integration service through Bitbucket cloud servers. With Bitbucket Pipelines teams can ship their product faster as they could rapidly test their code as soon as they commit. Once the code is tested, Bitbucket Pipeline deploys it into the Production environment automatically. It does so with the help of containers that can be fully customized according to your project requirements.

LambdaTest integration with Bitbucket Pipelines will help you perform cross browser testing on 2000+ real browsers & browser versions, through a Selenium Grid hosted on LambdaTest cloud servers. All you need is to set up your Bitbucket Pipelines with your LambdaTest account & you can trigger tests onto LambdaTest, directly from your Bitbucket Pipelines.

In this topic, you will learn about the:

  • Prerequisites
  • Setup for integrating LambdaTest with Bitbucket Pipelines
  • Parallel execution on LambdaTest Selenium Grid

Prerequisites


Important: Visit LambdaTest GitHub repository for Bitbucket Pipelines.

  • Make sure you have your Bitbucket Credentials.
  • LambdaTest Authentication Credentials
  • Be aware of your LambdaTest authentication credentials i.e. your LambdaTest username, access key and HubURL. You need to set them up as your environment variables. You can retrieve them from your LambdaTest automation dashboard by clicking on the key icon near the help button.

    • For Linux/Mac:
    • For Windows:

Integrating LambdaTest With Bitbucket Pipelines


Step 1: Login to your Bitbucket account. Go to repositories & import the LambdaTest Git repository for Bitbucket Pipelines. You will be facing the below screen after import is successful.

after import screen

Step 2: After importing the Git repository, fetch the yml file to run your automation tests using Protractor framework on LambdaTest Selenium Grid.

Step 3: Now, you need to add LambdaTest envrionment variables into your Bitbucket pipelines. These envrionment variables will help to authenticate you test before they are executed on LambdaTest Selenium Grid. Go to Settings General Username aliases Repository variables.

LambdaTest Environment Variables

Step 4: After adding the environment variables, you need to visit your pipeline & click on Rerun.

Go to pipelines & hit rerun

Step 5: Run the below command to execute a test on LambdaTest Selenium Grid.

You will find the below log generated:

> protractor-lambdatest@0.1.0 single /opt/atlassian/pipelines/agent/build
> protractor conf/single.conf.js
[10:23:53] I/launcher - Running 1 instances of WebDriver
[10:23:53] I/hosted - Using the selenium server at https://LT_USERNAME:LT_ACCESS_KEY@hub.lambdatest.com/wd/hub
Started
.
1 spec, 0 failures
Finished in 7.713 seconds
[10:24:10] I/launcher - 0 instance(s) of WebDriver still running
[10:24:10] I/launcher - chrome67.0 #01 passed

Running Tests In Parallel On LambdaTest Selenium Grid


LambdaTest Selenium Grid will help you execute multiple test cases in parallel. You can run a single test scenario over numerous browsers + OS combinations, simultaneously. You could also run different test cases in a similar browser + OS combinations. This would significantly trim down the time taken on your cross browser testing activities.

For running test in parallel, replace the run command from single to parallel as you update the pipeline’s yml file.

Replace: npm run single
With: npm run parallel