Semaphore is a hosted continuous integration and deployment service used for testing and deploying software projects hosted on GitHub and BitBucket. While open source projects can use Semaphore for free in its full capacity, free use for private projects is limited to 100 builds per month.
LambdaTest now integrates with Semaphore CI to boost your go-to-market delivery. Perform automated cross browser testing, hand in hand with your CI/CD pipeline and ensure your web-app renders seamlessly on more than 2000 real browsers and browser versions. Using LambdaTest Selenium Grid, you can fully automate your continuous testing process and trim down your test cycles, significantly.
We will be performing demonstration by using the Protractor framework
1 |
$ brew install node |
1 |
npm install npm@latest -g |
1 2 |
$ export LT_USERNAME=<your lambdatest username> $ export LT_ACCESS_KEY=<your lambdatest access_key> |
A few changes in the .semaphore/semaphore.yml is all you need for integrating LambdaTest With Semaphore CI. The These changes would include replacing the environment variables such as access key, username, grid config and so on, according to your test configurations.
Here is a sample config file for integrating your LambdaTest account with your Semaphore CI instacnce. You can also find the below code at our GitHub repository of Semaphore.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
version: v1.0 name: Run Protractor Test In LambdaTest agent: machine: type: e1-standard-2 os_image: ubuntu1804 execution_time_limit: hours: 3 blocks: - name: Set Env Variables task: jobs: - name: NODE_ENV commands: - echo 'export LT_USERNAME="{your_lambdatest_username}"' >> ~/.bashrc - echo 'export LT_ACCESS_KEY="{your_lambda_access_key}"' >> ~/.bashrc - name: Run Tests task: jobs: - name: Run Protractor commands: - checkout - cd /home/semaphore/protractor-selenium-semaphore-sample - npm install - node node_modules/protractor/bin/protractor single.conf.js |
LambdaTest offers a Selenium Desired Capabilities Generator to fetch coded values for your desired test configurations.
For Instance, if you select the below configurations:
Then Capabilities Generator at LambdaTest will provide you with the below program:
1 2 3 4 5 6 7 8 9 10 11 |
var capabilities = { "build" : "your build name", //You can edit this and assign a build name "name" : "your test name", // Assign a name to your Test "platform" : "Windows 8.1", // The operating system on which you want to test your website "browserName" : "Firefox", // The browser on which you want to test "version" : "62.0", // The browser version which you've selected to perform the test upon "resolution" : "1280x1024", // The resolution in which you want to run the test as per your operating system "selenium_version" : "3.11.0", //The version of Selenium on which the test will run "visual" : true, "firefox.driver" : v0.21.0 } |
To help you perform cross browser testing of your locally stored web pages, LambdaTest provides an SSH(Secure Shell) tunnel connection with the name Lambda Tunnel. With Lambda Tunnel, you can execute a test server inside your Semaphore CI build container to perform automated cross browser testing on browsers offered by Selenium grid on LambdaTest. So you make sure how well your changes look, even before your customers. Curious to know more about Lambda Tunnel?
Follow our documentation on Lambda Tunnel to know it all. OS specific instructions to download and setup tunnel binary can be found at the following links.
Download the binary file of:
Now, let us take an example of Semaphore.yml for Lambda Tunnel.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
//Example of .semaphore/semaphore.yml for Lambda Tunnel version: v1.0 name: Run Protractor Test In LambdaTest agent: machine: type: e1-standard-2 os_image: ubuntu1804 execution_time_limit: hours: 3 blocks: - name: Set Env Variables task: jobs: - name: NODE_ENV commands: - ls -al - echo 'export LT_USERNAME=”<Your LT_USERNAME>”' >> .bashrc - echo 'export LT_ACCESS_KEY=”<Your LT_ACCESS_KEY>”' >> .bashrc - name: Set Tunnel task: jobs: - name: Download and install tunnel commands: - checkout - cd /home/semaphore/protractor-selenium-semaphore-sample - wget https://s3.amazonaws.com/lambda-tunnel/LT_Linux.zip #Extracting tunnel binary - sudo apt-get install unzip - unzip LT_Linux.zip #Executing tunnel library - ./LT -user ${LAMBDATEST_EMAIL} -key ${LAMBDATEST_KEY} & sleep 30 - name: Run Tests task: jobs: - name: Run Protractor commands: - checkout - cd /home/semaphore/protractor-selenium-semaphore-sample - npm install - node node_modules/protractor/bin/protractor single.conf.js |
Parallel Testing is one of the most demanding features of LambdaTest Selenium Grid. By parallel testing, you can run more than one test case, simultaneously. This means that Parallel testing would allow you to execute numerous automation test cases altogether. So you execute a single test scenario across different browsers or could run different test scenarios across the same browser but with different browser versions.
To perform automation testing in parallel on Windows use the below command.
1 |
node ./node_modules/protractor/bin/protractor parallel.conf.js |
Monitor and analyze your test result on the LambdaTest Automation Dashboard. Deploy your code in a reliable manner at scale using Semaphore CI integration with LambdaTest, and ensure it looks robust across every browser to provide a seamless user experience to all your visitors. Happy Testing!