Seamless Integration Testing


Published on

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Hashrocket tools and techniques for client projects
    Integration testing is an ever-evolving ecosystem with some really powerful tools available.
  • large or small scale, lots of things can be considered integration tests
  • from the Rails perspective, it is driving a browser and testing the integration of the whole stack
  • integration tests take the place of view and controller tests
  • finding and preventing bugs is a side effect
  • they represent a contract with your client. it is the code embodiment of your requirements
  • you’ll know right away when you break a screen
  • the quality of your code and application as a whole improve dramatically when you test first!
  • You are writing a narrative when you build the test and it is played out when you run it

  • hotness from Jonas Nicklas’
    extremely flexible and powerful framework
    swappable drivers with different capabilities

  • easy to use, but you should learn some xpath
  • selenium supports ie (windows only), chrome, and FF by default
    akephalos uses htmlunit
    env-js uses Rhino, which is Java version of Spidermonkey (used by Firefox)
  • integration tests live on generated data. No stubs or mocks allowed!
  • note the file name
  • robust generators are important because they can also be used to seed development and staging

  • random field values document the unimportance but type of data expected
  • the following examples are based on using this gem
  • yeah, we TDD integration tests. and everything else!

  • we write the stories, the design team does comps in photoshop, and then they cut them to haml wireframes
  • the start of the narrative
    selenium because of the click to show login form
    outer describe
    nest contexts to form a sentence

  • careful about naming. nothing used as static text on a page
    tell story about Squadron as a project in
  • ping pong writing tests. most basic thing to make test pass exposes faults in your test
  • extract out things you use all the time.
    need certain data and browse to a certain page commonly? pull it out!

  • that’s all you need to do
  • writes these out in your fixtures folder

  • pick a date and stick to it
    you can “travel” to specific dates per spec if necessary

  • each is easier to handle - works better with let
    performance gain with all

  • you can change the wait time in the config
    if you are waiting for ajax, throw in a locate (with a comment)

  • if requests don’t match, it will store a new response

  • ×