Continuous Testing in the Cloud

27
T11 Continuous Delivery 5/7/2015 11:15:00 AM Continuous Testing in the Cloud Presented by: Chris Broesamle Sauce Labs Brought to you by: 340 Corporate Way, Suite 300, Orange Park, FL 32073 888-268-8770 ∙ 904-278-0524 ∙ [email protected] www.sqe.com

Transcript of Continuous Testing in the Cloud

T11

Continuous Delivery

5/7/2015 11:15:00 AM

Continuous Testing in the Cloud

Presented by:

Chris Broesamle

Sauce Labs

Brought to you by:

340 Corporate Way, Suite 300, Orange Park, FL 32073 888-268-8770 ∙ 904-278-0524 ∙ [email protected] ∙ www.sqe.com

Chris Broesamle

Sauce Labs

Chris Broesamle is a Senior Sales Engineer at Sauce Labs where he is responsible for education

and adoption around cloud based test automation. A devotee to the mindset where beautiful

form follows seamless function, Chris found himself amongst great minds of this ideology at

Sauce Labs. He went to the school of "do it well the first time" and followed up with some

studies in "and continuously improve." He firmly believes that, while some things cannot or

should not be automated (like petting dogs or smelling roses), a development process designed

around testing with automation as an end goal will continue to produce the most efficient and

effective applications. Prior to joining Sauce Labs, Chris worked at CrowdFlower, where he

engineered crowdsourcable solutions and automations around enterprise problems.

Continuous Testing in the Cloud

Using Selenium, Sauce Labs, GitHub, and Travis-CI

Presented by Chris Broesamle, Sales Engineer, Sauce Labs, Inc.4/27/15

How I Spent My Summer Testing

Continuous Testing on the Beach

Presented by Chris Broesamle, Sales Engineer, Sauce Labs, Inc.4/27/15

Continuous Testing: Our Agenda

• Automated functional tests with Selenium

• Run functional tests on Sauce Labs’ hosted browsers

• Push our code changes to our hosted repository in Github

© Sauce Labs, Inc.

• Push our code changes to our hosted repository in Github

• Build triggered by Travis-CI service

Continuous Testing: What is Continuous Integration

“Continuous Integration (CI) is a development practice

that requires developers to integrate code into a shared

repository several times a day. Each check-in is then

© Sauce Labs, Inc.

repository several times a day. Each check-in is then

verified by an automated build, allowing teams to detect

problems early.”

— Satya Avasarala, Selenium WebDriver Practical Guide

Continuous Testing: A Process

Commit and Push

Set up test server and env

Check out the code

© Sauce Labs, Inc.

Set up the test dependencies

Run the tests

(optionally) deploy code

Continuous Testing: Using Selenium For Our Tests

© Sauce Labs, Inc.

Continuous Testing: What Is Selenium?

“Selenium, also known as Selenium 2 and WebDriver, is

a UI automation toolkit used by software developers and

QA engineers to test their web application on different

© Sauce Labs, Inc.

QA engineers to test their web application on different

web browsers. ”

http://www.thoughtworks.com/continuous-integration

Continuous Testing: Selenium is the Standard

• De-facto standard in web automation

• Displacing HP, Mercury + QTP

• W3C draft spec

• Official support in Chrome + Firefox

© Sauce Labs, Inc.© Sauce Labs, Inc.

Selenium is an open

source test framework

that automates web

browsers.

Continuous Testing: Automated Mobile Testing

• “Selenium for mobile apps”

• Compatible with WebDriver spec

• Rapid adoption

© Sauce Labs, Inc.© Sauce Labs, Inc.

Appium is an open

source test framework

that automates native,

hybrid and mobile

apps.

Continuous Testing: Working With Selenium Scripts

Selenium interacts with browser apps, like this Google search:

© Sauce Labs, Inc.

DEMO

© Sauce Labs, Inc.

DEMO

Running a Selenium Script

Continuous Testing: Using Sauce for our Test Runs

© Sauce Labs, Inc.

Sauce Platform: Largest Cloud for Automated Testing

• Test web + mobile apps across more than

500 platforms

• OS+Browser / Simulators / Emulators /

Real Devices

• Just about every platform you need to

support!

TEST

APP

SAUCE

CONNEC

T

YOUR SCRIPT

Java, Ruby, Phython, JS, PHP, .net

© Sauce Labs, Inc.

support!

SE DRIVERS FOR

Continuous Testing: Configuring Tests for Sauce

For Sauce we replace the standard WebDriver with RemoteWebDriver

Selenium interacts with browser apps, like this Google search:

© Sauce Labs, Inc.

And then we add our desired browser and platform:

For Sauce we replace the standard WebDriver with RemoteWebDriver

DEMO

© Sauce Labs, Inc.

DEMO

Running a Script on Sauce

Continuous Testing: Testing Behind a Firewall

© Sauce Labs, Inc.

Continuous Testing: Using GitHub as our Repository

© Sauce Labs, Inc.

Continuous Testing: What Is GitHub?

“GitHub is a web-based hosting service for software

development projects that use the Git revision control

system. GitHub offers both paid plans for private

© Sauce Labs, Inc.

system. GitHub offers both paid plans for private

repositories, and free accounts for open source projects.

— http://en.wikipedia.org/wiki/GitHub

Continuous Testing: What Is GitHub?

© Sauce Labs, Inc.

Continuous Testing: Using Travis for our Builds

© Sauce Labs, Inc.

Continuous Testing: What Is Travis-CI?

“Travis-CI is a hosted, distributed continuous integration

service used to build and test projects hosted at GitHub.

Travis-CI automatically detects when a commit has

© Sauce Labs, Inc.

Travis-CI automatically detects when a commit has

been made and will try to build the project and run

tests.”

— http://en.wikipedia.org/wiki/Travis_CI

Continuous Testing: .travis.yml file

© Sauce Labs, Inc.

Continuous Testing: Configure GitHub for Travis

Eand commit our changes

Now we add our Travis config file to our GitHub project:

© Sauce Labs, Inc.

READY TO BUILD!!!

Eand commit our changes

DEMO

© Sauce Labs, Inc.

DEMO

Running a Build

Q + A

© Sauce Labs, Inc.

Q + A