Permalink
Browse files

fix Form#name

  • Loading branch information...
1 parent d53cb1e commit 72a4dc1c049fe37f8d92168b4714cd8129ad56c0 @jarmo jarmo committed Mar 12, 2012
Showing with 7 additions and 32 deletions.
  1. +7 −2 watir/lib/watir/form.rb
  2. +0 −30 watir/unittests/form_test.rb
View
@@ -7,11 +7,16 @@ def initialize(container, specifiers)
end
attr_ole :action
- attr_ole :name
+
+ def name
+ assert_exists
+ name = ole_object.getAttributeNode('name')
+ name ? name.value : ''
+ end
def form_method
assert_exists
- @o.invoke('method')
+ ole_object.invoke('method')
end
def method(arg = nil)
@@ -80,36 +80,6 @@ def test_forms_collection
end
end
-class TC_Form_Display < Test::Unit::TestCase
- include CaptureIOHelper
- def test_showforms
- goto_page "forms2.html"
- actual = capture_stdout { browser.showForms }
- expected = <<END_OF_MESSAGE
-There are 4 forms
-Form name:
- id:
- method: get
- action: pass.html
-Form name: test2
- id: f2
- method: get
- action: pass2.html
-Form name: test3
- id:
- method: get
- action: pass2.html
-Form name: test2
- id:
- method: get
- action: pass2.html
-END_OF_MESSAGE
- actual.gsub!(/(action: )file:.*\/(.*)$/,'\\1\\2') if actual =~ /file:/
- actual.gsub!(/\s+\n/,"\n")
- assert_equal(expected, actual)
- end
-end
-
class TC_Forms3 < Test::Unit::TestCase
def setup
goto_page "forms3.html"

0 comments on commit 72a4dc1

Please sign in to comment.