Sha256: 9eb806fd6e467f575f02ba3cb51684f95f4f3948871a348140c304dbab29e0ee
Contents?: true
Size: 1.5 KB
Versions: 2
Compression:
Stored size: 1.5 KB
Contents
# feature tests for xpath table cells # revision: $Revision: 1348 $ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__ require 'unittests/setup' class TC_TableCell_XPath < Test::Unit::TestCase def setup goto_page "tableCell_using_xpath.html" end def testCellExists # There is no <image> with @src='rectangle.jpg'. So image will not be there. assert(! $ie.cell(:xpath , "//img[@src='images\/rectangle.jpg']/../").exists? ) # Select the parent element of image with src='square.jpg' which is a tablecell. assert( $ie.cell(:xpath , "//img[@src='images\/square.jpg']/../").exists? ) assert( $ie.cell(:xpath , "//img[@src='images\/triangle.jpg']/../").exists? ) puts "Selected table cell with text 'Table Cell with image of triangle.'" puts $ie.cell(:xpath , "//img[@src='images\/triangle.jpg']/../").to_s end def testCell_properties assert_equal(1 , $ie.cell(:xpath , "//img[@src='images\/square.jpg']/../").colspan) assert_equal(2 , $ie.cell(:xpath , "//img[@src='images\/triangle.jpg']/../").colspan) assert_equal(3 , $ie.cell(:xpath , "//img[@src='images\/circle.jpg']/../").colspan) assert_equal(4 , $ie.cell(:xpath , "//img[@src='images\/button.jpg']/../").colspan) # to string tests -- output should be verified! puts $ie.cell(:xpath , "//img[@src='images\/square.jpg']/../").to_s puts $ie.cell(:xpath , "//img[@src='images\/triangle.jpg']/../").to_s end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
watir-1.5.6 | unittests/table_cell_using_xpath_test.rb |
watir-1.5.5 | unittests/table_cell_using_xpath_test.rb |