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.

C69ee203ee5865ef7452742b037420c8?s=128

Adam DeLong

August 03, 2015
Tweet

Transcript

  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. https://robots.thoughtbot.com/write-reliable-asynchronous-integration-tests-with- capybara Write Reliable, Asynchronous Integration Tests With Capybara