Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see what capybara found in a failing cucumber step?

I started migrating from cucumber + webrat to cucumber + capybara. Now the behavior of "I should see " seems to be somewhat different. Most of these fail now, although I didn't change anything on the page. I replaced the snippet that should be found with some stuff that is on every page and for some text it works and for other text it doesn't. I can't find any pattern in what is found in the page's content and what is not. Webrat used to print what the page content is that it found, in case it did not contain the required phrase. Is there anyway to have capybara show what text it got from the page in which it tried to find the text?

like image 748
ajmurmann Avatar asked Mar 10 '10 01:03

ajmurmann


People also ask

What is capybara in Ruby?

Capybara is a web-based test automation software that simulates scenarios for user stories and automates web application testing for behavior-driven software development. It is written in the Ruby programming language.

What is cucumber capybara?

cucumber is a BDD tool that expresses testing scenarios in a business-readable, domain-specific language. capybara is an automated testing tool (often used) for ROR applications.


1 Answers

Then show me the page calls webrat/capybara's underlying save_and_open_page method. Found that useful when working with steak.

like image 76
sent-hil Avatar answered Sep 23 '22 17:09

sent-hil