Created
July 18, 2011 15:18
-
-
Save alkema/1089830 to your computer and use it in GitHub Desktop.
akephalos-js-test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'capybara' | |
require 'capybara/dsl' | |
require 'akephalos' | |
Capybara.run_server = true | |
Capybara.current_driver = :akephalos | |
Capybara.app_host = 'http://localhost:8081' | |
module MyCapybaraTest | |
class Test | |
include Capybara | |
def join_group | |
p 'Logging in...' | |
visit('/') | |
within 'form[name=game]' do | |
fill_in 'name', with: 'jody' | |
end | |
click_button 'Start' | |
page.execute_script("x$('#friend').html('ruby')") | |
end | |
end | |
end | |
t = MyCapybaraTest::Test.new | |
t.join_group | |
puts t.page.body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment