Sha256: d8cf429a318e601759e23908a715fb2edbc069dd29d9fee003eec09e9b94063e

Contents?: true

Size: 1.83 KB

Versions: 11

Compression:

Stored size: 1.83 KB

Contents

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
require 'unittests/setup'

class TC_Strong < Test::Unit::TestCase
  include Watir::Exception
  location __FILE__

  def setup
    uses_page "phrase_elements.html"
  end
  
  def test_exists
    assert browser.strong(:id, "strong_id").exists?, "Could not find <strong> by :id"
    assert browser.strong(:class, "strong_class").exists?, "Could not find <strong> by :class"
    assert browser.strong(:xpath, "//strong[@id='strong_id']").exists?, "Could not find <strong> by :xpath"
    assert browser.strong(:index, 1).exists?, "Could not find <strong> by :index"
    assert browser.strong(:text, /this is a/).exists?, "Could not finr <strong> by :text"
  end
  
  tag_method :test_strong_iterator, :fails_on_ie
  def test_strong_iterator
    assert_equal(2, browser.strongs.length)
    assert_equal("this is a strong", browser.strongs[1].text)
    
    browser.strongs.each_with_index do |strong, idx|
      assert_equal(browser.strong(:index,idx+1).text, strong.text)
      assert_equal(browser.strong(:index,idx+1).id, strong.id)
      assert_equal(browser.strong(:index,idx+1).class_name , strong.class_name)
      assert_equal(browser.strong(:index,idx+1).title, strong.title)
    end
  end
    
  tag_method :test_strong_iterator_ie, :fails_on_firefox
  def test_strong_iterator_ie
    assert_equal(2, browser.strongs.length)
    assert_equal("this is a strong", browser.strongs[0].text)
    
    browser.strongs.each_with_index do |strong, idx|
      assert_equal(browser.strong(:index,idx).text, strong.text)
      assert_equal(browser.strong(:index,idx).id, strong.id)
      assert_equal(browser.strong(:index,idx).class_name , strong.class_name)
      assert_equal(browser.strong(:index,idx).title, strong.title)
    end
  end
    
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
commonwatir-3.0.0.rc3 unittests/strong_test.rb
commonwatir-3.0.0.rc2 unittests/strong_test.rb
commonwatir-3.0.0.rc1 unittests/strong_test.rb
commonwatir-2.0.4 unittests/strong_test.rb
commonwatir-2.0.3 unittests/strong_test.rb
commonwatir-2.0.2 unittests/strong_test.rb
commonwatir-2.0.2.rc1 unittests/strong_test.rb
commonwatir-2.0.1 unittests/strong_test.rb
commonwatir-2.0.0 unittests/strong_test.rb
commonwatir-2.0.0.rc3 unittests/strong_test.rb
commonwatir-2.0.0.rc2 unittests/strong_test.rb