designing top-class test suites for web applications
DESCRIPTION
The evolution which came with the Arquillian, award-winning integration test framework, and Selenium, outstanding tool for UI automation, allows to write high-quality tests. But these technologies can’t save the world by themselves, since they are leaving too many questions open:* Does Selenium cover everything? It covers page transitions, a simple JavaScript interaction and a portion of DOM. Is it really enough?* Mocking requests for testing server-side code is pain. Is it necessary?* Are you able to detect that your component’s visual representation changes?* Does investigating these changes involve a disproportionate amount of effort?* Isn’t manual test development too expensive?What if you could fill all the above gaps?TRANSCRIPT
![Page 1: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/1.jpg)
Designing Top-Class Test SuitesDesigning Top-Class Test SuitesFOR WEB APPLICATIONSFOR WEB APPLICATIONS
Lukas Fryc
![Page 2: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/2.jpg)
Lukas Fryc
@LFryc
$ whoami
JBoss Software EngineerArquillian Commiter
![Page 3: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/3.jpg)
Agenda
● Agility in Testing● Testing: Basics & Principles● Client-Side Testing
● Unit Testing● UI Automation
● Foundations of Real Tests● JSFUnit.NG
● Speeding up Development● JRebel extension
![Page 4: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/4.jpg)
TestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTesting
#Agile
#TDD
“You can hear about testingfrom everywhere!”
![Page 5: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/5.jpg)
Testing = ?
“How would you complete equation?
What word do you imagine when someone says testing?”
![Page 6: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/6.jpg)
Testing = Pain
![Page 7: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/7.jpg)
Testing = Enjoyable!
“What about changing that equation a little bit?”
![Page 8: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/8.jpg)
Enterprise Java Web Application
“But testing of large enterprise application can hardly can be enjoyable.”
“You need to write all the test harness at own and study all the tools.”
![Page 9: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/9.jpg)
Reinventing the Wheel
![Page 10: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/10.jpg)
No one saves the World?
![Page 11: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/11.jpg)
“There is one: his name is Ike. He comes from far, deep space from planet Arquillian...”
![Page 12: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/12.jpg)
“Ike brings heavy gear for fighting with alien bugs...”
![Page 13: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/13.jpg)
“...and he is proud to share his powerful gear with us!”
![Page 14: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/14.jpg)
“At first, he comes withAbility to split one big
deployment into many small - testing as little as components as possible
in separation.”
![Page 15: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/15.jpg)
“And he makes sure these deployments work
on various of Earth's application servers.”
![Page 16: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/16.jpg)
“...and once he deploys the deployment into
container, he makes sure you have all the goodness
from inside available using dependency
injection.”
![Page 17: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/17.jpg)
“...and that all backed with strong development
tools.”
![Page 18: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/18.jpg)
TestNGJUnit
“You can run it just from your IDE, re-using what
you already know.”
![Page 19: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/19.jpg)
Testing Revolution
![Page 20: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/20.jpg)
Ike brings tests to the Server
![Page 21: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/21.jpg)
But what about the Client?
![Page 22: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/22.jpg)
The little bit of Theory...
![Page 23: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/23.jpg)
![Page 24: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/24.jpg)
![Page 25: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/25.jpg)
![Page 26: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/26.jpg)
![Page 27: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/27.jpg)
“Let's have ideal testing pyramid in mind, otherwise...”
![Page 28: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/28.jpg)
Enough Theory!
![Page 29: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/29.jpg)
Let's bring tests to the Client
![Page 30: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/30.jpg)
TestNGJUnit
![Page 31: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/31.jpg)
“But it isn't as simple as in Java - many different environments.”
![Page 32: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/32.jpg)
“Fortunately there is tool which allows you to write tests in unified API for all those browsers.”
![Page 33: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/33.jpg)
“And the even supports mocked browsers with same API.”
![Page 34: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/34.jpg)
W3C: Browser Automation Spec
![Page 35: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/35.jpg)
Oh, such a great tool!
![Page 36: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/36.jpg)
Let's invade client!
![Page 37: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/37.jpg)
“Ouch, we need some
abstraction!”
![Page 38: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/38.jpg)
JavaC#
PythonRubyPHPPerl
“Even if we use favorite programming language, we can end up with many tests which take days to pass and may quickly turn out into maintenance burden!”
![Page 39: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/39.jpg)
At least, the app is covered...
![Page 40: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/40.jpg)
“But this is what actually Selenium see.”
![Page 41: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/41.jpg)
Black Box
![Page 42: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/42.jpg)
State Transitions
“Selenium is able to test transitions between pages.”
![Page 43: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/43.jpg)
A little bit of...DOM / JavaScript / CSS
“...and a portion of all the page source code – JavaScript handlers, selected CSS and DOM changes as reaction to user interaction.”
![Page 44: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/44.jpg)
Let's change the game...
![Page 45: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/45.jpg)
Right tool for the Job
![Page 46: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/46.jpg)
“Let's take an outstanding UI automation tool...”
![Page 47: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/47.jpg)
“and add your favorite language.”
![Page 48: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/48.jpg)
“and little bit of Alien technology.”
![Page 49: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/49.jpg)
Arquillian DroneIke's Hard-Worker
![Page 50: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/50.jpg)
![Page 51: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/51.jpg)
“Drone comes to bring the browser to your test.”
![Page 52: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/52.jpg)
Help Devs get along with QA Developers focused on tests
QA focused on automation
arquillian.xml configuration for cross-browser testing
![Page 53: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/53.jpg)
Let Ike invade the Client
![Page 54: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/54.jpg)
“But something else is needed to make your tests green.”
![Page 55: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/55.jpg)
“Something enough strong to handle all the inconsistencies.”
![Page 56: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/56.jpg)
“Let's deploy that to the browser page and see what happens!”
![Page 57: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/57.jpg)
Arquillian GrapheneShielding Ike from Maintenance Burden
![Page 58: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/58.jpg)
Strongly type-safeProven to handle AJAX
Request Guards
jQuery Selectors
![Page 59: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/59.jpg)
guardXhr(button).click();guardHttp(button).click();
![Page 60: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/60.jpg)
Strongly type-safeProven to handle AJAX
Request Guards
jQuery Selectors
Page Extensions – Script InjectionCross-cutting concerns
Interceptors
![Page 61: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/61.jpg)
@JavaScript(“document”)public interface Document() { String getTitle();}
@InjectDocument document;
// calls 'return document.title;'document.getTitle();
![Page 62: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/62.jpg)
Isn't that too low-level?
![Page 63: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/63.jpg)
Reusable Abstractions
“Let's look for something on higher level.”
![Page 64: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/64.jpg)
Page Objects
“Introducing well-known Selenium pattern:”
![Page 65: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/65.jpg)
“Imagine you have page with all the elements and you express them as fields in the class.”
![Page 66: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/66.jpg)
“Page Objects allows you to abstract page-oriented logic into objects.”
![Page 67: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/67.jpg)
![Page 68: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/68.jpg)
“But for modern AJAX-based application, it's simply not enough.”
![Page 69: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/69.jpg)
“In enterprise applications, you use UI components that encapsulates low-level logic.”
![Page 70: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/70.jpg)
“We could create the model of these components from their user's point of view?”
![Page 71: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/71.jpg)
@FindBy(id=”form:calendar”)Calendar calendar;
calendar.setDate(new Date());
![Page 72: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/72.jpg)
@Componentpublic class Calendar {
@Root WebElement driver;
@FindBy(css=”.dateButton”) WebElement button;
public void setDate() { input.click(); }}
![Page 73: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/73.jpg)
Component ObjectsWill be part of Arquillian Graphene 2.x
![Page 74: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/74.jpg)
Call to Action:Write & Share Component Objects
“When each framework and library providing UI components will design component objects the same as it share their code, it will be testing much more simpler.”
![Page 75: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/75.jpg)
Let's do the review...
![Page 76: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/76.jpg)
“Now, we can simply write tests on proper level of abstraction with minimum efforts.”
![Page 77: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/77.jpg)
3MissingPieces
![Page 78: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/78.jpg)
TestNGJUnit
“What is missing here?
No manual coverage and no unit and integration
tests for client-side!”
![Page 79: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/79.jpg)
How to avoid manual testing?
![Page 80: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/80.jpg)
Screen-shot Comparison
“We can automatically snap screen-shots of the
whole pages and compare them with historical data – it's
proven that rendering on one particular browser
and platform, images will be binary same.”
![Page 81: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/81.jpg)
Automated Visual Verification
![Page 82: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/82.jpg)
The Music of the Future?
![Page 83: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/83.jpg)
Arquillian RushEyeGoogle Summer of Code 2012
![Page 84: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/84.jpg)
TestNGJUnit
“Server is already covered with unit and integration tests, but what about the same goodness for client?”
![Page 85: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/85.jpg)
Unit Testing Client
“Unit testing of client is even more important than unit testing of server, since it suffers from environment diversity.”
![Page 86: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/86.jpg)
Unit Testing FrameworksQUnit, Jasmine, JsMockito
Test RunnersJSTD, Selenium, Maven
![Page 87: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/87.jpg)
Yet another tool to configure?
“But once those unit tests are written, how to automate them?
Without automation, they are not tests.”
![Page 88: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/88.jpg)
Reuse the Automation Setup
![Page 89: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/89.jpg)
ArquillianDrone + QUnit | JSTDMaven / Jenkins / IDE
“For writing actual tests, you can use your favorite JS client testing tool.
We are actually working on integration with QUnit.”
![Page 90: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/90.jpg)
“JavaScript testing does not scale!”
~John Resig
http://ejohn.org/blog/javascript-testing-does-not-scale/
![Page 91: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/91.jpg)
TestSwarmCrowd-sourcing for Browser Coverage
Jenkins integration
“But it is rather for open source projects, right?”
![Page 92: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/92.jpg)
Browser Tests in the CloudSauceLabs On Demand
Integration with Arquillian comming
“For corporates, it is more suitable to use cloud services:”
![Page 93: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/93.jpg)
TestNGJUnit
“And once the client is covered too, only
integration tests for client are missing.”
![Page 94: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/94.jpg)
Client + Server Integration
“The integration testing of client is actually making sure it communicates with server as expected.”
![Page 95: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/95.jpg)
“We have browser and test on one side and
server on opposite side.”
![Page 96: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/96.jpg)
“With UI automation, we are sending request from
client to the server.”
![Page 97: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/97.jpg)
“And server generates response.”
![Page 98: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/98.jpg)
Black Box
![Page 99: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/99.jpg)
“On the other hand, when we are testing server from its JVM, we are
mocking requests, which invokes verification
code.”
![Page 100: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/100.jpg)
Don't mock me
![Page 101: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/101.jpg)
The Tour to the ServerThere and Back Again
![Page 102: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/102.jpg)
“Let's make the connection between client
and server live.”
![Page 103: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/103.jpg)
“Once the requests goes to the server, the test code is serialized and
sent as part of the request.”
![Page 104: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/104.jpg)
“Server de-serializes the testing code from request and uses it for verification
of the server state in several lifecycle phases.”
![Page 105: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/105.jpg)
“Offering all the gear which Arquillian offers,
including test enrichment for injection of test
dependencies.”
![Page 106: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/106.jpg)
“Then the testing object is serialized again and sent back to the client, which can validate it.”
![Page 107: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/107.jpg)
“Client can verify the response and send
subsequent request.”
![Page 108: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/108.jpg)
Crazy idea?
![Page 109: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/109.jpg)
JSFUnit
“But it is already possible!”
![Page 110: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/110.jpg)
JSFUnitHtmlUnit
Asserts end of the Request State
JSF only
JSFUnit .NG (next generation)Selenium / any other HTTP client
Lifecycle
Any injectable resource
Any Servlet based framework
![Page 111: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/111.jpg)
TestNGJUnit
“Now, we are covered!”
![Page 112: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/112.jpg)
Client Invasion
![Page 113: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/113.jpg)
That's it...
![Page 114: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/114.jpg)
No, It can't be without....
![Page 115: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/115.jpg)
Mobile
![Page 116: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/116.jpg)
![Page 117: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/117.jpg)
“Drone can instantiate browser emulator or
connect to real device.”
![Page 118: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/118.jpg)
![Page 119: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/119.jpg)
“And create the browser within the
emulator/device.”
![Page 120: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/120.jpg)
Arquillian AndroidEmulating Mobile Platform
![Page 121: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/121.jpg)
![Page 122: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/122.jpg)
Development on Steroids
![Page 123: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/123.jpg)
Speeding up Development Reusable Browser Session
Arquillian JRebel Extension
![Page 124: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/124.jpg)
Arquillian
![Page 125: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/125.jpg)
Experience the Future Now
![Page 126: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/126.jpg)
I must know more...
![Page 127: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/127.jpg)
http://bit.ly/arq-preview
![Page 128: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/128.jpg)
http://bit.ly/arq-users
![Page 129: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/129.jpg)
Getting Involved
![Page 130: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/130.jpg)
http://github.com/arquillian
![Page 131: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/131.jpg)
http://bit.ly/arq-devs
![Page 132: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/132.jpg)
http://bit.ly/jboss-testing
![Page 133: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/133.jpg)
#jbosstesting @ irc.freenode.net
![Page 134: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/134.jpg)
#Arquillian
![Page 135: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/135.jpg)
Enjoy the Testing!
![Page 136: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/136.jpg)
@LFryc
http://bit.ly/lfryc
Questions for Ike?
http://bit.ly/arq-blog
![Page 137: Designing Top-Class Test Suites for Web Applications](https://reader031.vdocument.in/reader031/viewer/2022020803/545c6189af7959af098b47a1/html5/thumbnails/137.jpg)
http://www.flickr.com/photos/nickrussill/150410613/http://www.flickr.com/photos/audreyjm529/1240909256/http://www.flickr.com/photos/jo-h/6200225665/http://www.flickr.com/photos/stevendepolo/3796415185/http://watirmelon.com/2012/01/31/introducing-the-software-testing-ice-cream-cone/
Some photographs and pictures used in this presentation are authored by various authors
and released under the Creative Commons license