Search Results

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

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

  • Should selenium tests be written in imperative style?

    - by Amogh Talpallikar
    Is an automation tester supposed to know concepts of OOPS and design patterns to write Tests in a way where changes & code re-use are possible? For example, I pick up Java to write cucumber step definitions that instruct a selenium webdriver. Should I be using a lot of inheritance, interfaces, delegation etc. to make life easier or would that be overly complicated for something that should just line by line instructions?

    Read the article

  • capybara selenium and JavaScript Destroy

    - by dorelal
    I am using rails 2.3.5 and this is what I did. I have latest cucumber, cucumber-rails and capybara installed. rails demo cd demo ruby script/generate cucumber --rspec --capybara ruby script/generate feature post title:string body:text published:boolean ruby script/generate scaffold post title:string body:text published:boolean rake db:migrate rake cucumber All the tests are passing. Now I want to test using Javascript. At this time this is how scenario looks like Scenario: Delete post Given the following posts: |title|body|published| |title 1|body 1|false| |title 2|body 2|true| |title 3|body 3|false| |title 4|body 4|true| When I delete the 3rd post Then I should see the following posts: |Title|Body|Published| |title 1|body 1|false| |title 2|body 2|true| |title 4|body 4|true| I added @javascript at the top. Now when I run rake cucumber then I see a confirmation page. But nothing happens until I click. What do I need to do so that OK is clicked automatically and test proceeds ahead.

    Read the article

  • Why the cucumber features keeps running even though it fails?

    - by Millisami
    Its a rails 2.3.5 app. I'm using the rspec and cucumber for testing. When I run autospec, it runs correctly with the warning (Not running features. To run features in autotest, set AUTOFEATURE=true.) as below: [~/rails_apps/automation (campaign)?] ? autospec (Not running features. To run features in autotest, set AUTOFEATURE=true.) (Not running features. To run features in autotest, set AUTOFEATURE=true.) loading autotest/rails_rspec /home/millisami/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/pathname.rb:263: warning: `*' interpreted as argument prefix /home/millisami/.rvm/rubies/ree-1.8.7-2010.01/bin/ruby /home/millisami/.rvm/gems/ree-1.8.7-2010.01/gems/rspec-1.3.0/bin/spec --autospec /home/millisami/rails_apps/automation/spec/controllers/campaigns_controller_spec.rb /home/millisami/rails_apps/automation/spec/models/board_spec.rb /home/millisami/rails_apps/automation/spec/models/user_spec.rb /home/millisami/rails_apps/automation/spec/models/campaign_spec.rb /home/millisami/rails_apps/automation/spec/controllers/outlets_controller_spec.rb /home/millisami/rails_apps/automation/spec/controllers/boards_controller_spec.rb /home/millisami/rails_apps/automation/spec/models/outlet_type_spec.rb /home/millisami/rails_apps/automation/spec/models/vendor_spec.rb /home/millisami/rails_apps/automation/spec/controllers/brands_controller_spec.rb /home/millisami/rails_apps/automation/spec/controllers/vendors_controller_spec.rb /home/millisami/rails_apps/automation/spec/controllers/dashboard_controller_spec.rb /home/millisami/rails_apps/automation/spec/models/brand_spec.rb /home/millisami/rails_apps/automation/spec/helpers/dashboard_helper_spec.rb /home/millisami/rails_apps/automation/spec/models/outlet_spec.rb /home/millisami/rails_apps/automation/spec/models/client_spec.rb /home/millisami/rails_apps/automation/spec/controllers/clients_controller_spec.rb -O spec/spec.opts Now, as it suggests, when I run AUTOFEATURE=true autospec, the specs runs and the cuke features as well. But the problem is that it won't stop. It runs the features and runs them again and again in a loop. It doesn't stop after it fails. Is this due to the warning Warning: $KCODE is NONE as shown below?? [~/rails_apps/automation (campaign)?] ? AUTOFEATURE=true autospec loading autotest/cucumber_rails_rspec Warning: $KCODE is NONE. /home/millisami/.rvm/gems/ree-1.8.7-2010.01/gems/treetop-1.4.5/lib/treetop/ruby_extensions/string.rb:31: warning: method redefined; discarding old indent /home/millisami/.rvm/rubies/ree-1.8.7-2010.01/lib/ruby/1.8/pathname.rb:263: warning: `*' interpreted as argument prefix /home/millisami/.rvm/gems/ree-1.8.7-2010.01/gems/activesupport-2.3.5/lib/active_support/core_ext/object/blank.rb:49: warning: method redefined; discarding old blank? /home/millisami/.rvm/rubies/ree-1.8.7-2010.01/bin/ruby /home/millisami/.rvm/gems/ree-1.8.7-2010.01/gems/rspec-1.3.0/bin/spec --autospec /home/millisami/rails_apps/automation/spec/controllers/campaigns_controller_spec.rb /home/millisami/rails_apps/automation/spec/models/board_spec.rb /home/millisami/rails_apps/automation/spec/models/user_spec.rb /home/millisami/rails_apps/automation/spec/models/campaign_spec.rb /home/millisami/rails_apps/automation/spec/controllers/outlets_controller_spec.rb /home/millisami/rails_apps/automation/spec/controllers/boards_controller_spec.rb /home/millisami/rails_apps/automation/spec/models/outlet_type_spec.rb /home/millisami/rails_apps/automation/spec/models/vendor_spec.rb /home/millisami/rails_apps/automation/spec/controllers/brands_controller_spec.rb /home/millisami/rails_apps/automation/spec/controllers/vendors_controller_spec.rb /home/millisami/rails_apps/automation/spec/controllers/dashboard_controller_spec.rb /home/millisami/rails_apps/automation/spec/models/brand_spec.rb /home/millisami/rails_apps/automation/spec/helpers/dashboard_helper_spec.rb /home/millisami/rails_apps/automation/spec/models/outlet_spec.rb /home/millisami/rails_apps/automation/spec/models/client_spec.rb /home/millisami/rails_apps/automation/spec/controllers/clients_controller_spec.rb -O spec/spec.opts

    Read the article

  • How abstract should you get with BDD

    - by Newton
    I was writing some tests in Gherkin (using Cucumber/Specflow). I was wondering how abstract should I get with my tests. In order to not make this open-ended, which of the following statements is better for BDD: Given I am logged in with email [email protected] and password 12345 When I do something Then something happens as opposed to Given I am logged in as the Administrator When I do something Then something happens The reason I am confused is because 1 is more based on the behaviour (filing in email and password) and 2 is easier to process and write the tests.

    Read the article

  • Undefined method `add' on a cucumber step that usually works.

    - by Josiah Kiehl
    I have a path defined: when /the admin home\s?page/ "/admin/" I have scenario that is passing: Scenario: Let admins see the admin homepage Given "pojo" is logged in And "pojo" is an "admin" And I am on the admin home page Then I should see "Hi there." And I have a scenario that is failing: Scenario: Review flagged photo Given "pojo" is logged in And "pojo" is an "admin" ...bunch of steps that create stuff in the database... And I am on the admin home page Then ... the rest of the steps The step that fails in the second one is "And I am on the admin home page" which passes just fine in the first scenario. Here's the error I get: And I am on the admin home page # features/step_definitions/web_steps.rb:18 undefined method `add' for {}:Hash (NoMethodError) ./app/controllers/admin_controller.rb:13:in `index' ./app/controllers/admin_controller.rb:11:in `each' ./app/controllers/admin_controller.rb:11:in `index' /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime' ./features/step_definitions/web_steps.rb:19:in `/^(?:|I )am on (.+)$/' features/admin.feature:52:in `And I am on the admin home page' This is very odd... why would it be fine in the first case, and not in the second where the only difference are a bunch of steps that create records in the db? [edit] Here's the add stuff to database step: Given /^there is a "([^\"]*)" with the following:$/ do |model, table| model.constantize.create!(table.rows_hash) end

    Read the article

  • How to handle Lightbox with Capybara , Selenium and Cucumber framework?

    - by Sushil
    Im trying to run test suite that will handle the jquery light-box. Light box contains a text-area and a submit button. Before Light box appears both of these fields are hidden. But selenium framework not understanding the visibility of these element in Light box. It just shows following error. And I fill comment box with "Text !!" # features/step_definitions/web_steps.rb:333 Element is not currently visible and so may not be interacted with (Selenium::WebDriver::Error::ElementNotVisibleError) [remote server] file:///tmp/webdriver-profile20120403-6182-1rd9z23/extensions/[email protected]/components/command_processor.js:9509:in `unknown' [remote server] file:///tmp/webdriver-profile20120403-6182-1rd9z23/extensions/[email protected]/components/command_processor.js:10510:in `unknown' [remote server] file:///tmp/webdriver-profile20120403-6182-1rd9z23/extensions/[email protected]/components/command_processor.js:10529:in `unknown' [remote server] file:///tmp/webdriver-profile20120403-6182-1rd9z23/extensions/[email protected]/components/command_processor.js:10534:in `unknown' [remote server] file:///tmp/webdriver-profile20120403-6182-1rd9z23/extensions/[email protected]/components/command_processor.js:10482:in `unknown' (eval):2:in `send' (eval):2:in `fill_in' ./features/step_definitions/web_steps.rb:335:in `/^I fill comment box with "([^"]*)"$/' features/courses_flow.feature:21:in `And I fill comment box with "Text !!"'

    Read the article

  • How to use bundler gem binaries in path

    - by Sean Chambers
    I just started using bundler for gem packaging in vendor/. The problem is with certain gems (like rspec and cucumber) that have binaries. The binary path that is under my_app/vendor/gems/ruby/1.8/...cucumber-0.6.2/bin/ is not in my path, therefore when I go to run cucumber i get command cannot be found. What is the easiest way to execute the bundled gem binaries from within the app rather than adding a large number of folders to my path? Thanks

    Read the article

  • pickle on jruby

    - by brad
    Does anyone know if pickle is compatible with jruby? I just installed cucumber and cucumber-rails. I then tried gem install pickle and it installs, but a script/generate pickle yields Couldn't find 'pickle' generator I did everything according to the readme no dice. Anyone have any experience with this: specs jruby-1.4.0 rails-2.3.5 cucumber 0.7.2 pickle 0.2.10

    Read the article

  • Under what circumstances would a Ruby $LOAD_PATH be acquired from a parent process?

    - by Dr Nic
    In my cucumber scenarios, if I call rake db:schema:load within a target Rails app folder, I get the cucumber process's $LOAD_PATH and not the Rails app's own Gemfile/load path. I think this is very weird. The consequence is that I get the following error: no such file to load -- rails/all I can't reproduce it outside of my cucumber scenario. ruby -rubygems -e "system 'rake -T'" works normally - the 'rake -T' has the application's own Gemfile-based $LOAD_PATH; and doesn't generate the error above. Can anyone think why a child process (rake -T or rake db:schema:load or rails runner...; invoked by either system, exec, %x[...] or backtick; would start with the parent processes' $LOAD_PATH (from the cucumber scenario's Gemfile) instead of its own $LOAD_PATH (from the Rails app's Gemfile)?

    Read the article

  • Advantages of BDD for solo developer

    - by user248959
    I have found this lines below about the advantages of BDD (Behavior Driven Development) The domain experts define what they need in the program in a way that the developers can not misinterpret (or at least not as much as in most other approaches). Are there any more advantages apart from that? If I'm working alone (I'm not in contact with managers that could write BDD features), do I need to use BDD?

    Read the article

  • How to organize unit/integration test in BDD

    - by whatf
    So finally after reading a lot, I have understood that the difference between BDD and TDD is between T & B. But coming from basic TDD background, what I used to was, first write unittest for database models write test for views (at this point start with integration test as well, along with unittests) write more integration tests for testing UI stuff. What would be a correct way to approach BDD. Say I have a simple blog application. Given : When a user logs in. He should be shown list of all his posts. But for this, I need a model with a row user, another row blog posts. So how do we go about writing tests? when do we create fixtures? When do we write integration (selenium) tests?

    Read the article

  • How to assert on number of html table rows in ruby using capybara + cucumber

    - by Neil
    I am trying to get to grips with BDD web development in Ruby using cucumber + capybara and I am stuck at what should be an easy task - just to check the number of rows in a table. Something along the lines of: page.should have_xpath("//table[@id='myTable']") find("//table[@id='myTable']/tr").length.should = 3 But this doesn't work and I can't find a way to assert against the table length. Any ideas anyone (please be easy on me tho' I'm a ruby nooby) Thanks in advance Neil

    Read the article

  • Robotium BDD with Cucumber

    - by LucasGomes
    I want to know if you guys know how to make BDD tests with Robotium. As I research Robotium works with a different Virtual Machine (Dalvik) so I cannot run as Junit Test (Only with Android Junit Test). So I found a possible solution to run Robotium with Junit with RoboRemote https://github.com/groupon/robo-remote. But when i tried to integrate with cucumber the tests became unstable. So you guys know some way to make BDD tests using Robotium?

    Read the article

  • Running Webrat with Selenium

    - by yuval
    I set up Cucumber+Webrat+Selenium according to this article. Whenever I run my server, though, I keep getting: ERROR Server Exception: sessionId should not be null; has this session been started yet? (Selenium::CommandError) Two hours on Google haven't done much for me. Could you please help out? Thanks! I am working on Ruby 1.8.7 and Rails 2.3.5 on Mac OS X 10.6. My installed gems in test.rb are: config.gem "database_cleaner", :lib => false, :version => ">=0.5.0" config.gem "rspec", :lib => false, :version => ">=1.2.2" config.gem "rspec-rails", :lib => false, :version => ">=1.2.2" config.gem "webrat", :lib => false, :version => ">=0.4.4" config.gem "cucumber", :lib => false, :version => ">=0.3.0" config.gem "thoughtbot-factory_girl", :lib => "factory_girl", :source => "http://gems.github.com" config.gem "pickle", :lib => false, :version => ">= 0.1.21" Thank you very much!

    Read the article

  • Logging in with webrat, celerity doesn't recognize that.

    - by Matthew Willhite
    I'm using cucumber with webrat, and I am just starting to integrate culerity/celerity. My webrat login steps have been working great, and I have them as a Background for many of my scenarios. The problem is that although I can log in successfully via webrat, my celerity specific step definitions don't seem to recognize that. I can check the session from the step def and it confirms that I have a valid user that is logged in. Any advice would be greatly appreciated! Thanks

    Read the article

  • Ruby assertions and disabled inputs

    - by brad
    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 :some_checkbox || assert_disabled :some_input. Or some way that I can check a property of the checkbox.

    Read the article

  • webrat, rspec, nokogiri segfault

    - by adamaig
    I'm getting a segfault in nokogiri (1.4.1) run (under cucumber 0.6.1/webrat 0.7.0/rspec 1.3.x) response.should have_selector("div", :class => "fieldWithErrors") and the div in the page is actually <div class="fieldWithErrors validation_error"> stuff </div> Everything runs fine if I just test nokogiri against a test document >> require 'nokogiri' >> doc = Nokogiri::HTML.parse("<div class='a b'>love to have problems</div>") => ... >> doc.css(".a") => [#<Nokogiri::XML::Element:0x3d62ac name="div" attributes=[#<Nokogiri::XML::Attr:0x3d6258 name="class" value="a b">] children=[#<Nokogiri::XML::Text:0x3d5e68 "love to have problems">]>] So I want to know how to setup a minimal webrat test of an html fragment document to help file a bug.

    Read the article

  • selenium cannot find element with class in IE

    - by Rob
    I'm using selenium_client with cucumber, webrat + IE As you'd expect, Firefox works fine. I've tried the following: selenium.is_visible("css=#flash .flash_notice") selenium.is_visible("xpath=//*[@id='flash']/*[@class='flash_notice]") selenium.is_visible("xpath=//*[@id='flash']/*[contains(@class,'flash_notice]')") both cannot find the element. I think it must be something to do with IE, looking closer at the html selenium returns from IE... It looks like this: <UL id=flash> <LI className=flash_notice>Deleted</LI> </UL> Notice IE returns the class attribute as className, is this confusing selenium? How can I get round this so that I can use the same statement for selenium using IE and Firefox Just to confuse us even more, this example works, confirming its something to do with checking the class attribute selenium.is_visible("xpath=//*[@id='flash']/*[. =\'Deleted\']")

    Read the article

  • Specing remember_me feature in rails + restful_authentication

    - by Thiago
    Hi there, I want to run a the following example in cucumber: Scenario: Anonymous user can log in and be remembered Given I am logged in with reminder When I navigate away And I go to the list of cornetas Then I should be logged in But I don't know how to write the "And I navigate away" step. I already tried to "visit stackoverflow.com" or "visit http://stackoverflow.com", but with no success. Any suggestions? I guess I could also destroy the webrat session, but I don't know how to do it, neither if it would work.

    Read the article

  • Regex issue with comma's telling me there are 6 args, instead of intended 4

    - by Azher
    I have a scenario outline table that looks like the following: Scenario Outline: Verify Full ad details Given I am on the xxx classified home page And I have entered <headline> in the search field & clicked on search When I click on full details Then I should see <headline> <year> <mileage> <price> displaying correctly and successfully Examples: |headline |year |mileage |price | |alfa romeo 166 |2005 |73,000 |6,990 | When I run my scenario it spits out that I have 6 args. But what I thought, I should only have 4 args: headline, year, mileage and price. I am thinking that it is taking the comma's and what is before and after it as two seperate args. Is there any way that I can make cucumber think that there are only 4 args with the example below? I have looked at messing around with regex but I dont seem to be getting anywhere. Any help would be greatly appreciated.

    Read the article

  • What is the difference between a restful route method for getting an index vs. creating a new object

    - by Jason
    According to rake routes, there's the same path for getting an index of objects as there is for creating a new object: cars GET /cars(.:format) {:controller=>"plugs", :what=>"car", :action=>"index"} POST /cars(.:format) {:controller=>"plugs", :what=>"car", :action=>"create"} Obviously, the HTTP verb is what distinguishes between them. I want the "create" version of the cars_path method, not the "index" version. My question is what route method do you invoke to choose the one you want? I'm telling cucumber what path to generate with this: when /the car plug preview page for "(.+)"/ cars_path(:action => :create, :method => :post) ...but it always chooses the "index" action, not "create". I've tried lots of combinations for the hash argument following cars_path and nothing changes it from choosing "index" instead of "create". I'll get an error like this: cars_url failed to generate from {:controller=>"plugs", :method=>:post, :what=>"car", :action=>"create"}, expected: {:controller=>"plugs", :what=>"car", :action=>"index"}, diff: {:method=>:post, :action=>"index"} (ActionController::RoutingError) This seems like a very simple question but I've had no luck googling for it, so could use some advice. Thanks.

    Read the article

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