Sha256: b434395fad98dd9a5b8c2eed3b4c74a35a0bf82e4a579b00fb98015fcaf236e5

Contents?: true

Size: 646 Bytes

Versions: 36

Compression:

Stored size: 646 Bytes

Contents

require 'test/unit'
require 'nokogiri'

class XPathTest < Test::Unit::TestCase
  def setup
    file = File.open( "xpath_bug.xml" )
    @doc = Nokogiri::HTML::Document.read_io(file, nil, nil, 2145)
  end
  def fixture xpath
    matches = []
    
    @doc.xpath(xpath).each() do |node|
    	matches << node
    	assert_equal('Add', node.text)
    	assert_equal('ButtonText', node['class'])
    end
    
    assert_equal(1, matches.length)
  end  
  def test_text
    fixture "//div[text()='Add' and @class='ButtonText']"
  end
  def test_contains
    fixture "//div[contains(.,'Add') and @class='ButtonText']"
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
watir-classic-3.0.0 unittests/other/rexml_unit_test.rb
watir-3.0.0.rc3 unittests/other/rexml_unit_test.rb
watir-3.0.0.rc2 unittests/other/rexml_unit_test.rb
watir-3.0.0.rc1 unittests/other/rexml_unit_test.rb
watir-2.0.4 unittests/other/rexml_unit_test.rb
watir-2.0.3 unittests/other/rexml_unit_test.rb
watir-2.0.2 unittests/other/rexml_unit_test.rb
watir-2.0.2.rc1 unittests/other/rexml_unit_test.rb
watir-2.0.1 unittests/other/rexml_unit_test.rb
watir-2.0.0 unittests/other/rexml_unit_test.rb
watir-2.0.0.rc3 unittests/other/rexml_unit_test.rb
watir-2.0.0.rc2 unittests/other/rexml_unit_test.rb
watir-1.9.2 unittests/other/rexml_unit_test.rb
watir-1.9.2.rc1 unittests/other/rexml_unit_test.rb
watir-1.9.1 unittests/other/rexml_unit_test.rb
watir-1.9.1.rc1 unittests/other/rexml_unit_test.rb
watir-1.9.0 unittests/other/rexml_unit_test.rb
watir-1.9.0.rc7 unittests/other/rexml_unit_test.rb
watir-1.9.0.rc6 unittests/other/rexml_unit_test.rb
watir-1.9.0.rc5 unittests/other/rexml_unit_test.rb