Skip to content

Instantly share code, notes, and snippets.

@pzol
Created January 13, 2012 18:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save pzol/1607842 to your computer and use it in GitHub Desktop.
Save pzol/1607842 to your computer and use it in GitHub Desktop.
capybara poltergeist test

This was a test with Poltergeist I did the other day

#!ruby
def polter
   noop
end
require 'rspec'
require 'capybara/rspec'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, debug: true)
end
describe 'poltergeist', :type => :request, :js => true do
it 'should find github poltergeist in google' do
visit 'http://www.google.com/'
fill_in "q", :with => "github poltergeist"
click_button "btnK"
page.should have_content 'jonleighton/poltergeist'
end
end
{"name"=>"visit", "args"=>["http://www.google.com/"]}
{"response"=>"success"}
{"name"=>"find", "args"=>[".//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')][((./@id = 'q' or ./@name = 'q') or ./@id = //label[normalize-space(string(.)) = 'q']/@for)] | .//label[normalize-space(string(.)) = 'q']//.//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')]", nil]}
{"response"=>[0]}
{"name"=>"visible", "args"=>[0]}
{"response"=>true}
{"name"=>"tag_name", "args"=>[0]}
{"response"=>"INPUT"}
{"name"=>"attribute", "args"=>[0, :type]}
{"response"=>""}
{"name"=>"set", "args"=>[0, "github poltergeist"]}
{"response"=>true}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or ./@value = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK'] | .//button[(((./@id = 'btnK' or ./@value = 'btnK') or normalize-space(string(.)) = 'btnK') or ./@title = 'btnK')] | .//input[./@type = 'image'][./@alt = 'btnK']", nil]}
{"response"=>[]}
{"name"=>"find", "args"=>[".//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')] | .//button[(((./@id = 'btnK' or contains(./@value, 'btnK')) or contains(normalize-space(string(.)), 'btnK')) or contains(./@title, 'btnK'))] | .//input[./@type = 'image'][contains(./@alt, 'btnK')]", nil]}
{"response"=>[]}
{"name"=>"reset", "args"=>[]}
{"response"=>true}
F
Failures:
1) poltergeist should find github poltergeist in google
Failure/Error: click_button "btnK"
Capybara::ElementNotFound:
no button with value or id or text 'btnK' found
# (eval):2:in `click_button'
# ./spec_acceptance/acceptance/transactions/google_poltergeist_spec.rb:17:in `block (2 levels) in <top (required)>'
Finished in 7.32 seconds
1 example, 1 failure
Failed examples:
rspec ./spec_acceptance/acceptance/transactions/google_poltergeist_spec.rb:13 # poltergeist should find github poltergeist in google
rspec -I spec_acceptance 4.92s user 1.21s system 64% cpu 9.519 total
@rearviewmirror
Copy link

on google_poltergeist_spec.rb. line: 17

find_button("btnk").trigger('click')
might work this way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment