Piotrze dev notes

środa, 24 lutego 2016

Take screenshot in IntegrationTest with capybara when it fails

This is about saving screenshot on failing tests in capybara. There are bunch of advices how to do this in rspec but none for ActionDispatch::IntegrationTest. There is also a gem for this capybara-screenshot but I haven't got luck with this at all.

Here is how to do this with rails 4 integration test. Under the hood it uses minitest that have bunch of hooks we can use.


Most of code stolen from http://vumanhcuongit.github.io/testing/2016/01/26/take-screenshot-when-cucumber-test-failed/ and https://github.com/mattheworiordan/capybara-screenshot
Autor: piotrze o 00:02 Brak komentarzy:
Wyślij pocztą e-mailWrzuć na blogaUdostępnij w XUdostępnij w usłudze FacebookUdostępnij w serwisie Pinterest
Nowsze posty Starsze posty Strona główna
Subskrybuj: Posty (Atom)

find

  • linkedin
  • github

Previous

  • ▼  2016 (2)
    • ►  sierpnia (1)
    • ▼  lutego (1)
      • Take screenshot in IntegrationTest with capybara w...
  • ►  2015 (2)
    • ►  października (1)
    • ►  września (1)
  • ►  2014 (3)
    • ►  września (1)
    • ►  sierpnia (2)
  • ►  2013 (2)
    • ►  lipca (1)
    • ►  kwietnia (1)
  • ►  2012 (7)
    • ►  listopada (4)
    • ►  lipca (2)
    • ►  czerwca (1)
Motyw Prosty. Obsługiwane przez usługę Blogger.