Skip to content

Instantly share code, notes, and snippets.

@the55
Created July 4, 2012 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the55/3044358 to your computer and use it in GitHub Desktop.
Save the55/3044358 to your computer and use it in GitHub Desktop.
master card ATM
require 'rubygems'
# require 'akephalos'
require 'capybara'
require 'capybara/dsl'
require 'capybara-webkit'
# require 'pry'
Capybara.run_server = false
Capybara.current_driver = :selenium
# Capybara.javascript_driver = :akephalos
Capybara.javascript_driver = :webkit
Capybara.app_host = 'http://www.mastercard.us/'
module MyCapybaraTest
class Test
include Capybara
def test_cards
['02143', '12866', '02138'].each do |zip|
visit('/cardholder-services/atm-locator.html')
sleep 4
fill_in 'postalCode', :with => zip
click_button 'find'
sleep 5
puts "count for #{zip} - #{all("#endNumber").first.text}"
end
end
end
end
t = MyCapybaraTest::Test.new
t.test_cards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment