Permalink
Browse files

remove Element#(before|after)_text and Element#(before|after)? methods

  • Loading branch information...
1 parent 0628e7c commit 198cb423b519e3ce809e747f9aed6a7fbffb55ec @jarmo jarmo committed Mar 12, 2012
Showing with 0 additions and 42 deletions.
  1. +0 −25 watir/lib/watir/element.rb
  2. +0 −17 watir/unittests/parent_child_test.rb
View
@@ -121,26 +121,6 @@ def style
ole_object.style.cssText
end
- # return the text before the element
- def before_text # label only
- assert_exists
- begin
- ole_object.getAdjacentText("afterEnd").strip
- rescue
- ''
- end
- end
-
- # return the text after the element
- def after_text # label only
- assert_exists
- begin
- ole_object.getAdjacentText("beforeBegin").strip
- rescue
- ''
- end
- end
-
# Return the innerText of the object or an empty string if the object is
# not visible
# Raise an ObjectNotFound exception if the object cannot be found
@@ -167,11 +147,6 @@ def parent
Element.new(self, :ole_object => parent_element).to_subtype
end
- # Return true if self is contained earlier in the html than other.
- alias :before? :<
- # Return true if self is contained later in the html than other.
- alias :after? :>
-
def typingspeed
@container.typingspeed
end
@@ -24,21 +24,4 @@ def test_parent_page_container
assert_not_nil catalog_entry.page_container
end
- tag_method :test_before_and_after, :fails_on_firefox
- def test_before_and_after
- link = browser.link(:class => 'addtocart', :index => 1)
- assert_equal 'http://localhost:3000/store/add_to_cart/12', link.href
- assert(link.after?(@headline))
- assert(@headline.before?(link))
- assert !(link.before? @headline)
- assert !(@headline.after? link)
- assert !(link.after? link)
- end
-
- tag_method :test_find_after, :fails_on_firefox
- def test_find_after
- link = browser.link(:class => 'addtocart', :after? => @headline)
- assert_equal 'http://localhost:3000/store/add_to_cart/12', link.href
- end
-
end

0 comments on commit 198cb42

Please sign in to comment.