Save 37% off PRO during our Black Friday Sale! »

Avoiding Flapping JS Tests in Rails

Avoiding Flapping JS Tests in Rails

A presentation I gave at the West Michigan Ruby Users Group on August 3, 2015 on tips to avoiding flapping JS tests in Rails. A lot of this presentation was a live demo, so there are only a few slides.


Adam DeLong

August 03, 2015


  1. Avoiding Flapping JS Tests in Rails

  2. Adam DeLong @DeLongShot Bell Park Software

  3. Acceptance

  4. Asynchronous Testing

  5. Race Conditions

  6. Test Thread Visit ‘/‘ Wait for response… Receive Response expect(page)…

  7. Test Thread Visit ‘/‘ Wait for response… expect(page)… Wait for

    response… Background Thread Receive Request Formulating Response… Send Response Formulating Response…
  8. Tips

  9. UI

  10. Action Methods

  11. RSpec Matchers

  12. Tools

  13. Selenium Pros: Reliable Cons: Slow

  14. Poltergeist Pros: Really Fast Cons: Flapping

  15. Capybara-Webkit Pros: Fast Cons: Errors?

  16. Resources

  17. capybara Write Reliable, Asynchronous Integration Tests With Capybara