Sha256: 38f914f37c176b7957de2b5a37c5cbe7dfcdb854a12c16fd7a1ee262f6d0999c

Contents?: true

Size: 956 Bytes

Versions: 21

Compression:

Stored size: 956 Bytes

Contents

# feature tests for css

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

class TC_CSS < Test::Unit::TestCase
  
  def isMessageDisplayed(message)
    divs = browser.divs
    divs.each do |d|
      if d.text.downcase.match( /#{message}/i )
        if d.class_name.downcase.match(/show/i)
          return true
        end
      end
    end
    
    return false
  end
  
  def setup
    goto_page "cssTest.html"
  end
  
  def test_SuccessMessage
    browser.button( :caption , "Success").click
    assert( isMessageDisplayed("Success") )
    
    browser.button(:caption, "Failure").click
    assert_false(isMessageDisplayed("Success") )
  end

  def test_inline_style
    assert_equal("300px", browser.form(:index, 1).style.width)
  end

  def test_internal_style
    assert_equal("#f00", browser.div(:id => "Container").style.backgroundColor)
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
watir-1.9.2 unittests/css_test.rb
watir-1.9.2.rc1 unittests/css_test.rb
watir-1.9.1 unittests/css_test.rb
watir-1.9.1.rc1 unittests/css_test.rb
watir-1.9.0 unittests/css_test.rb
watir-1.9.0.rc7 unittests/css_test.rb
watir-1.9.0.rc6 unittests/css_test.rb
watir-1.9.0.rc5 unittests/css_test.rb
watir-1.9.0.rc4 unittests/css_test.rb
watir-1.9.0.rc3 unittests/css_test.rb
watir-1.9.0.rc2 unittests/css_test.rb
watir-1.9.0.rc1 unittests/css_test.rb
watir-1.8.1 unittests/css_test.rb
watir-1.8.1.rc1 unittests/css_test.rb
watir-1.8.0 unittests/css_test.rb
watir-1.8.0.rc1 unittests/css_test.rb
watir-1.7.1 unittests/css_test.rb
watir-1.7.0 unittests/css_test.rb
watir-1.7.0.rc1 unittests/css_test.rb
watir-1.6.7 unittests/css_test.rb