poltergeist

List child elements for a Capybara/Poltergeist element

▼魔方 西西 提交于 2019-12-08 21:13:57
问题 I've searched around and I can't find a way to do this. We are running Capybara tests with the Poltergeist driver in cucumber features on an EmberJS/Rails app. I can't use page.driver.debug because I'm running inside a headless vagrant instance, so that troubleshooting is not available to me, but screenshots work, and a Chrome dev tools inspect on the page in question shows the right elements. I have a cucumber scenario that's failing, and it's because the find isn't working. My test looks

Capybara Poltergeist/PhantomJS testing - disable javascript on a page

送分小仙女□ 提交于 2019-12-08 01:59:29
问题 On of my projects is fairly javascript intensive, so I have a <noscript> alert for users that might come in with Javascript disable on their browsers. I'm trying to write a test for my test suite that just validates this behavior, but I can't figure out how to tell Capybara/Poltergeist (which I use for my feature tests) to disable javascript before making requests. I can't find anything clear in the documentation. Has anyone else run into something like this? 回答1: So, I still have no idea how

Capybara Poltergeist/PhantomJS testing - disable javascript on a page

﹥>﹥吖頭↗ 提交于 2019-12-06 12:13:24
On of my projects is fairly javascript intensive, so I have a <noscript> alert for users that might come in with Javascript disable on their browsers. I'm trying to write a test for my test suite that just validates this behavior, but I can't figure out how to tell Capybara/Poltergeist (which I use for my feature tests) to disable javascript before making requests. I can't find anything clear in the documentation. Has anyone else run into something like this? So, I still have no idea how to do this in Poltergeist, but I figured out how to get it set up in Selenium: Capybara.register_driver

Phantom JS Error with youtube video

馋奶兔 提交于 2019-12-06 02:22:22
问题 Phantom JS Version: 1.9.1 Poltergeist Version: 1.3.0 Starting today youtube embedded videos now give a poltergeist error when running javascript tests. My youtube code is just the default embed youtube code. Here's a example: <iframe width="560" height="315" src="//www.youtube.com/embed/AW9Z3cGOlGM?rel=0" frameborder="0" allowfullscreen></iframe> And the errors I get just from visiting that page while enabling javascript is: Failure/Error: page.find(".container.registrations.false.government"

Temporarily set js_errors to false in Poltergeist

ε祈祈猫儿з 提交于 2019-12-05 15:18:37
问题 I have a set of tests which lead to a Facebook page where the user logs in. Unfortunately, this page has some JavaScript errors which I can't influence, so my tests would never finish. Is there any way to temporarily disable the check for JS errors? I was thinking about something like: Capybara.javascript_driver.js_errors = false and then setting it to true later, but unfortunately this doesn't work. I have tried variations of this to no avail. Any ideas on how my problem could be solved? 回答1

Error when running specs: Poltergeist detected another element with CSS selector

爱⌒轻易说出口 提交于 2019-12-05 02:34:48
问题 I added activeadmin in my Gemfile. I ran: rails g active_admin:install Admin User rake db:migrate Then I ran: bundle exec rake test:integrations and I got this error: Capybara::Poltergeist::ClickFailed: Click at co-ordinates [330.5, 714] failed. Poltergeist detected another element with CSS selector 'html body div#ui-datepicker-div.ui-datepicker.ui-widget.ui-widget-content.ui-helper-clearfix.ui-corner-all div.ui-datepicker-header.ui-widget-header.ui-helper-clearfix.ui-corner-all div.ui

Unreliable/Flakey Capybara/AngularJS Integration Tests With Timing Issues

放肆的年华 提交于 2019-12-04 14:05:54
问题 How do I make these tests reliably pass? Currently these tests are flakey. Sometimes they pass. Sometimes they fail. Below is the setup, code and output demonstrating this issue. Suggestions to overcome this issue will be greatly appreciated and I am sure will help many others, so please comment! Test Code Environment Rails 3.2 RSpec 2.x Capybara Poltergeist PhantomJS AngularJS Google Chrome Version 47.0.2526.106 (64-bit) Testing Gems from Gemfile.lock capybara (2.1.0) database_cleaner (0.7.1

Phantom JS Error with youtube video

為{幸葍}努か 提交于 2019-12-04 06:59:38
Phantom JS Version: 1.9.1 Poltergeist Version: 1.3.0 Starting today youtube embedded videos now give a poltergeist error when running javascript tests. My youtube code is just the default embed youtube code. Here's a example: <iframe width="560" height="315" src="//www.youtube.com/embed/AW9Z3cGOlGM?rel=0" frameborder="0" allowfullscreen></iframe> And the errors I get just from visiting that page while enabling javascript is: Failure/Error: page.find(".container.registrations.false.government")["style"].should have_content("test.jpg") Capybara::Poltergeist::JavascriptError: One or more errors

How to set text into Summernote textarea with Capybara + Poltergeist

本秂侑毒 提交于 2019-12-04 03:47:23
问题 I have a textarea which is using Summernote and I set onChange event to it. I want to write test with RSpec + Capybara + Poltergeist to confirm the onChange event is working. As far as I checked, the textarea displayed in browser is actually div tag with 'note-editable' css class. How can I set text to it and fire onChange event? I wrote a code like this, but got an error Capybara::ElementNotFound: Unable to find field "Some label" : visit edit_foo_path fill_in 'Some label', with: 'Foo bar'

Temporarily set js_errors to false in Poltergeist

寵の児 提交于 2019-12-04 01:52:15
I have a set of tests which lead to a Facebook page where the user logs in. Unfortunately, this page has some JavaScript errors which I can't influence, so my tests would never finish. Is there any way to temporarily disable the check for JS errors? I was thinking about something like: Capybara.javascript_driver.js_errors = false and then setting it to true later, but unfortunately this doesn't work. I have tried variations of this to no avail. Any ideas on how my problem could be solved? Thanks to Roman Pominov's comment I was able to find a solution. It was actually quite simple: I just