jonleighton/poltergeist — Issue #1: Problem with ?submitting a form?
Author: rb2k
Created: 2011-10-30 08:46:45+00:00
State: open

I just gave poltergeist a try and I'm pretty excited.
This one is a bit harder to reproduce and I'm still trying to come up with a minimal exception.
I tried to test a Drupal Commons installation (code [over here](https://github.com/acquia/commons)).

What works on selenium, akephalos, capybara-webkit seems to not do anything on poltergeist.

visit("/admin/user/user/create")
within('form#user-register') do
page.fill_in 'edit-name', :with => username
page.fill_in 'edit-mail', :with => "mail#{rand(10000)}@example.com"
page.fill_in 'edit-pass-pass1', :with => password
page.fill_in 'edit-pass-pass2', :with => password
page.fill_in 'edit-profile-name', :with => "John"
page.fill_in 'edit-profile-last-name', :with => "Doe"
end
click_button('Create new account')
page.find("div.messages.status").text.should include('Created a new user account')

This crashes because it can't seem to find the div.messages.status and the user doesn't actually seem to get created. I can't get the driver to take a proper screenshot, it only seems to capture a part of the page ( example: [example](http://i.imgur.com/tWxi4.png) )

Here's the debug output:

{"args"=>["http://development.local/admin/user/user/create"], "name"=>"visit"}
{"response"=>"success"}
{"args"=>[".//form[@id = 'user-register']", nil], "name"=>"find"}
{"response"=>[0]}
{"args"=>[0], "name"=>"visible"}
{"response"=>true}
{"args"=>[".//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')][((./@id = 'edit-name' or ./@name = 'edit-name') or ./@id = //label[normalize-space(string(.)) = 'edit-name']/@for)] | .//label[normalize-space(string(.)) = 'edit-name']//.//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')]", 0], "name"=>"find"}
{"response"=>[1]}
{"args"=>[1], "name"=>"visible"}
{"response"=>true}
{"args"=>[1], "name"=>"tag_name"}
{"response"=>"INPUT"}
{"args"=>[1, :type], "name"=>"attribute"}
{"response"=>"text"}
{"args"=>[1, "derpington"], "name"=>"set"}
{"response"=>true}
{"args"=>[".//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')][((./@id = 'edit-mail' or ./@name = 'edit-mail') or ./@id = //label[normalize-space(string(.)) = 'edit-mail']/@for)] | .//label[normalize-space(string(.)) = 'edit-mail']//.//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')]", 0], "name"=>"find"}
{"response"=>[2]}
{"args"=>[2], "name"=>"visible"}
{"response"=>true}
{"args"=>[2], "name"=>"tag_name"}
{"response"=>"INPUT"}
{"args"=>[2, :type], "name"=>"attribute"}
{"response"=>"text"}
{"args"=>[2, "mail4502@example.com"], "name"=>"set"}
{"response"=>true}
{"args"=>[".//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')][((./@id = 'edit-pass-pass1' or ./@name = 'edit-pass-pass1') or ./@id = //label[normalize-space(string(.)) = 'edit-pass-pass1']/@for)] | .//label[normalize-space(string(.)) = 'edit-pass-pass1']//.//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')]", 0], "name"=>"find"}
{"response"=>[3]}
{"args"=>[3], "name"=>"visible"}
{"response"=>true}
{"args"=>[3], "name"=>"tag_name"}
{"response"=>"INPUT"}
{"args"=>[3, :type], "name"=>"attribute"}
{"response"=>"password"}
{"args"=>[3, "samplepass"], "name"=>"set"}
{"response"=>true}
{"args"=>[".//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')][((./@id = 'edit-pass-pass2' or ./@name = 'edit-pass-pass2') or ./@id = //label[normalize-space(string(.)) = 'edit-pass-pass2']/@for)] | .//label[normalize-space(string(.)) = 'edit-pass-pass2']//.//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')]", 0], "name"=>"find"}
{"response"=>[4]}
{"args"=>[4], "name"=>"visible"}
{"response"=>true}
{"args"=>[4], "name"=>"tag_name"}
{"response"=>"INPUT"}
{"args"=>[4, :type], "name"=>"attribute"}
{"response"=>"password"}
{"args"=>[4, "samplepass"], "name"=>"set"}
{"response"=>true}
{"args"=>[".//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')][((./@id = 'edit-profile-name' or ./@name = 'edit-profile-name') or ./@id = //label[normalize-space(string(.)) = 'edit-profile-name']/@for)] | .//label[normalize-space(string(.)) = 'edit-profile-name']//.//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')]", 0], "name"=>"find"}
{"response"=>[5]}
{"args"=>[5], "name"=>"visible"}
{"response"=>true}
{"args"=>[5], "name"=>"tag_name"}
{"response"=>"INPUT"}
{"args"=>[5, :type], "name"=>"attribute"}
{"response"=>"text"}
{"args"=>[5, "John"], "name"=>"set"}
{"response"=>true}
{"args"=>[".//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')][((./@id = 'edit-profile-last-name' or ./@name = 'edit-profile-last-name') or ./@id = //label[normalize-space(string(.)) = 'edit-profile-last-name']/@for)] | .//label[normalize-space(string(.)) = 'edit-profile-last-name']//.//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')]", 0], "name"=>"find"}
{"response"=>[6]}
{"args"=>[6], "name"=>"visible"}
{"response"=>true}
{"args"=>[6], "name"=>"tag_name"}
{"response"=>"INPUT"}
{"args"=>[6, :type], "name"=>"attribute"}
{"response"=>"text"}
{"args"=>[6, "Doe"], "name"=>"set"}
{"response"=>true}
{"args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'Create new account' or ./@value = 'Create new account') or ./@title = 'Create new account')] | .//input[./@type = 'image'][./@alt = 'Create new account'] | .//button[(((./@id = 'Create new account' or ./@value = 'Create new account') or normalize-space(string(.)) = 'Create new account') or ./@title = 'Create new account')] | .//input[./@type = 'image'][./@alt = 'Create new account']", nil], "name"=>"find"}
{"response"=>[7]}
{"args"=>[7], "name"=>"visible"}
{"response"=>true}
{"args"=>[7], "name"=>"click"}
{"response"=>true}
{"args"=>["/Users/mseeger/Desktop/derp.png"], "name"=>"render"}
Oct 30 09:42:04 macbookpro.box phantomjs[8131] : CGContextSetShouldAntialias: invalid context 0x0
Oct 30 09:42:04 macbookpro.box phantomjs[8131] : CGContextSetShouldSmoothFonts: invalid context 0x0
Oct 30 09:42:04 macbookpro.box phantomjs[8131] : CGContextSetFillColorSpace: invalid context 0x0
Oct 30 09:42:04 macbookpro.box phantomjs[8131] : CGContextSetFillColor: invalid context 0x0
{"response"=>true}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}
{"args"=>[".//div[contains(concat(' ', @class, ' '), ' messages ') and contains(concat(' ', @class, ' '), ' status ')]", nil], "name"=>"find"}
{"response"=>[]}