unittests/textfields_xpath_test.rb in watir-1.9.0 vs unittests/textfields_xpath_test.rb in watir-1.9.1.rc1
- old
+ new
@@ -89,15 +89,15 @@
def test_JS_Events
browser.text_field(:xpath , "//input[@name='events_tester']/").set('p')
# the following line has an extra keypress at the begining, as we mimic the delete key being pressed
- assert_equal( "keypresskeydownkeypresskeyup" , browser.text_field(:xpath , "//textarea[@name='events_text']/").value.gsub("\r\n" , "") )
+ assert_equal( "keypresskeydownkeypresskeyup" , browser.text_field(:xpath , "//textarea[@name='events_text']/").value.gsub(/(\n|\r)/ , "") )
browser.button(:value , "Clear Events Box").click
browser.text_field(:xpath , "//input[@name='events_tester']/").set('ab')
# the following line has an extra keypress at the begining, as we mimic the delete key being pressed
- assert_equal( "keypresskeydownkeypresskeyupkeydownkeypresskeyup" , browser.text_field(:xpath , "//textarea[@name='events_text']/").value.gsub("\r\n" , "") )
+ assert_equal( "keypresskeydownkeypresskeyupkeydownkeypresskeyup" , browser.text_field(:xpath , "//textarea[@name='events_text']/").value.gsub(/(\n|\r)/, "") )
end
def test_password
browser.text_field(:xpath , "//input[@name='password1']/").set("secret")
assert( 'secret' , browser.text_field(:xpath , "//input[@name='password1']/").value )