Search Results

Search found 155 results on 7 pages for 'cucumber'.

Page 3/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • RSpec and Cucumber with Rails

    - by diptip18
    After running command "ruby script/cucumber" it produces the error as Using the default profile... e:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement e:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Cucumber::CODEPAGE (NameError) from e:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing' from e:/Ruby/lib/ruby/gems/1.8/gems/cucumber-0.6.3/bin/../lib/cucumber/formatter/unicode.rb:30:in `puts' from e:/Ruby/lib/ruby/gems/1.8/gems/cucumber-0.6.3/bin/cucumber:13 from script/cucumber:9:in `load' from script/cucumber:9

    Read the article

  • What happens when you click a button using WebRat under cucumber

    - by Peter Tillemans
    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> <tr><td>User:</td><td><input type='text' name='j_username' value=''></td></tr> <tr><td>Password:</td><td><input type='password' name='j_password'/></td></tr> <tr> <td><input type='checkbox' name='_spring_security_remember_me'/> </td> <td>Remember me on this computer.</td> </tr> <tr><td colspan='2'><input name="submit" type="submit"/></td></tr> <tr><td colspan='2'><input name="reset" type="reset"/></td></tr> </table> </form> </body> </html> I use the following script: Given /^I am logged in as (.*) with password (.*)$/ do | user, password | visit "http://localhost:8080/ui" click_link "Projects" puts "Response Body:" puts response.body assert_contain "User:" fill_in "j_username", :with => user fill_in "j_password", :with => password puts "Response Body:" puts response.body click_button puts "Response Body:" puts response.body end This gives the following in the log file : [INFO] Response Body: [INFO] <html><head><title>Login Page</title></head><body onload='document.f.j_username.focus();'> [INFO] <h3>Login with Username and Password</h3><form name='f' action='/ui/j_spring_security_check' method='POST'> [INFO] <table> [INFO] <tr><td>User:</td><td><input type='text' name='j_username' value=''></td></tr> [INFO] <tr><td>Password:</td><td><input type='password' name='j_password'/></td></tr> [INFO] <tr><td><input type='checkbox' name='_spring_security_remember_me'/></td><td>Remember me on this computer.</td></tr> [INFO] <tr><td colspan='2'><input name="submit" type="submit"/></td></tr> [INFO] <tr><td colspan='2'><input name="reset" type="reset"/></td></tr> [INFO] </table> [INFO] </form></body></html> [INFO] Response Body: [INFO] <html><head><title>Login Page</title></head><body onload='document.f.j_username.focus();'> [INFO] <h3>Login with Username and Password</h3><form name='f' action='/ui/j_spring_security_check' method='POST'> [INFO] <table> [INFO] <tr><td>User:</td><td><input type='text' name='j_username' value=''></td></tr> [INFO] <tr><td>Password:</td><td><input type='password' name='j_password'/></td></tr> [INFO] <tr><td><input type='checkbox' name='_spring_security_remember_me'/></td><td>Remember me on this computer.</td></tr> [INFO] <tr><td colspan='2'><input name="submit" type="submit"/></td></tr> [INFO] <tr><td colspan='2'><input name="reset" type="reset"/></td></tr> [INFO] </table> [INFO] </form></body></html> [INFO] Response Body: [INFO] [INFO] Given I am logged in as pti with password ptipti # features/step_definitions/authentication_tests.rb:2 So apparently the response.body disappeared after clicking the submit button. I can see from the server log files that the script does not arrive on the Project page. I am new to webrat and quite new to ruby and I am now thoroughly confused. I have no idea why the response.body is gone. I have no idea where I am. I speculated that I had to wait for the page request, but all documentation says that webrat nicely waits till all redirects, pageloads, etc are finished. (At least I think I read that). Besides I find no method to wait for the page in the webrat API. Can someone give some tips on how to proceed with debugging this?

    Read the article

  • Testing Rails Metal With Cucumber/rSpec

    - by nkabbara
    Hi, I'm trying to stub a third party service that my metal talks to. It seems rspec mocks/stubs don't extend all the way to the Metal. When I call stubbed methods on objects, it calls the original one and not the stubbed one. Any idea of how I can have rSpec doubles extend all the way to the metal? Thanks. -Nash

    Read the article

  • http authentication fails in cucumber when adding @javascript tag

    - by JESii
    I have a feature in my Rials app that works just fine with the message "Responds to browser_basic_authorize" from the Background Given step. However, if I add a @javascript tag before the scenario, then my Background Given fails with "I don't know how to login". What's going wrong and how do I go about testing javascrpt interactions on my app? Background: Given I perform HTTP authentication as "<id>/<password>" When I go to the homepage Then I should see "Text-that-you-should-see-on-your-home-page" Scenario: Displaying injury causative factors Given I am on the new_incident_report page When I choose "incident_report_employee_following_procedures_true" Then I should see "Equipment failure?" Then I should not see "Lack of training" When /^I perform HTTP authentication as "([^\"]*)\/([^\"]*)"$/ do |username, password| puts "id/pswd: #{username}/#{password}" ### Following works ONLY if performed first before even going to a page!!! if page.driver.respond_to?(:basic_auth) puts 'Responds to basic_auth' page.driver.basic_auth(username, password) elsif page.driver.respond_to?(:basic_authorize) puts 'Responds to basic_authorize' page.driver.basic_authorize(username, password) elsif page.driver.respond_to?(:browser) && page.driver.browser.respond_to?(:basic_authorize) puts 'Responds to browser_basic_authorize' page.driver.browser.basic_authorize(username, password) else raise "I don't know how to log in!" end end Rails 3.0.9, current gems, other tests passing.

    Read the article

  • Testing form submission with Cucumber

    - by picardo
    I wrote a simple Cuke feature for a form on a demo site. The feature looks like this. Given I am on the home page When I set the "Start Date" to "2010-10-25" And I set the "End Date" to "2011-1-3" And I press the "Go" button Then I should see "Cake Shop" The idea is that after I press the Go button, a new page will load, showing a list of results, and one of the results should be "Cake Shop." But I have not managed to get this to work. Is there something that I am missing? Edit: here is the step definitions. Given /^I am on the "([^"]*)" page$/ do |page| visit root_path end When /^I set the "([^"]*)" to "([^"]*)"$/ do |field, date| fill_in field, :with=>date end When /^I press the "([^"]*)" button$/ do |arg1| click_button('Go') end The final step is defined in web_steps.rb I believe....and it's always there that it's failing. Then I should see "Cake Shop" # features/step_definitions/web_steps.rb:107 expected #has_content?("Cake Shop") to return true, got false (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/web_steps.rb:110:in block (2 levels) in <top (required)>' ./features/step_definitions/web_steps.rb:14:in with_scope' ./features/step_definitions/web_steps.rb:108:in /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/' features/specify_timerange.feature:12:in Then I should see "Cake Shop"'

    Read the article

  • Cucumber - How configure it to use "--format pretty" as default?

    - by Gabriel L. Oliveira
    I'm starting learning rails, and having some troubles on configure cucumber to run my bdd tests. What I want is run cucumber features and this translate to cucumber features --format pretty I tried to do this editing the config/cucumber.yml file (on a rails project). Edited the line: default: <%= std_opts % features resulting on: default: <%= std_opts % --format pretty features But it make some erros happen: Using the default profile... All but one formatter must use --out, only one can print to each stream (or STDOUT) (RuntimeError) What I can do to make this option "--format pretty" default? Also, is there any other good option to put as default to make result more clear? Thank you.

    Read the article

  • Cucumber Makes Behavior-Driven Ruby on Rails Development Cool

    <b>WDVL:</b> "This article introduces the Cucumber framework, a tool for implementing the Behavior-Driven Development (BDD) methodology. The idea behind BDD is simple: everyone should understand the system features. Cucumber promotes this idea by enabling the features of a system to be written in the native language of the program as either specs or functional tests."

    Read the article

  • Ruby gem already activated

    - by Eric the Red
    How can I de-activate the newer version of cucumber, or get this to work with the earlier version? user$ rake features (in /Users/user/Project) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I "/Library/Ruby/Gems/1.8/gems/cucumber-0.6.1/lib:lib" "/Library/Ruby/Gems/1.8/gems/cucumber- 0.6.1/bin/cucumber" --format pretty can't activate cucumber (= 0.4.4, runtime) for [], already activated cucumber-0.6.1 for [] (Gem::LoadError) /Library/Ruby/Site/1.8/rubygems.rb:280:in `activate'

    Read the article

  • Using Cucumber or RSpec+Selenium to create end user documentation?

    - by carolclarinet
    Has anyone tried creating end user (potentially online, potentially to be printed) help/documentation out of your cucumber scenarios? Or taken screenshots for use in documentation using RSpec and Selenium RC's ability to do so? For Cucumber, I'm imagining something like: Scenario: If you want to add a link Given I am on the edit blog post page When I press the "add link" button And I type in a link URL "http://stackoverflow.com" And I click "OK" Then the blog post should have 1 link Translating to the documentation: If you want to add a link, go to the edit blog post page. Press the "add link" button and type a URL, like "http://stackoverflow.com", into the link URL field. Click "OK". Would it be worth my time to try and, for one, write something to parse my Cucumber features into documentation, and two, to write/structure my Cucumber features in such a way as to create good documentation? Would the resulting documentation end up sounding really boring without much variation in the structure? Is there anything else out there like this idea? Doxygen looks like it's more for code documentation than end-user documentation. What about automatically taking screenshots? This seems like a more fruitful path-- just reuse the code that takes a screenshot when an RSpec test fails and have it take one in prescribed situations. Is there a better way to do this?

    Read the article

  • Facebook Cucumber testing with Authlogic - how test user logged in as facebook user?

    - by rhh
    I'm having trouble implementing this step: Given "I am logged in as a Facebook user" do end The best suggestions I can find on the web (http://opensoul.org/2009/3/6/testing-facebook-with-cucumber) do not seem to be using Authlogic for authentication. Can someone with the Cucumber/Authlogic_facebook_connect/Authlogic combo post their step for testing facebook logins? Thank you very much.

    Read the article

  • Cucumber could not find table; but its there. What is going on?

    - by JZ
    I'm working with cucumber and I'm running into difficulties. When I run "cucumber features", I am met with errors, cucumber is unable to find my requests table. What obvious mistake am I making? Thank you in advance! Bash: justin-zollarss-mac-pro:conversion justinz$ cucumber features Using the default profile... /Users/justinz/.gem/ruby/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement F-- (::) failed steps (::) Could not find table 'requests' (ActiveRecord::StatementInvalid) ./features/article_steps.rb:3 ./features/article_steps.rb:2:in `each' ./features/article_steps.rb:2:in `/^I have requests named (.+)$/' features/manage_articles.feature:7:in `Given I have requests named Foo, Bar' Failing Scenarios: cucumber features/manage_articles.feature:6 # Scenario: Conversion 1 scenario (1 failed) 3 steps (1 failed, 2 skipped) 0m0.154s justin-zollarss-mac-pro:conversion justinz$ Manage_articles.feature: Feature: Manage Articles In order to make sales As a customer I want to make conversions Scenario: Conversion Given I have requests named Foo, Bar When I go to the list of customers Then I should see a new "customer" Article_steps.rb: Given /^I have requests named (.+)$/ do |firsts| firsts.split(', ').each do |first| Request.create!(:first => first) pending # express the regexp above with the code you wish you had end end Then /^I should see a new "([^"]*)"$/ do |arg1| pending # express the regexp above with the code you wish you had end DB schema: ActiveRecord::Schema.define(:version => 20100528011731) do create_table "requests", :force => true do |t| t.string "institution" t.string "website" t.string "type" t.string "users" t.string "first" t.string "last" t.string "jobtitle" t.string "phone" t.string "email" t.datetime "created_at" t.datetime "updated_at" end end

    Read the article

  • When i run rake db:create ,Error rake aborted! uninitialized constant Cucumber

    - by Big Bang Theory
    Hi I am trying to experiment on an open source application application . when i run $ rake db:create Following is the stacktrace rake aborted! uninitialized constant Cucumber /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in `const_missing' /home/BigBangTheory/Desktop/spot-us/lib/tasks/cucumber.rake:13 /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1882:in `in_namespace' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:910:in `namespace' /home/BigBangTheory/Desktop/spot-us/lib/tasks/cucumber.rake:12 /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:145:in `load' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:145:in `load' /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/tasks/rails.rb:8 /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/tasks/rails.rb:8:in `each' /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/tasks/rails.rb:8 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' /home/BigBangTheory/Desktop/spot-us/Rakefile:9 /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:in `load' /usr/bin/rake:19 Any help ?

    Read the article

  • MissingSourceFile when I run "cucumber features"

    - by Jess
    I had cucumber 0.6.1 working quite fine... but I ran the gem update cucumber command, and things went smoothly. Then when I decided to run the cucumber features command, I received this error: Using the default profile... no such file to load -- cucumber/webrat/element_locator (MissingSourceFile) /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inpolyglot_original_require' So I tried a few things... I did a gem update on webrat, that didn't work. I removed all previous versions of cucumber by doing gem uninstall cucumber then selecting past versions. Same with webrat. No luck. What am I doing wrong?

    Read the article

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

    - by ajmurmann
    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?

    Read the article

  • Why are all response bodies after the first blank in Cucumber?

    - by James A. Rosen
    I'm using Cucumber (0.6.3), Cucumber-Rails (0.3.0), Webrat (0.7.0), and Rails (2.3.5) for some tests. The following scenario passes just fine: Scenario: load one page Given I am on the home page Then I should see "Welcome" The following, however, fails: Scenario: load two pages Given I am on the FAQ pag When I go to the home page Then I should see "Welcome" The problem is that the second @response.body is blank. I added a Rack middleware to get a little more information: class LogEachRequest def initialize(app); @app = app; @count = 0; end def call(env) puts "Processing request # #{@count += 1)" @app.call(env) end end It shows me only one request processed. That is, it only ever prints out Processing request # 1

    Read the article

  • Syntax Highlighting for Gherkin (Cucumber Language)

    - by Liam McLennan
    SyntaxHighlighter is the de facto standard for syntax highlighting on the web. I am currently working on a tool for publishing BDD specifications on the web and I want syntax highlighting. Unfortunately, SyntaxHighlighter does not support Gherkin, the language Cucumber and SpecFlow use to define BDD specifications. Writing new language parsers for SyntaxHighlighter is very easy, so I implemented one for Gherkin. Here is what a syntax highlighted Gherkin file looks like: # A comment here Feature: Some terse yet descriptive text of what is desired In order to realize a named business value As a explicit system actor I want to gain some beneficial outcome which furthers the goal @secretlabel Scenario: Some determinable business situation Given some precondition And some other precondition When some action by the actor And some other action And yet another action Then some testable outcome is achieved And something else we can check happens too Like all SyntaxHighlighter brushes to use this one you need to install the brush (shBrushGherkin.js). I have also used a custom theme to get it just the way I wanted it (shThemeGherkin.css). If you would like to use my Gherkin brush you may download the code and example page.

    Read the article

  • How to use Page Object pattern with Cucumber and Webrat / Selenium?

    - by Will Sargent
    I'm looking at a cucumber test suite that is somewhat brittle right now; many small steps, and no knowledge of the page itself. I'd like to factor out the logic involved in the step definitions inside a series of Selenium PageObjects. As seen here. However, because I'm using Webrat and not Selenium, everything has to go through the Webrat model. So I cannot do class MyPage < Selenium::WebPage end because that adds a direct dependency. So I have to route everything through Webrat while still maintaining the Selenium Page object goodness. No documentation on this that I can see: if someone has anything on Webrat + PageModel I'd love to see it.

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >