jonleighton/poltergeist — Issue #5: check() doesn't work
Author: rb2k
Created: 2011-11-02 15:32:35+00:00
State: open

I have the feeling that .check() doesn't work for me on poltergeist:

I modified the set() method a bit to get feedback, I also changed

if value && !checked? || !value && checked?
to
value != checked?

Here's the modified method:

def set(value)
if tag_name == 'input'
type = self[:type]
if type == 'radio'
click
elsif type == 'checkbox'
if value != checked?
puts "Checkbox state before click: '#{checked?}'."
click
puts "Checkbox state after click: '#{checked?}'."
end
elsif type == 'file'
command :select_file, value
else
command :set, value
end
elsif tag_name == 'textarea'
command :set, value
end
end

Here is the output:

Checkbox state before click: 'true'.
Checkbox state after click: 'true'.

So the click doesn't really seem to do the trick as far as I can see