poltergeist

Downloading file to specific folder using Capybara and Poltergeist driver

我怕爱的太早我们不能终老 提交于 2019-11-28 19:24:55
I am writing my acceptance tests using Capybara and Poltergeist driver.I need to validate the content of the CSV file downloaded. I tried various ways of rendering the content on the page itself instead of downloading it. Also tried changing the mime types, but it is not working. Finally I want to settle down with the option of downloading the file in a specific folder and then read the CSV file using core ruby libraries. In order to achieve this,when poltergeist driver clicks on download link then I want it to handle the pop-up and download the file directly in the given folder. In Selenium's

How do poltergeist/PhantomJS and capybara-webkit differ?

…衆ロ難τιáo~ 提交于 2019-11-28 16:57:50
问题 What are the differences between PhantomJS and capybara-webkit? What are the advantages of capybara-webkit over PhantomJS? Which of the two is the most efficient tool? Others ... 回答1: poltergeist is the capybara driver for PhantomJS, a headless browser which is built on WebKit. capybara-webkit is a capybara driver which uses WebKit directly. poltergeist/PhantomJS has some big advantages over capybara-webkit: In my experience poltergeist/PhantomJS always times out when it should, whereas

Capybara, Poltergeist and Phantomjs and giving an empty response in body

一曲冷凌霜 提交于 2019-11-28 05:49:18
问题 I am getting am empty document back from phantomjs. I am trying to use Capybara and Poltergeist for setting up the phantomjs driver for Capybara. I created a module as follows and included it in the file that uses needs to connect. require 'capybara/poltergeist' module Parser module JSParser include Capybara # Create a new PhantomJS session in Capybara def new_session # Register PhantomJS (aka poltergeist) as the driver to use Capybara.register_driver :poltergeist do |app| Capybara:

Why can't my Capybara/Poltergeist test select from a jQuery autocomplete field?

时光怂恿深爱的人放手 提交于 2019-11-26 21:49:01
问题 UPDATE: I have fixed this problem after lots of painstaking work on my own. I am happy to be a resource to anybody needing a hand with this. Here is a gist of my working setup. I have tried every solution I could find Google and SO. Here are some different things I have tried: page.execute_script %Q{$('#{selector}').val('#{value}').trigger('keydown')} and fill_in field, with: options[:with] page.execute_script %Q{ $('##{field}').trigger('focus') } page.execute_script %Q{ $('##{field}')