Your SlideShare is downloading. ×

Seamless Integration Testing

2,129
views

Published on

Published in: Technology

0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,129
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
35
Comments
0
Likes
5
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
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 squadronapp.com
  • 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


  • ×