capybara-webkit

Capybara Webkit Capybara::Webkit::ConnectionError failed to start

我的梦境 提交于 2019-12-05 06:35:26
I'm using capybara webkit on Ubuntu (14.04 LTS) and I'm getting the following error when trying to use it: Capybara::Webkit::ConnectionError: /srv/www/app/shared/bundle/ruby/2.1.0/gems/capybara-webkit-1.3.1/bin/webkit_server failed to start. from /srv/www/app/shared/bundle/ruby/2.1.0/gems/capybara-webkit-1.3.1/lib/capybara/webkit/connection.rb:75:in `parse_port' from /srv/www/app/shared/bundle/ruby/2.1.0/gems/capybara-webkit-1.3.1/lib/capybara/webkit/connection.rb:81:in `discover_port' from /srv/www/app/shared/bundle/ruby/2.1.0/gems/capybara-webkit-1.3.1/lib/capybara/webkit/connection.rb:62:in

Capybara-webkit tries to open example.com

倾然丶 夕夏残阳落幕 提交于 2019-12-04 16:52:19
问题 I'm using capybara, capybara-webkit, capybara-screenshot together with cucumber. (Ruby 1.9.3, Rails 3.1.3) and Capybara.javascript_driver = :webkit is also set env.rb Unfortunately running a cucumber spec with @javascript will never succeed for some reason and the error screenshots just capture example.com. The URL which I actually try to open is generated with a rails router result for one of my models e.g. with visit products_url So how can I avoid that it ends up querying example.com? Any

vcr with capybara-webkit

匆匆过客 提交于 2019-12-04 08:26:21
问题 I'm using capybara-webkit to test integration with a third party website (I need javascript). I want to use vcr to record requests made during the integration test but capybara-webkit doesn't go over net http so vcr is unable to record them. How would I go about writing an adaptor for vcr that would allow me to record the reqeusts? 回答1: Unfortunately, VCR is very much incompatible with capybara-webkit. The fact is that capybara webkit is using webkit, which is in c. Webmock and Fakeweb, which

Does Capybara require sleep to work?

大城市里の小女人 提交于 2019-12-04 03:22:45
Apparently, sleep or wait_until are not valid using recent versions of Capybara, according to the webpage updates . However, I have a set of tests that only work on fast machines if I add a sleep(1) call to the test. That is, a test that looks like: describe "dosimeters page" do before do click_link("Dosimeter Read History", :match=>:first) end ... becomes describe "dosimeters page" do before do unix_wait click_link("Dosimeter Read History", :match=>:first) end ... where I've defined unix_wait as: def unix_wait case RbConfig::CONFIG['host_os'] when /darwin/ when /linux-gnu/ sleep(1) end end

Capybara integration tests with jquery.selectize

坚强是说给别人听的谎言 提交于 2019-12-04 03:12:13
问题 How can I write a capybara integration test with a form using jquery.selectize? I'd like to test a user entering a couple of values. 回答1: I created a helper that I mix in to my capybara feature specs: module PageSteps def fill_in_selectized(key, *values) values.flatten.each do |value| page.execute_script(%{ $('.#{key} .selectize-input input').val('#{value}'); $('##{key}').selectize()[0].selectize.createItem(); }) end end end And here's an example of how it is used: # Single value fill_in

Database Cleaner issue with Capybara webkit

爷,独闯天下 提交于 2019-12-03 13:29:12
问题 I am using Cucumber to write my integration tests and Database Cleaner to keep my db clean. Everything perfectly works as my tests don't require Javascript. I can make these last tests pass using Capybara webkit, but then my db is not cleaned at all. Here is my features/support/env.rb file: require 'simplecov' SimpleCov.start 'rails' require 'cucumber/rails' Capybara.default_selector = :css Capybara.javascript_driver = :webkit begin require 'database_cleaner' require 'database_cleaner

Rails3 form_for hidden_field undefined method 'merge'

安稳与你 提交于 2019-12-03 11:50:47
My attempt to place a hidden_field within a form_for is crashing within cucumber on an ActionView helper error. Something also about FixNum which escapes me since I haven't dug through the source code. My prices_controller shows this: @price = Price.new @commodity = Commodity.find(params[:id]) I want to make the link between price and commodity with this hidden_field: <%= form_for (@price), :url => prices_path do |f| %> <% f.hidden_field :commodity_id, @commodity.id %> . . <div class="actions"> <%= f.submit "Submit" %> </div> Looked at the form_for api and the above should work. Reading other

Capybara-webkit tries to open example.com

北慕城南 提交于 2019-12-03 10:40:12
I'm using capybara, capybara-webkit, capybara-screenshot together with cucumber. (Ruby 1.9.3, Rails 3.1.3) and Capybara.javascript_driver = :webkit is also set env.rb Unfortunately running a cucumber spec with @javascript will never succeed for some reason and the error screenshots just capture example.com. The URL which I actually try to open is generated with a rails router result for one of my models e.g. with visit products_url So how can I avoid that it ends up querying example.com? Any input is very welcome. Just because the comment is messed up - here's what I found was the solution:

Database Cleaner issue with Capybara webkit

北城余情 提交于 2019-12-03 02:51:07
I am using Cucumber to write my integration tests and Database Cleaner to keep my db clean. Everything perfectly works as my tests don't require Javascript. I can make these last tests pass using Capybara webkit , but then my db is not cleaned at all. Here is my features/support/env.rb file: require 'simplecov' SimpleCov.start 'rails' require 'cucumber/rails' Capybara.default_selector = :css Capybara.javascript_driver = :webkit begin require 'database_cleaner' require 'database_cleaner/cucumber' DatabaseCleaner[:active_record].strategy = :transaction rescue NameError raise "You need to add

vcr with capybara-webkit

泪湿孤枕 提交于 2019-12-02 23:12:42
I'm using capybara-webkit to test integration with a third party website (I need javascript). I want to use vcr to record requests made during the integration test but capybara-webkit doesn't go over net http so vcr is unable to record them. How would I go about writing an adaptor for vcr that would allow me to record the reqeusts? Unfortunately, VCR is very much incompatible with capybara-webkit. The fact is that capybara webkit is using webkit, which is in c. Webmock and Fakeweb, which are the basis for VCR, can only be used for Ruby web requests. Making the two work together would likely be