When I use the "Show me the page" step, with Capybara / Cucumber, can I control where the files get output? I can't seem to find the config for this, and my google fu is failing me.
Right now it appears that by default they go to the root of my rails folder and clutter up things there.
...
I'm trying to get Capybara running in a simple Ruby script -- i.e. without/outside of Rails. Here's the script:
require 'rubygems'
require 'capybara'
require 'capybara/dsl'
include Capybara
Capybara.current_driver = :selenium
Capybara.app_host = 'http://www.google.com'
visit('/')
The problem is that when I run this I get this error...
I've swapped out Webrat for Capybara on a new Rails 3 project. I ran through Tim Riley's great post on it here ( http://openmonkey.com/articles/2010/04/javascript-testing-with-cucumber-capybara ), and also cloned his repository, executed the example cucumber feature, and saw the browser window fire open. So the whole Cucumber, Capybara, ...
Im using Cucumber + Capybara.
This is how one of my step definitions looks like.
When /^(?:|I )go to (.+)$/ do |page_name|
visit path_to(page_name)
end
And here is my routing file:
match "home" => "home#index"
resources :searches
root :to => 'firstpage#index'
What is the name of a path?
...
So I just started using Steak, which in turn uses Capybara, which in turn uses Selenium.
So I've heard it's good RSpec practice to split testing into lots of little it-clauses, each testing a small piece of functionality. But then it makes a test run take a lot longer, because the same steps get repeated for each test.
Say I'm testing...
I have the following as a cucumber story:
@javascript
Scenario: Showing the page
Given I am a logged in user
And there is a member with a site
And I go to the home page
.....
When that home page is loaded, there is a drop down that is populated via AJAX on page, in the selenium run browser test the
$(document).ready(funtion...
I am trying to test an inplace editor using Cucumber/Capybara/Selenium stack, but my problem is that the editor is activated by clicking a div and not a link or button. I can not seem to figure out how to get Capybara to do this. Is there a way of doing this?
...
I'd like to suppress the initialization of TinyMCE inside my tests and can do this easily if the Javascript can detect that I'm running inside a Selenium-automated page.
So, is there some JS code that I can use to detect the Selenium driver? Alternatively, how can I extend the userAgent string to include a pattern that I can detect from...
In my rails application, I have a page with a link that execute a javascript function :
<%= link_to_function("Add an address", "add_fields(this)".html_safe) %>
In my cucumber feature I have :
And I press "Add an address"
And the message I get is :
Capybara::ElementNotFound: no button with value or id or text 'Add an address' fou...
I have a a button (not a submit button) which does ajax calls before submitting another form.
What I want to do is
Given I am viewing homepage
When I press "JustAButton"
Then I should be on "/users/home"
But the redirection happens somewhat late and "Then" statement fails considering that the page is still in homepage. How can I wait...
I have a number of Cucumber scenarios which run with capybara on a project I am working on.
Most of these scenarios start with a "Given I am logged in" step. Currently my implementation of this is:
visit path_to('the login page')
fill_in('Username', :with => 'user')
fill_in('Password', :with => 'password')
click_button('Login')...
Hi,
I'm stuck with the following problem, this is the first time I use capybara, have you an idea how I can solve this issue, thanks
I use rails 3.0.0 and the following gems
gem 'rails', '3.0.0'
gem 'capybara'
gem 'database_cleaner'
gem 'cucumber-rails'
gem 'cucumber'
gem 'rspec-rails'
gem 'spork'
gem 'launchy'
I have the following ...
I am using Rails 3 with Cucumber, Capybara and Factory_Girl. I am trying to test following the "Show" link for just one of the rows on an HTML table. I am using the syntax:
And I follow "Show" within "Net 30"
I gives me the following error:
unexpected '30' after 'DESCENDANT_SELECTOR' (Nokogiri::CSS::SyntaxError)
/System/Library/Fra...
I am using cucumber and capybara along with rails 2.3.9.
How do I verify the page title. I try to have a good page title for every GET request and would like to verify that in my tests.
...
I am using capybara along with cucumber on a Rails 2.3.9 project.
I have users index page and I have two records there. Using capybara how do I assert that there are only two records in the page.
HTML structure is like this
<div class='records'>
<li>record 1<li>
<li>record 2 </li>
</div>
...
I am using capybara with cucumber in rails 2.3.9 application.
Here is my html code
<a href="http://twitter.com/dorelal" target="_blank" title="twitter">
<img alt="twitter" src="/images/social/twitter.png?1284129939" />
</a>
I want to verify following items
image should be ending with twitter.png
image alt should be "twitter"
link ...
I'm having a hard time getting a simple file upload test working. I'm using Rails 3.0.0 on ruby 1.9.2 with Cucumber and Capybara.
View:
<%= form_tag "/upload/create", :multipart => true do %>
<label for="file">File to Upload:</label>
<%= file_field_tag "file" %>
<%= submit_tag "Upload" %>
<% end %>
Cucumber Step:
When /^I upl...
I need to change session during one cucumber scenario.
For example
Given session name is "1st unauthenticated user"
And make some things
Given session name is "2st unauthenticated user"
And make some other things
I found a solution, but it doesn't work with Rails 3, Cucumber and Capybara. Are there any other solutions?
...
I'm tearing my hair out here. When running Cucumber in Spork-compatible mode (--drb) the visit() method doesn't work.
Simply trying the feature step:
When I go to the home page
calls web step:
When /^(?:|I )go to (.+)$/ do |page_name|
visit path_to(page_name)
end
Running "cucumber" on the command line produces the following err...
I seem to be having trouble testing the slick javascript things I do with jQuery when using Capybara and Selenium. The expected behavior is for a form to be dynamically generated when a user clicks on the link "add resource". Capybara will be able to click the link, but fails to recognize the new form elements (i.e. "resource[name]").
...