Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Error on tr:last selector #296

Closed
morgoth opened this Issue · 4 comments

4 participants

@morgoth

I tried to upgrade to Capybara 2.1 and poltergeist from master.

One of my test is having selector: table tr:last

This was working fine with Capybara 2.0.x and poltergeist 1.1.0, however now throws error:

*** Capybara::Poltergeist::BrowserError Exception: There was an error inside the PhantomJS portion of Poltergeist. This is probably a bug, so please report it.
[object Object]
    at /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bundler/gems/poltergeist-8131407ad162/lib/capybara/poltergeist/client/compiled/web_page.js:336
    at /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bundler/gems/poltergeist-8131407ad162/lib/capybara/poltergeist/client/compiled/web_page.js:36
    at /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bundler/gems/poltergeist-8131407ad162/lib/capybara/poltergeist/client/compiled/browser.js:134
    at about:blank:35
    at /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bundler/gems/poltergeist-8131407ad162/lib/capybara/poltergeist/client/compiled/connection.js:17
    at /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bundler/gems/poltergeist-8131407ad162/lib/capybara/poltergeist/client/compiled/connection.js:1
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bundler/gems/poltergeist-8131407ad162/lib/capybara/poltergeist/browser.rb:220:in `command'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bundler/gems/poltergeist-8131407ad162/lib/capybara/poltergeist/browser.rb:52:in `find'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bundler/gems/poltergeist-8131407ad162/lib/capybara/poltergeist/driver.rb:114:in `find'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/bundler/gems/poltergeist-8131407ad162/lib/capybara/poltergeist/driver.rb:122:in `find_css'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/node/finders.rb:152:in `block in resolve_query'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/node/base.rb:77:in `synchronize'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/node/finders.rb:150:in `resolve_query'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/node/finders.rb:35:in `block in find'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/node/base.rb:81:in `synchronize'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/node/finders.rb:30:in `find'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/session.rb:354:in `block (2 levels) in <class:Session>'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/session.rb:221:in `within'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
    /home/wojtek/Projects/tiramizoo/test/support/integration/booking_helper.rb:30:in `add_package'
    /home/wojtek/Projects/tiramizoo/test/integration/booking_test.rb:78:in `block in <class:BookingTest>'
    /home/wojtek/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/mocha-0.13.3/lib/mocha/integration/mini_test/version_230_to_2101.rb:36:in `run'

PhantomJS version: 1.8.2

@jonleighton
Owner

table tr:last is not a valid CSS selector, but we need a better error in this case.

@DaveSanders

This seems a perfectly valid reason / solution to me. However is there a reason to not support the expanded "jquery" style selectors? I ran into tr:last as well as div:contains. Only suggesting because I suspect there are several of us coming from the capybara-webkit world where such selectors do work. (and they provide better flexibility)

Then again, I don't know if that's a poltergeist issue or a Phantom issue, so perhaps not in your hands.

@tgaff

I don't think this is poltergeist specific. We encountered similar issues with it using selenium during capy2.1 update. See also mhoran's comment here thoughtbot/capybara-webkit#510

@DaveSanders

Ah, got it. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.