Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
Fix frame locator in Frame#attach_command
Browse files Browse the repository at this point in the history
Fixes Issue 45.
  • Loading branch information
Justin Ko committed Dec 20, 2012
1 parent 83590f5 commit e88eb5c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/watir-classic/frame.rb
Expand Up @@ -40,7 +40,7 @@ def document
end

def attach_command
@container.page_container.attach_command + ".frame(#{@specifiers.inspect})".gsub('"','\'')
@container.page_container.attach_command + ".frame(:unique_number => #{unique_number})"
end

end
Expand Down
17 changes: 17 additions & 0 deletions spec/frame.rb
@@ -0,0 +1,17 @@
# encoding: utf-8
require File.expand_path("watirspec/spec_helper", File.dirname(__FILE__))

describe "Frame" do
before :each do
browser.goto(WatirSpec.url_for("frames.html"))
end

it "handles clicking elements without waiting" do
browser.frame(:id, "frame_1").text_field(:name, 'senderElement').value.should == 'send_this_value'
browser.frame(:id, "frame_2").text_field(:name, 'recieverElement').value.should == 'old_value'
browser.frame(:id, "frame_1").button(:id, 'send').click_no_wait
browser.frame(:id, "frame_2").text_field(:name, 'recieverElement').value.should == 'old_value'
browser.frame(:id, "frame_2").text_field(:name => 'recieverElement', :text => 'send_this_value').wait_until_present(10).should_not raise_error(Watir::Wait::TimeoutError)
end

end

0 comments on commit e88eb5c

Please sign in to comment.