1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
teamcapybara--capybara/spec/session_with_javascript_support_spec.rb
Jonas Nicklas 6204142a8c Revert "added click_element with specs (only works in webdriver so far)"
I think I changed my mind about this, I think this method clutters the API

This reverts commit 7b8e6a640d.
2009-12-17 18:22:12 +01:00

53 lines
1.4 KiB
Ruby

require File.expand_path('spec_helper', File.dirname(__FILE__))
require 'nokogiri'
shared_examples_for "session with javascript support" do
describe "#evaluate_script" do
before{ @session.visit('/with_js') }
it "should return the evaluated script" do
@session.evaluate_script("1+3").should == 4
end
end
describe '#wait_for' do
it "should wait for asynchronous load" do
@session.visit('/with_js')
@session.click_link('Click me')
@session.wait_for("//a[contains(.,'Has been clicked')]")[:href].should == '#'
end
end
describe '#click' do
it "should wait for asynchronous load" do
@session.visit('/with_js')
@session.click_link('Click me')
@session.click('Has been clicked')
end
end
describe '#click_link' do
it "should wait for asynchronous load" do
@session.visit('/with_js')
@session.click_link('Click me')
@session.click_link('Has been clicked')
end
end
describe '#click_button' do
it "should wait for asynchronous load" do
@session.visit('/with_js')
@session.click_link('Click me')
@session.click_button('New Here')
end
end
describe '#fill_in' do
it "should wait for asynchronous load" do
@session.visit('/with_js')
@session.click_link('Click me')
@session.fill_in('new_field', :with => 'Testing...')
end
end
end