Permalink
Browse files

Fixed method that sets text on a text_area to clear first

  • Loading branch information...
1 parent cfec170 commit e7d05972b5f17d8487c93177823e14771b7d2776 @cheezy committed May 27, 2012
View
@@ -1,4 +1,7 @@
=== Version 0.6.8
+* Fixes
+ Modified text area methods so it clears before setting new text
+ Fixed clear method on SelectList when using Selenium to clear multi selects
=== Version 0.6.7 / 2012-5-16
* Enhancements
@@ -250,7 +250,9 @@ def hidden_fields_for(identifier)
#
def text_area_value_set(identifier, value)
process_selenium_call(identifier, Elements::TextArea, 'textarea') do |how, what|
- @browser.find_element(how, what).send_keys(value)
+ text_area = @browser.find_element(how, what)
+ text_area.clear
+ text_area.send_keys(value)
end
end
@@ -239,7 +239,7 @@ def hidden_fields_for(identifier)
# See PageObject::Accessors#text_area
#
def text_area_value_set(identifier, value)
- process_watir_call("textarea(identifier).send_keys(value)", Elements::TextArea,
+ process_watir_call("textarea(identifier).set(value)", Elements::TextArea,
identifier, value)
end
@@ -521,7 +521,7 @@ def mock_driver_for(tag)
context "watir implementation" do
it "should set some text on the text area" do
watir_browser.should_receive(:textarea).and_return(watir_browser)
- watir_browser.should_receive(:send_keys).with("123 main street")
+ watir_browser.should_receive(:set).with("123 main street")
watir_page_object.address = "123 main street"
end
@@ -541,6 +541,7 @@ def mock_driver_for(tag)
context "selenium implementation" do
it "should set some text on the text area" do
selenium_browser.should_receive(:find_element).and_return(selenium_browser)
+ selenium_browser.should_receive(:clear)
selenium_browser.should_receive(:send_keys).with("123 main street")
selenium_page_object.address = "123 main street"
end

0 comments on commit e7d0597

Please sign in to comment.