Arquillian: Effective tests from the client to the server
Upcoming SlideShare
Loading in...5

Arquillian: Effective tests from the client to the server



Tools like Selenium, an outstanding tool for UI test automation, and Arquillian, an award-winning integration testing framework, offer a base for high-quality tests which are crucial for a web app ...

Tools like Selenium, an outstanding tool for UI test automation, and Arquillian, an award-winning integration testing framework, offer a base for high-quality tests which are crucial for a web app development. However writing UI tests and covering server-side logic leaves many questions open:

* Does Selenium cover everything? Page transitions, 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?



Total Views
Views on SlideShare
Embed Views



1 Embed 97 97



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Arquillian: Effective tests from the client to the server Arquillian: Effective tests from the client to the server Presentation Transcript

  • Arquillian: Effective TestsFROM THE CLIENT TO THE SERVER Lukas Fryc
  • Testing Testing Testing Testing #Agile Testing Testing#TDD Testing Testing Testing Testing “You can hear about testing Testing from everywhere!”
  • “But image testing oflarge enterpriseapplication.” Enterprise Java Web Application
  • “In such case, its noteasy to define how thetests should look like.” Testing...
  • “How would you completeequation?What word do youimagine when someonesays testing?” Testing = ?
  • “My favorite is...” Testing = Pain
  • “Its even possible tochange equation andmake the testingenjoyable?” Testing = Enjoyable!
  • No one saves the World?
  • “There is one: he is braveand comes from far deepspace...”
  • “And brings heavy gearfor fighting with alienbugs...”
  • “...and he is proud toshare his powerful gearwith us!”
  • “At first, he comes with Ability to split one big deployment into manysmall, testing as little ascomponents as possible in separation.”
  • “And he makes surethese deployments work on various of earth application servers.”
  • “...and once he deploys the deployment into container, he makes sureyou have all the goodness from inside available using dependency injection.”
  • “...and thats all backedwith strong development tools.”
  • “That all, and you can run it just from your IDE, re- using what you already now.”JUnit TestNG
  • Testing Revolution
  • Ike brings tests to the Server
  • But what about the Client?
  • The little bit of Theory...
  • “Lets have ideal testingpyramid in mind,otherwise...”
  • Enough Theory!
  • Lets bring tests to the Client
  • “But it isnt as simple asin Java - many differentenvironments.”
  • “Fortunately there is toolwhich allows you to writetests in unified API for allthose browsers.”
  • “And the even supportsmocked browsers withsame API.”
  • Oh, such a great tool!
  • Lets invade client!
  • “Ouch, we need some abstraction!”
  • “Even if we use favoriteprogrammatic approach,we can end up with manytests which takes days topass and quickly turnsout into maintananceburden!” Java C# Python Ruby PHP Perl
  • At least, the app is covered...
  • “But this is what actuallySelenium see.”
  • Black Box
  • “Selenium is able to testtransitions betweenpages.” Page Transitions
  • “...and a portion of all thepage source code –JavaScript handlers,selected CSS and DOMchanges as reaction touser interaction.” A little bit of... DOM / JavaScript / CSS
  • Lets change the game...
  • Right tool for the Job
  • “Lets take the anoutstanding UIautomation tool...”
  • “And add your favoritelanguage.”
  • “And little bit of Alientechnology.”
  • “His name is Drone andhe is proud member ofArquillian crew!” Arquillian Drone
  • “He is basically ...” Hard-Worker
  • “Drone comes to bringthe browser to your test.”
  • Let Ike invade the Client
  • “But something else isneeded to make yourtests green.”
  • “Something enoughstrong to handle all theinconsistencies.”
  • “Lets deploy that to thebrowser page and seewhat happens!”
  • Strong type-safe API
  • Proven to handle AJAX
  • Invades the Client
  • Cross-Cutting Concerns
  • Arquillian Graphene
  • “We are still writing low-level interactioncommands, right?” Isnt that too low-level?
  • “Lets look for somethingon higher level.” Reusable Abstractions
  • “Introducing well-knownSelenium pattern:” Page Objects
  • “Lets imagine youhave page with all theelements and youexpress them asfields in the class.”
  • “You can even usefluent API for pagetransitions, sinceeach method canreturn next page asthe result.”
  • “But for modern AJAX-based application, itssimply not enough.”
  • “Lets think a littleabout that:In enterpriseapplications, yourather reuse UIcomponents.”
  • “What about creatingthe model of thesecomponents fromtheir users point ofview?”
  • Component Objects
  • Arquillian Graphene Component Objects
  • Review what we have
  • “Now, we can simplywrite tests on properlevel of abstractionwith minimumefforts.”
  • 3 Missing Pieces
  • “What is missing here?” JUnitTestNG
  • How to avoid manual...?
  • “We can automatically snap screen-shots of the whole pages and compare them with historical data – its proven that rendering on one particular browser and platform, images will be binary same.”Screen-shot Comparison
  • Automated Visual Verification
  • The Music of the Future?
  • “It is music of thefuture, but there isproject which alreadyfocuses efforts there.” Arquillian RushEye
  • “2 parts are missing now: server is already covered with unit and integration tests, but what about the same tests for client?” JUnitTestNG
  • “Unit testing of clientis even moreimportant than unittesting of server,since it suffers fromenvironmentdiversity.” Unit Testing Client
  • “But once those unittests are written, howto automate them?Without automation,they are not tests.” Yet another tool to configure?
  • “Lets use theconfiguration what wehave for Drone – lethim instantiate abrowser, which willrun the unit tests.” Reuse the Automation Setup
  • “For writing actualtests, you can useyour favorite JS clienttesting tool.We are actuallyworking onintegration withQUnit.” QUnit
  • “And once the client is covered too, only integration tests for client are missing.” JUnitTestNG
  • “The integrationtesting of client isactually making sureit communicates withserver as expected.” Client / Server Round-Trip
  • Take client on the Tour to Server!
  • “We have browser and test on one side andserver on opposite side.”
  • “With UI automation, weare sending request from client to the server.”
  • “And server generates response.”
  • Black Box!
  • “On the other hand, when we are testing server from its JVM, we are mocking requests, which invokes verification code.”
  • Dont mock me!
  • “Lets make theconnection between client and server live.”
  • “Once the requests goes to the server, the test code is serialized and sent as part of the request.”
  • “Server de-serializes thetesting code from requestand uses it for verification of the server state inseveral lifecycle phases.”
  • “And then is the testing object sent back to theclient, which can validate it.”
  • “Client can verify the response and send another request.”
  • Crazy idea?
  • “But it already works!” JSFUnit
  • “Now, we are covered!” JUnitTestNG
  • Client Invasion
  • Its all?
  • It cant be without some buzz....
  • Lets go Mobile!
  • “Drone can actuallyreplace all the browsers.”
  • “And use Android driverfor connecting to mobile device.”
  • “Additionally, Androidextension can start theemulator or connect to real device, which is perfect addition for running in continuous integration systems.”
  • Arquillian Android
  • “Drone brings yourAndroid browser just into your test.”
  • Arquillian
  • Experience the future now
  • But I must to know more...
  • Join us...
  • #jbosstesting @
  • #Arquillian
  • Enjoy the Testing!
  • @LFryc Lukas Fryc
  • Photographs and pictures used in this presentation are authored by various authors and released under the Creative Commons license