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

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugh McGowan committed Jun 26, 2011
1 parent a133ec2 commit 3463930
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions watir/unittests/form_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def test_form_outer_html
expected = "\r\n<FORM id=f2 name=test2 action=pass2.html method=get><BR><INPUT type=submit value=Submit> </FORM>"
actual = browser.form(:name, 'test2').html
actual.sub!('style=""','') # ie9 adds in a style tag so just strip it out
actual.gsub!('"','').gsub!(/\n/,'') #ie9 also has som additional formatting so remove that too
#ie9 also has som additional formatting so remove that too
actual.gsub!('"','')
actual.gsub!(/\n/,'')
# ignore attributes order by sorting them
sorted_expected, sorted_actual = [expected, actual].map! do |html|
html.strip.downcase.scan(%r{<form (.*)><br><(.*)>\s*</form>}).flatten.
Expand Down Expand Up @@ -105,7 +107,8 @@ def test_showforms
method: get
action: pass2.html
END_OF_MESSAGE
actual.gsub!(/(action: )file:.*\/(.*)$/,'\\1\\2').gsub!(/\s+\n/,"\n")
actual.gsub!(/(action: )file:.*\/(.*)$/,'\\1\\2') if actual =~ /file:/
actual.gsub!(/\s+\n/,"\n")
assert_equal(expected, actual)
end
end
Expand Down
3 changes: 2 additions & 1 deletion watir/unittests/form_xpath_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def test_showforms
method: get
action: pass2.html
END_OF_MESSAGE
actual.gsub!(/(action: )file:.*\/(.*)$/,'\\1\\2').gsub!(/\s+\n/,"\n")
actual.gsub!(/(action: )file:.*\/(.*)$/,'\\1\\2') if actual =~ /file:/
actual.gsub!(/\s+\n/,"\n")
assert_equal(expected, actual)
end
end
Expand Down

0 comments on commit 3463930

Please sign in to comment.