I have to set a select date field with the month and day discarded. So Month and day are hidden in the form which caused a "undefined method `options' for # (NoMethodError)" when executing the cucumber scenario.
How can i solve this issue and get the year correctly into the cucumber step ?
...
When I run a cucumber test it executes the code thinking that a collection obtained inside of a controller via a has_many relationship on a model is empty when it isn't. I ran this same test but with the debugger turned on and a breakpoint before the collection is used. When I print collection in the debugger at this breakpoint the colle...
So, I have a Rails webapp that utilizes subdomains for separating the admin functionality from the public functionality using subdomain-fu.
So there is functionality(that I want to test!) contained within two urls(eg admin.example.com and www.example.com). I want some scenarios to run against the admin domain, and some against the www d...
I need to test a two-stage login system which first asks for your email address and password and then presents the user with two select lists containing [a-zA-Z0-9]. The labels beside the drop down's are of the form 'Select character X from your security phrase', where X is a random character index from a known security phrase.
I'd rath...
I'm trying to define a step to test the value of alt text of an image using capybara and the css selectors.
I wrote one for input values based on the readme examples:
Then /^I should see a value of "([^\"])" within the "([^\"])" input$/ do |input_value, input_id|
element_value = locate("input##{input_id}").value
element_value.s...
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 => "Account Settings")
end
it 'should be highlighted' do
get '/account/settings'
resp...
Code in steps file:
select_date user.date_of_birth, :from => "Date of birth"
Selector fail
When I register with valid user credentials # features/step_definitions/authentication_steps.rb:2
Could not find field: "user_date_of_birth_1i_1i" (Webrat::NotFoundError)
./features/step_definitions/authentication_steps.rb:9:in `/^I regis...
I want to test across multiple sessions using webrat in merb. Apparently, this is fairly easy to accomodate in Rails via: http://erikonrails.snowedin.net/?p=159.
Following the same logic, I am trying to do something that follows that pattern for merb and webrat. Here is an attempt (which does not work because MerbAdapter does not respon...
I am trying to login to a Java web application.
The login page has the following html :
<html>
<head><title>Login Page</title></head>
<body onload='document.f.j_username.focus();'>
<h3>Login with Username and Password</h3>
<form name='f' action='/ui/j_spring_security_check' method='POST'>
<table>
...
I'm writing an integration test for a rails application using webrat. After filling out a form, the user presses submit and an account is created.
click_button "Submit"
assert_contain "Your Account Has Been Created"
However, the test fails:
expected the following element's content to include "Your Account Has Been Created":
You are ...
For a cucumber step, I know that a particular ul element should have 5 children li. How can I assert this with Webrat?
I'm guessing there could be something like:
Then ".selector" should have n ".another-selector"
or maybe
Then I should see n ".selector" within ".another.selector"
Is there anything like this floating around, or sho...
Hi,
I am running BDD steps with cucumber to implement my autlogic login behavior.
Scenario: log in
Given a registered user: "[email protected]" with password: "p@ssword" exists
And I am on the homepage
When I follow "Log in"
And I fill in "Username" with "[email protected]"
And I fill in "Password" with "p@ssword"
And I open the page
And I pre...
Currently I have a like/dislike voting functionality that outputs in the following format:
like (#) dislike (#)
Where like and dislike are clickable links that update the total count of like/dislike votes (represented by (#))
I am writing a cucumber test to check the like/dislike counts are correct. I'd like to check
...
Then I sh...
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
...
I would like this custom step:
Then I should see the link 'foo'
and his opposite:
But I should not see the link 'foo'
In the page I can have something like:
lorem foo bar
or alternatively
lorem <a href=''>foo</a> bar
I need to test when 'foo' is a link and when isn't. Thank you.
...
Rspec obviously hates me. I kinda hate him back.
#features/step_definitions/custom_steps.rb
Then /^I should see the link "([^\"]*)"$/ do |linked_text|
find_link(linked_text)
end
#link.feature
Then I should see the link "foo"
From terminal:
undefined method `find_link' for #<Cucumber::Rails::World:0x818e02e8> (NoMethodError)
./featu...
I am trying to use Cucumber+webrat+mechanize to test some web pages. In a simple example, I set up something like
...
And I goto Home
Then I should see "Welcome"
And I have the following in my step file:
Then /^I should see "([^\"]*)"$/ do |text|
response_body.should contain(text)
end
I get an error, complaining that there is no...
I have a rails site that allows authentication through OAuth (I use Restful Authentication and the Rails OAuth Plugin). To make sure that it worked, I made a quick site to act as an OAuth consumer.
However, I want the testing to be self-contained in Cucumber features. Ideally, this would use Webrat so that Cucumber could correctly m...
Im reading The Rspec book and in that book, they are using webrat with selenium.
I wonder if its possible to use selenium directly for integration tests in Rails instead of using it through webrat?
What are the pros and cons with each way?
...
When I execute the following cucumber script:
Feature: Manage Customers
In order to store customers
As a user
I want to create and manage customers
Scenario Outline: Create Customer
Given I am on new customer screen
When I fill in Name with "Test Company"
And I press "Create"
Then I should see "Custome...