CrossBrowserTesting.com Jenkins Plugin
This plugin integrates Jenkins users with Selenium Testing and Screenshot Testing on CrossBrowserTesting.com. CrossBrowserTesting.com provides cross browser testing of websites, webpages, and web applications on Windows, Macs, and real iPhones, iPads, and Android Phones and Tablets.
Features
- Running Selenium Scripts in Python, Ruby, Java, CSharp, and Javascript on CrossBrowserTesting.com
- Running Automated Screenshot Testing on CrossBrowserTesting.com
- Automated Starting and Stopping of the CrossBrowserTesting.com NodeJS local tunnel to test local and development webpages behind your firewall
Installation
via the interface
- Go to your installation's management screen.
- Click Manage Plugins.
- Click the Available tab.
- Find the CrossBrowserTesting.com Plugin and select the checkbox.
- then click either Install without restart or Download now and install after restart.
by hand(not recommended)
- Download CrossBrowserTesting.hpi.
- Save the downloaded .hpi file into your `$JENKINS_HOME/plugins` directory.
- Restart Jenkins.
Configuration
Environment Variables
The CrossBrowserTesting.com Jenkins Plugin passes your build step information to your Selenium scripts as environment variables. The exact syntax will vary depending on your scripting language.
Variable |
Description |
CBT_USERNAME |
the username used on CrossBrowserTesting.com for Selenium Testing |
CBT_APIKEY |
the apikey used on CrossBrowserTesting.com for Selenium Testing |
CBT_BUILD_NAME |
the Jenkins Project's name |
CBT_BUILD_NUMBER |
the Jenkins Project's current build number |
CBT_OPERATING_SYSTEM |
the apiname of the selected Operating System |
CBT_BROWSER |
the apiname of the selected Browser |
CBT_RESOLUTION |
the name of the selected Screen Resolution |
See the examples directory for a few language specific sample scripts.
Saving Your CrossBrowserTesting.com API Credentials
- Go to your installation's management screen.
- Click Configure System.
- Find the section labeled CrossBrowserTesting.com.
- Enter your CrossBrowserTesting.com Username and API Key information. You can find your api key here (must be logged in)
- Click Save.
Build/Configure
Version >= 0.11 Build Environment
- Configure your Jenkins Project.
- In Build Environment, Check the box next to CrossBrowserTesting.com
- For Screenshot Tests: Pick a BrowserList and enter a URL (you must have you API credentials saved for the browserlist to populate)
- For Selenium Tests: Add the Operating System, Browser, and Screen Resolution that you want to run a Selenium Test on. You can add multiple configurations by clicking Add Selenium Tests
- Click Save
- Click Build Now to build the project. All files in the project's workspace will be ran (make sure the selenium scripts are executable). Output from the selenium script will be displayed in Console Output for the build.
- Optional: Check Use Local Tunnel to run tests on webpages behind your firewall. (The CBT NodeJS Tunnel must be installed globally.)
Version <= 0.10 Build Step
- Configure your Jenkins Project.
- Click Add build step.
- Click CrossBrowserTesting.com.
- Add the Operating System, Browser, and Screen Resolution that you want to run a Selenium Test on. You can add multiple build steps to run multiple selenium tests.
- Click Save
- Click Build Now to build the project. All files in the project's workspace will be ran (make sure the selenium scripts are executable). Output from the selenium script will be displayed in Console Output for the build.