The screenshot command only works with pages and test that use Javascript, and are great to check to see if the functionality is really happening in a controlled environment.
I spent the past weeks working on a filtered search using Sunspot/SOLR which is all new stuff for me. SOLR is basically a tool to do searching of the database and Sunspot is the gem that connects Rails to SOLR easily.
SOLR has specific methods that query the database and I spent a lot of time checking out a number of them and testing the UI to be sure the correct data shows.
I am sure I could of spent the entire time in the terminal testing functionality but using my integration test and the Capybara screenshot command to view the actual page was a little more rewarding.
If you have integration test I highly recommend using Capybara to debug integration testing. I wrote this post to remind myself of the syntax, since I literally google it every time I need to use it.
*UPDATE: the screenshot call only works if you enable javascript in your test, with something like selenium:
`def switch_to_javascript
Capybara.javascript_driver = :selenium if ENV["FF"]
Capybara.current_driver = Capybara.javascript_driver
end
'
You can discover a great cord for web page save and page open this command is help full for only works with pages and test that use Javascript...
ReplyDeleteWeb Development
very true, I will update my post to include that note.
ReplyDelete