Questions tagged [poltergeist]

Poltergeist is a Capybara driver for PhantomJS.

Poltergeist is a driver for Capybara. It allows you to run your Capybara tests on a headless WebKit browser, provided by PhantomJS.

490 questions
61
votes
4 answers

How do poltergeist/PhantomJS and capybara-webkit differ?

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 ...
Prashanth Sams
  • 19,677
  • 20
  • 102
  • 125
31
votes
2 answers

ReferenceError: Can't find variable: jQuery with Poltergeist/Capybara

What I'm trying to Do I'm trying to use capybara with poltergeist to log into amazon at this URL... https://developer.amazon.com/rp/sales.html Simple enough, except that when I try to submit the form, I get the error... ReferenceError: Can't…
Eric Slick
  • 319
  • 3
  • 3
30
votes
1 answer

How to return a value when using execute_script in capybara?

I have a really simple line in a test that calls execute script like this: puts page.execute_script("return somefunction();").to_i.inspect And in javascript I have a function like this: function somefunction(){ console.log("test"); return…
CafeHey
  • 5,699
  • 19
  • 82
  • 145
21
votes
6 answers

How can I test a rails 4 confirm dialog with Capybara and Poltergeist?

I'm trying to test that a link to a destroy action throws a native browser confirm box with the correct message. The link is being generated using rails' link_to: link_to 'Delete', user_path, method: :delete, data: { confirm: "Are you sure?" } And…
tommarshall
  • 2,038
  • 5
  • 23
  • 36
21
votes
5 answers

Poltergeist - turning off JQMIGRATE warnings

When running my test suite using poltergeist as the JavaScript driver, I am encountering the following warnings: JQMIGRATE: jQuery.fn.attr(selected) may use property instead of attribute JQMIGRATE: jQuery.browser is deprecated Is that possible to…
alexs333
  • 12,143
  • 11
  • 51
  • 89
21
votes
4 answers

Downloading file to specific folder using Capybara and Poltergeist driver

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…
rupesh
  • 241
  • 1
  • 3
  • 7
20
votes
1 answer

Why is Capybara discarding my session after one event?

Testing a rails application which has before_filter :authenticate_user! for most controllers, I cannot get Capybara to preserve a session. I have Capybara configured using PhantomJS with poltergeist. I use the following helper: require…
asfallows
  • 5,998
  • 6
  • 29
  • 48
19
votes
3 answers

Poltergeist throws JS errors when js_errors: false

I have a large test suite that is using poltergeist and capybara. I keep getting the following error: One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors:…
ruby_newbie
  • 3,190
  • 3
  • 18
  • 29
17
votes
3 answers

How to get HTML of an element when using Poltergeist?

I'm using Capybara with the Poltergeist driver. My question is: how to get the HTML (string) of a node? I've read that using the RackTest driver you can get it like this: find("table").native #=> native Nokogiri…
Janko
  • 8,985
  • 7
  • 34
  • 51
17
votes
4 answers

send_keys support for Poltergeist?

I want to switch from Selenium to Poltergeist but I need to simulate a barcode scanner that looks like keyboard entry to the tag. I use this code with Selenium: native.send_keys(send_key) Is there a way with Poltergeist to send a string of…
Kevin Triplett
  • 582
  • 5
  • 11
15
votes
5 answers

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

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…
15
votes
5 answers

Capybara, capybara-webkit and custom file upload form

I have created custom upload form using the following html stack:
The file field is hidden via css with display: none property. So the file attach dialogue is being called by user when she…
Ruslan
  • 1,208
  • 3
  • 17
  • 28
15
votes
2 answers

How can I write javascript tests that don't timeout or fail randomly with rspec, capybara, and poltergeist?

I have been having problems with my tests timing out and failing randomly. I have been looking around for best practices of how to write robust capybara integration tests but I don't find anything helpful. Ever since we started writing a bunch of…
PeppyHeppy
  • 1,345
  • 12
  • 20
13
votes
2 answers

How can I get the current hostname and port when running Capybara with Poltergeist?

I have a test program that mimics a user's iOS device by sending chunks of data to a rails server. This program works fine outside of testing. Inside of testing, the program immediately times out since it cannot find the server. My configuration,…
mmr
  • 14,781
  • 29
  • 95
  • 145
12
votes
1 answer

Gem integration tests fail with jQuery not found

I have a gem called "fantastic" with a dummy app inside to test. When running the dummy app, everything works well. However, when I run the tests, unit tests works fine, but integration tests (Capybara + Poltergeist) fail with the…
ascherman
  • 1,762
  • 2
  • 20
  • 41
1
2 3
32 33