Tag: "CI"

Travis CI Selenium testing with TestingBot

Travis CI is a continuous integration service, you can use this free service to run (Selenium) tests from your GitHub repository.
It is very easy to use the TestingBot Selenium grid together with Travis CI.

Below is a guide to run your Selenium tests with Travis CI.
We offer TestingBot status badges to indicate your Selenium tests status on your GitHub pages.

Set up Travis CI

Sign up at Travis CI and connect your GitHub project with Travis CI.
You can find information on how to do this at the Travis CI help section.

Sample Selenium Test

Add a simple Selenium test to your GitHub project, modify the .travis.yml file in your repository to indicate you want to run a Selenium test.

language: node_js
node_js:
  - 0.8
env:
- [
    {secure: "akuE0dld1Ke9mahjUUrQhUZRYWasdfewfwefewfZlbvOx\nqaPybirPGsDmImvcktaAkjLxpePd0V1+ak+4dws7dTrFfEsdvsdsdvsdvds2\nud1q5oGOzEqfiRGxY/fJHLWlaQ609Bsdfdsfds2VeY1Z/V7N9iQ="},
    {secure: "JGfkAfr/SOlzV+NpgNi3fxP4F2usdfdsveGAppugHj1IxhoyjY\nOp07x4p1hdIfWVF03RqUrPNXkl72+yh53pv2fUzsdfsd3434GRjGy6J6\notuA/N+xs0+TP2ENlCmDauwO32Okfojvj7CgvsdfdsfRyaFzIGWPdw="}
  ]
script:
- "node tests/examples/*.js"

The two secure lines in the above example are your TestingBot key and secret, which are used to run a test on our TestingBot Selenium Grid.
To generate these 2 lines, you need to install the Travis CI gem and run these commands with your own key and secret:

travis encrypt username/projectname TESTINGBOT_KEY=key
travis encrypt username/projectname TESTINGBOT_SECRET=secret

Now you can use the encrypted TESTINGBOT_KEY and TESTINGBOT_SECRET environment variables in your tests.
Remember to indicate your test’s privacy setting as “public” (privacy = true) if you want to use the test status badges we provide.

Here’s an example in NodeJS:

var webdriverjs = require('tbwdjs');
var client = webdriverjs.remote({
    host: 'hub.testingbot.com',
    desiredCapabilities: {
        browserName: 'internet explorer',
        version: 9,
        platform: 'WINDOWS',
        api_key: process.env.TESTINGBOT_KEY,
        api_secret: process.env.TESTINGBOT_SECRET,
        name: (process.env.TRAVIS_JOB_ID ? ("Travis Build " + process.env.TRAVIS_JOB_ID) : "Simple Test"),
        privacy: true
    }
});

client
    .testMode()
    .init()
    .url('http://google.com/')
    .titleEquals('Google')
    .end();

Get your TestingBot badge

Once your first Selenium test has ran via Travis, you can start displaying its status with our Status Badges:

<a href="http://testingbot.com/u/key">
  <img src="http://testingbot.com/buildstatus/key" alt="Selenium Test Status">
</a>

More information

Our help page regarding Travis CI integration has more info: Travis CI + TestingBot

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

TestLab: run your tests and suites in our online CI

Lately we have been making some improvements to our TestLab.
Our TestLab is a feature on our website which allows you to upload your Selenium IDE tests, then schedule when the test should be run and on which browsers/platforms.

This works great for people who don’t need a sophisticated CI (Continuous Integration) environment, or just don’t want to get their hands dirty.

Thanks to the suggestions of people using the TestLab, we now have a very useful tool to run your tests with a minimum of coding or effort. Here’s what we have changed and added to the Lab in the last few weeks:

  • Test Suite support: import your test suites from Selenium IDE straight into our TestLab. Group previous tests in a test suite, view statistics and edit settings for all tests in a test suite.
  • Custom Headers: you can now specify custom headers, for example change the user-agent of the browser. This makes it easy to test mobile websites. You can for example set the user-agent to iPhone, which causes some websites to show a specific version of its website for iPhone users.
  • Reporting: we can now send you a daily report containing statistics about your tests at the time you specify. Attached in the report mail you will find a PDF with details.
  • User Extensions: specify a URL with your custom user extension code and it will be included during your test run.

Another interesting feature is that you can configure and run a specific TestLab test via our API.
Once the test has finished, you’ll receive a response on your API callback URL.
This makes for some great integration possibilities, for example running a suite of tests right before/after you deploy your new code.

We’ve got some more great ideas in the pipeline, which we’ll be happy to share on this blog once they are available in the TestLab.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)