in this session, we explore when to test, what to test and how to test ajax components

85
In this session, we explore when to test, what to test and how to test Ajax components. creating automatic tests with various tools, including YUI Test and OpenQA Selenium how to use Ajax testing tools with IDEs and continuous integration systems. Ajax Testing Tool Review when to test, what to test, how to test Ajax applications Wednesday, October 1st, 1:00 – 2:30p Ted Husted

Upload: ivana-cummings

Post on 31-Dec-2015

19 views

Category:

Documents


0 download

DESCRIPTION

Ajax Testing Tool Review when to test, what to test, how to test Ajax applications Wednesday, October 1st, 1:00 – 2:30p Ted Husted. In this session, we explore when to test, what to test and how to test Ajax components. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: In this session, we explore  when to test, what to test and how to test Ajax components

In this session, we explore when to test, what to test and how to test Ajax

components. creating automatic tests with various tools, including

YUI Test and OpenQA Seleniumhow to use Ajax testing tools with IDEs and

continuous integration systems.

Ajax Testing Tool Review when to test, what to test, how to test Ajax applications

Wednesday, October 1st, 1:00 – 2:30pTed Husted

Page 2: In this session, we explore  when to test, what to test and how to test Ajax components

Ajax Testing Tool Reviewwhen to test, what to test, how to test Ajax applications

Square One University Series

Page 3: In this session, we explore  when to test, what to test and how to test Ajax components

For the latest version of this presentation, visit http://slideshare.com/ted.husted

For the latest version of source code,visit http://code.google.com/p/yazaar/

Ajax Testing Tool Review

Page 4: In this session, we explore  when to test, what to test and how to test Ajax components

Abstract

Not long ago, testing Ajax components meant play-testing a page by hand.

Today, there are a growing number of tools we can use to simplify and automate Ajax testing.

During the session, we will cover when, what, and how to test Ajax applications creating automatic tests with various tools testing with IDEs and continuous integration systems

Page 5: In this session, we explore  when to test, what to test and how to test Ajax components

Ajax Testing Tool Review

Tool ReviewJsUnit and YUI TestSelenium Cruise Control and Hudson

Ajax Testing in Action Live Coding Demonstration

YUI Test + Selenium + Hudson + Eclipse

Page 6: In this session, we explore  when to test, what to test and how to test Ajax components

JsUnit

JsUnit is a Unit Testing framework for client-side (in-browser) JavaScript.

Essentially a port of JUnit to JavaScript.

Platform for automating the execution of tests on multiple browsers and multiple machines running different OSs.

Development began in January 2001.

Page 7: In this session, we explore  when to test, what to test and how to test Ajax components

JsUnit – Key Features

Create test cases with JavaScript code.

Tracing modes - warn, info, and debug.

Group related cases using test suites.

Server componentprovide integration with other test platforms, test logging, and running tests on multiple target platforms.

Page 8: In this session, we explore  when to test, what to test and how to test Ajax components

JsUnit – Key Features

Browser Support - Internet Explorer 5.0+, Firefox or Mozilla 0.9+, Netscape 6.0+, and Konqueror 5+.

Release - 2.2 (Alpha, 2006 March) 2.2.0 (tagged 2008 Jan)Since 2001

License - GPL, LGPL, MPL

One team member

Page 9: In this session, we explore  when to test, what to test and how to test Ajax components

http://jsunit.net/

Page 10: In this session, we explore  when to test, what to test and how to test Ajax components

http://www.jsunit.net/runner/testRunner.html?testpage=/runner/tests/jsUnitTestSuite.html

Page 11: In this session, we explore  when to test, what to test and how to test Ajax components

http://www.jsunit.net/runner/testRunner.html?testpage=/runner/tests/jsUnitTestSuite.html

Page 12: In this session, we explore  when to test, what to test and how to test Ajax components

http://www.jsunit.net/documentation/runnerExample.html

Page 13: In this session, we explore  when to test, what to test and how to test Ajax components

http://jsunit.net/documentation/

Page 14: In this session, we explore  when to test, what to test and how to test Ajax components

http://tech.groups.yahoo.com/group/jsunit/

Page 15: In this session, we explore  when to test, what to test and how to test Ajax components

http://www.cafepress.com/agilestuff

Page 16: In this session, we explore  when to test, what to test and how to test Ajax components

http://www.cafepress.com/agilestuff

Page 17: In this session, we explore  when to test, what to test and how to test Ajax components

JsUnit

No Form Support

No Asynchronous Support

Server Support - Java

IDE Support - Eclipse, IDEA

CruiseControl Support

Page 18: In this session, we explore  when to test, what to test and how to test Ajax components

JsUnit

Strengths Established, xUnit model,Active community.

Weaknesses Sole Developer,Conservative License,Irregular release

schedule,Several known

limitations.

Page 19: In this session, we explore  when to test, what to test and how to test Ajax components

JsUnit

Bottom LineUse when team members are already

experienced with jsUnit (and licensing is not an issue)

Consider YUI Test to test asynchronous code if starting fresh

(or willing to try something new).For acceptance tests, add Selenium to the

mix

Page 20: In this session, we explore  when to test, what to test and how to test Ajax components

JsUnit

ResourcesAJAX and Unit Testing - it's time to mingle

Jim Plush (2006 Feb)http://www.litfuel.net/plush/?postid=117

Ajax and Unit Testing Part Two, The Wrath of Mock

Jim Plush (2006 Nov)http://www.litfuel.net/plush/?postid=154

Page 21: In this session, we explore  when to test, what to test and how to test Ajax components

YUI Test

Testing framework for browser-based JavaScript solutions.

Add unit testing to JavaScript solutions.

Derives characteristics from nUnit and jUnit.

Page 22: In this session, we explore  when to test, what to test and how to test Ajax components

YUI Test – Key Features

Create test cases through simple syntax.

Failure detection for methods that throw errors.

Group related cases using test suites.

Asynchronous tests for testing events and Ajax communication.

Cross-browser DOM Event simulation.

Page 23: In this session, we explore  when to test, what to test and how to test Ajax components

YUI Test – Key Features

Support for “A-Grade” Browsers

Release 2.5.2 (2008 May)Since July 2007 (YUI 2.3.0)

License – BSD

~16 Team Members Yahoo! employees and contributorsMaintained by Nicholas C. Zakas

http://www.nczonline.net/

Page 24: In this session, we explore  when to test, what to test and how to test Ajax components

http://developer.yahoo.com/yui/yuitest/

Page 25: In this session, we explore  when to test, what to test and how to test Ajax components

http://developer.yahoo.com/yui/yuitest/#start

Page 26: In this session, we explore  when to test, what to test and how to test Ajax components

http://developer.yahoo.com/yui/examples/yuitest/yt-advanced-test-options.html

Page 27: In this session, we explore  when to test, what to test and how to test Ajax components

http://developer.yahoo.com/yui/docs/module_yuitest.html

Page 28: In this session, we explore  when to test, what to test and how to test Ajax components

http://developer.yahoo.com/yui/docs/YAHOO.util.DateAssert.html#method_datesAreEqual

Page 29: In this session, we explore  when to test, what to test and how to test Ajax components

http://yuiblog.com/assets/pdf/cheatsheets/yuitest.pdf

Page 30: In this session, we explore  when to test, what to test and how to test Ajax components

http://tech.groups.yahoo.com/group/ydn-javascript/

Page 31: In this session, we explore  when to test, what to test and how to test Ajax components

http://tech.groups.yahoo.com/group/ydn-javascript/msearch?query=yuitest

Page 32: In this session, we explore  when to test, what to test and how to test Ajax components

YUI Test

Form Support

Asynchronous Support

No Server Support

No IDE Support

No CI Support

Page 33: In this session, we explore  when to test, what to test and how to test Ajax components

YUI Test

Strengths Bundled with YUI

LibraryLarge, well-funded

teamRegular releasesActive communityWell documented

WeaknessesBundled with YUI

LibraryLacks server

support

Page 34: In this session, we explore  when to test, what to test and how to test Ajax components

YUI Test

Bottom Line: Use when coding JavaScript or Ajax

applications (and Test-Driven Development)

Good for simple event/form testsNeeds better automation toolsFor true acceptance tests, add Selenium to the

mix

Page 35: In this session, we explore  when to test, what to test and how to test Ajax components

YUI Test

ResourcesTest Driven Development with YUI Test

Nicholas D. Zakas (2008 September) http://ajaxexperience.techtarget.com/assets/documents/Nicholas_Zakas_Test_Driven_Development.pdf

(presentation)Writing Your First YUI Application

Eric Miraglia (2008 May) http://www.insideria.com/2008/05/writing-your-first-yui-applica.html

Page 36: In this session, we explore  when to test, what to test and how to test Ajax components

Open QA Selenium

Selenium is a suite of tools to automate web app testing across many platforms

Selenium IDE records and runs tests as a Firefox Plugin.

Selenium Remote Control runs tests across multiple platforms

Selenium Grid distributes test running across multiple machines

Page 37: In this session, we explore  when to test, what to test and how to test Ajax components

Selenium – Key Features

Create test scripts using Selenium Commands.

Run tests in against live applications.

Compile test scripts in native languages, such as Java, C#, Ruby.

Integrate scripts with other test suites and continuous integrations systems.

Page 38: In this session, we explore  when to test, what to test and how to test Ajax components

Selenium – Key Features

Support for major browsers Firefox 2+, (RC and Core) IE7, Safari 2+, Opera 8+, Windows,

OS X, Linus, Solaris.

Current Releases IDE, RC, Grid, 2008; Core: 2007Since 2005

License – Apache

~11 Team Members Originated as ThoughtWorks project

Page 39: In this session, we explore  when to test, what to test and how to test Ajax components

http://selenium.openqa.org/

Page 40: In this session, we explore  when to test, what to test and how to test Ajax components

http://selenium.openqa.org/documentation/

Page 41: In this session, we explore  when to test, what to test and how to test Ajax components
Page 42: In this session, we explore  when to test, what to test and how to test Ajax components
Page 43: In this session, we explore  when to test, what to test and how to test Ajax components
Page 44: In this session, we explore  when to test, what to test and how to test Ajax components
Page 45: In this session, we explore  when to test, what to test and how to test Ajax components
Page 46: In this session, we explore  when to test, what to test and how to test Ajax components
Page 47: In this session, we explore  when to test, what to test and how to test Ajax components
Page 48: In this session, we explore  when to test, what to test and how to test Ajax components
Page 49: In this session, we explore  when to test, what to test and how to test Ajax components
Page 50: In this session, we explore  when to test, what to test and how to test Ajax components
Page 51: In this session, we explore  when to test, what to test and how to test Ajax components
Page 52: In this session, we explore  when to test, what to test and how to test Ajax components
Page 53: In this session, we explore  when to test, what to test and how to test Ajax components
Page 54: In this session, we explore  when to test, what to test and how to test Ajax components

<tr><td>open</td><td>Welcome.action</td><td></td></tr>

<tr><td>assertTitle</td><td>MailReader</td><td></td></tr>

<tr><td>clickAndWait</td><td>link=Register with MailReader</td><td></td>

<tr><td>assertTitle</td><td>MailReader - Register</td><td></td></tr>

<tr><td>type</td><td>Register_save_username</td><td>trillian</td></tr>

<tr><td>type</td><td>Register_save_password</td><td>astra</td></tr>

<tr><td>type</td><td>Register_save_password2</td><td>astra</td></tr>

<tr><td>type</td><td>Register_save_fullName</td><td>Tricia McMillian</t

<tr><td>type</td><td>Register_save_fromAddress</td><td>tricia@magrathea.

<tr><td>clickAndWait</td><td>Register_save_Save</td><td></td></tr>

<tr><td>assertTitle</td><td>MailReader - Menu</td><td></td></tr>

<tr><td>assertTextPresent</td><td>Tricia McMillian</td><td></td></tr>

Page 55: In this session, we explore  when to test, what to test and how to test Ajax components
Page 56: In this session, we explore  when to test, what to test and how to test Ajax components
Page 57: In this session, we explore  when to test, what to test and how to test Ajax components

RegisterTrillianTest.java

public class RegisterTrillianTest extends SeleneseTestCase {public void testRegisterTrillian() throws Exception { selenium.open("/menu/Welcome.action"); assertEquals("MailReader", selenium.getTitle()); selenium.click("link=Register with MailReader"); selenium.waitForPageToLoad("30000"); assertEquals("MailReader - Register", selenium.getTitle()); selenium.type("Register_save_username", "trillian"); selenium.type("Register_save_password", "astra"); selenium.type("Register_save_password2", "astra"); selenium.type("Register_save_fullName", "Tricia McMillian"); selenium.type("Register_save_fromAddress", "[email protected]"); selenium.click("Register_save_Save"); selenium.waitForPageToLoad("30000"); assertEquals("MailReader - Menu", selenium.getTitle()); checkForVerificationErrors();

}

Page 58: In this session, we explore  when to test, what to test and how to test Ajax components

http://clearspace.openqa.org/index.jspa

Page 59: In this session, we explore  when to test, what to test and how to test Ajax components

OpenQA Selenium

Form Support

Asynchronous Support

Server Support

IDE Support

CI Support

Page 60: In this session, we explore  when to test, what to test and how to test Ajax components

Firefox 3 and Selenium RC

The current Remote Control beta release (2007) is not compatible with FF3

Minor configuration issue with version numbering in FF3

Hot patch available

Best Advice: Install FF2 in default location, and FF3 in an alternate spot.

Page 61: In this session, we explore  when to test, what to test and how to test Ajax components

OpenQA Selenium

Strengths Granual toolsetLarge, dedicated

teamSteady releasesActive community

WeaknessesComplex setupSuperficial suite

supportChoppy

documentation Perpetual beta

Page 62: In this session, we explore  when to test, what to test and how to test Ajax components

OpenQA Selenium

Bottom LineUse to create acceptance testsComplements unit tests

Page 63: In this session, we explore  when to test, what to test and how to test Ajax components

CruiseControl

Continuous build process framework

Plugins for email notification, Ant, and source control tools.

Web interface to view build details

Page 64: In this session, we explore  when to test, what to test and how to test Ajax components

CruiseControl – Key Features

Build loop – On trigger event, runs tasks, notifies listeners.

Legacy reporting - Browse results of build loop and access artefacts.

Dashboard - Visual representation of project status.

Page 65: In this session, we explore  when to test, what to test and how to test Ajax components

CruiseControl – Key Features

Java, Ruby, and .NET projects

Several third-party tools and plugins

Java, .NET, and Ruby Releases in 2008Java 2.7.3, .NET 1.4 (July)Ruby 1.3.0 (April)Since 2001

License – BSD Style

~8, ~12+, ~6, Team Members

Page 66: In this session, we explore  when to test, what to test and how to test Ajax components

http://cruisecontrol.sourceforge.net/

Page 67: In this session, we explore  when to test, what to test and how to test Ajax components

http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET

Page 68: In this session, we explore  when to test, what to test and how to test Ajax components

http://cruisecontrolrb.thoughtworks.com/

Page 69: In this session, we explore  when to test, what to test and how to test Ajax components

http://cruisecontrol.sourceforge.net/overview.html

Page 70: In this session, we explore  when to test, what to test and how to test Ajax components

http://cruisecontrol.sourceforge.net/dashboard.html

Page 71: In this session, we explore  when to test, what to test and how to test Ajax components

http://confluence.public.thoughtworks.org/display/CC/Home

Page 72: In this session, we explore  when to test, what to test and how to test Ajax components

http://sourceforge.net/mailarchive/forum.php?forum_name=cruisecontrol-user

Page 73: In this session, we explore  when to test, what to test and how to test Ajax components

Cruise Control

Strengths MatureMulti-platformRegular releasesActive community

WeaknessesXML configurationChoppy

documentation

Page 74: In this session, we explore  when to test, what to test and how to test Ajax components

Hudson

Continuous build process framework

Runs as a Java web application

BYO Container or standalone mode

Page 75: In this session, we explore  when to test, what to test and how to test Ajax components

Hudson – Key Features

RSS/E-mail/IM Integration

JUnit/TestNG test reporting

Permanent links

Change set support

After-the-fact tagging

History trend, Distributed builds, File fingerprinting, Plugins.

Page 76: In this session, we explore  when to test, what to test and how to test Ajax components

Hudson – Key Features

Quick Install, Free style setup – Runs standalone, instant project checkout, automatic build configuration.

Visual Configuration – No XML required.

Friendly Dashboard - Project status at a glance.

Page 77: In this session, we explore  when to test, what to test and how to test Ajax components

Hudson – Key Features

Regular releases (daily/weekly milestones)

License -- MIT / Creative Community

Page 78: In this session, we explore  when to test, what to test and how to test Ajax components

http://cruisecontrol.sourceforge.net/

Page 79: In this session, we explore  when to test, what to test and how to test Ajax components
Page 80: In this session, we explore  when to test, what to test and how to test Ajax components

http://cruisecontrol.sourceforge.net/dashboard.html

Page 81: In this session, we explore  when to test, what to test and how to test Ajax components

Hudson

Strengths Simple setupSlick UIWell documentedRegular releasesActive community

WeaknessesJava containerCommitters?

Page 82: In this session, we explore  when to test, what to test and how to test Ajax components

http://cruisecontrol.sourceforge.net/overview.html

Page 83: In this session, we explore  when to test, what to test and how to test Ajax components

Let's Code It!

Page 84: In this session, we explore  when to test, what to test and how to test Ajax components

Ajax Testing Tool Review

During the session, we covered when, what, and how to test Ajax applications creating automatic tests with various tools testing with IDEs and continuous Integration

systems

Page 85: In this session, we explore  when to test, what to test and how to test Ajax components

Square One University Series