Questions tagged [webrat]

Webrat is an acceptance testing library for Web applications written in Ruby.

Webrat is an acceptance testing tool for Ruby, which simulates a browser without JavaScript support. But it can also be combined with a web automation framework like Watir to implement browser based web automation tests.

183 questions
3
votes
1 answer

Check content of attributes using rspec+webrat

With rspec+webrat you can check various attributes like :href, :content, :class etc but how can I check the content of html5 custom attributes. It seems to complain about the second part of the attribute name. If attribute is 'data-random' and I try…
user1116573
  • 2,817
  • 4
  • 17
  • 27
3
votes
1 answer

no such file to load -- action_controller/integration - NoMethodError for Rails 3 and Webrat

I'm getting the following failure during RSpec tests.. no such file to load -- action_controller/integration ..using Rails 3, RSpec 2 and Webrat, if I include the Webrat helpers in the following way (the idea was to use Webrat for the have_tag and…
0x4a6f4672
  • 27,297
  • 17
  • 103
  • 140
3
votes
1 answer

cucumber-nagios / webrat submits empty forms

I am a complete newbie with ruby and am starting out using cucumber-nagios for some BDD testing. I have installed cucumber-nagios on my Mac Pro using the instructions here: http://auxesis.github.com/cucumber-nagios/ My Mac is running Snow Leapord…
3
votes
3 answers

having problems with "visit" in integration tests on the rails tutorial

I am new to rails and am running through the rails 3 tutorial. I have a problem running integration tests. It seems that the method 'visit' (Webrat?) will always fail. This is the kind of error message I get from rspec: Failure/Error: visit…
enderfour
  • 31
  • 2
3
votes
2 answers

How can I test one, more or none images in a page with Cucumber?

I want to test if I have 0, 1, 2 or 3 times a pictures ('foo.png') in a certain page with Cucumber. How should I write the custom step? Thanks
Leonardo Dario Perna
  • 1,045
  • 2
  • 10
  • 23
3
votes
3 answers

How to test css property in rspec?

I'm using tabnav plugin for Rails and I want to use rpsec to make sure it highlights properly. describe 'account navigation links' do it 'should have account settings link' do get '/account/settings' response.should have_tag("li", :text =>…
sent-hil
  • 18,635
  • 16
  • 56
  • 74
3
votes
4 answers

Webrat says it can't find some text, but the text is actually there

I have a webpage that has a form button on it called "delete", and a cuke scenario that has the line: And I should see "delete" When I run the scenario, I get this error: expected the following element's content to include "delete" ...and it dumps…
Jason
  • 57
  • 1
  • 3
3
votes
4 answers

Ruby assertions and disabled inputs

Does anyone know how to assert that a checkbox or input is disabled? I can't find anything to indicated that this is supported I'm writing cucumber tests with webrat and test/unit. I'd like to have a step that is able to assert_disabled…
brad
  • 31,987
  • 28
  • 102
  • 155
3
votes
2 answers

Can I use Webrat for ASP.NET applications?

Does Webrat require that the web application be written in Ruby/Rails? I'd like to try it for writing tests against an ASP.NET web application.
Randy Eppinger
  • 1,054
  • 13
  • 23
3
votes
1 answer

What kind of programming language or software can simulate the user interaction with browser?

Hi I am looking for some kind of software(web rat)/some type of programming lanuages can simulate the user interaction with browser. Like the capybara for the cucumber test in rails. The situation is I want that (software/script languages) to open…
runcode
  • 3,533
  • 9
  • 35
  • 52
3
votes
2 answers

cucumber + webrat: checking text appearing twice

I am working on a rails app to self teach BDD and testing in general. Using cucumber + webrat + rspec, after railcasts video tuts. In this app a quiz has_many questions. The view I am testing should render the question twice and non contiguously.…
nutsmuggler
  • 1,707
  • 5
  • 21
  • 27
3
votes
1 answer

ActiveRecord dependency with Ruby, Rails, Cucumber, & RSpec

We are writing a Rails application that is using CouchDB as its data store. We're BDD/TDD'ing with RSpec and Cucumber, which is using WebRat for webpage testing I'm trying to remove ActiveRecord as one of the resources that is being loaded by rails…
Brian
  • 4,931
  • 3
  • 32
  • 55
2
votes
7 answers

Rails: Integration testing thinking_sphinx with cucumber and webrat - how do I index transactional fixtures?

I'd like to have some Cucumber/webrat integration tests of my search features that use thinking_sphinx & sphinx but the problem is that the data is loaded and then rolled back in a transaction during a typical cucumber test so there is no way for…
srboisvert
  • 12,679
  • 15
  • 63
  • 87
2
votes
2 answers

Undefined Webrat methods in Cucumber

When I set up a new rails 3.1.3 project and write a Cucumber story with Webrat code, like this: response.should contain("abc") and I run rake cucumber, I get: undefined method `contain' for #
Michael Franzl
  • 1,341
  • 14
  • 19
2
votes
2 answers

Is there a simpler way to write the following cucumber test?

I'm usisng cucmber to test a php app and it's working quite well actually. I have a cucmber feature that uses the following step to check for the presence of a link in a page: Then /^I should see a link that contains "(.+)"$/ do |link| assert…
ac_
  • 1,147
  • 4
  • 13
  • 34
1 2
3
12 13