unittests/filefield_xpath_test.rb in firewatir-1.2.1 vs unittests/filefield_xpath_test.rb in firewatir-1.6.2
- old
+ new
@@ -1,35 +1,35 @@
# feature tests for TextArea Fields
# revision: $Revision: 1.0 $
-$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
+$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
require 'unittests/setup'
class TC_FileField_XPath < Test::Unit::TestCase
- include FireWatir
+
def gotoPage
- $ff.goto($htmlRoot + "fileupload.html")
+ goto_page("fileupload.html")
end
def test_file_field_Exists
gotoPage()
#test for existance of 4 file area
- assert($ff.file_field(:xpath, "//input[@name='file1']").exists?)
- assert($ff.file_field(:xpath, "//input[@id='file2']").exists?)
+ assert(browser.file_field(:xpath, "//input[@name='file1']").exists?)
+ assert(browser.file_field(:xpath, "//input[@id='file2']").exists?)
#test for missing
- assert_false($ff.file_field(:xpath, "//input[@name='missing']").exists?)
- assert_false($ff.file_field(:xpath, "//input[@name='totallybogus']").exists?)
+ assert_false(browser.file_field(:xpath, "//input[@name='missing']").exists?)
+ assert_false(browser.file_field(:xpath, "//input[@name='totallybogus']").exists?)
#pop one open and put something in it.
- $ff.file_field(:xpath, "//input[@name='file3']").set($htmlRoot + "fileupload.html")
+ browser.file_field(:xpath, "//input[@name='file3']").set($htmlRoot + "fileupload.html")
#click the upload button
- $ff.button(:xpath, "//input[@name='upload']").click
+ browser.button(:xpath, "//input[@name='upload']").click
- assert($ff.text.include?("PASS"))
+ assert(browser.text.include?("PASS"))
end
#def test_iterator
# gotoPage()
- # assert_equal(6, $ff.file_fields.length)
+ # assert_equal(6, browser.file_fields.length)
#end
end