Sha256: aedeb1f336b6b0e8f3bff248647f23810b9c2393277636d00be5cb8f2dad032f

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

# feature tests for navigation
# revision: $Revision$

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

class TC_Navigate < Test::Unit::TestCase
  tags :fails_on_firefox
  def test_navigation
    browser.clear_url_list
    goto_page 'buttons1.html'
    assert_equal(($htmlRoot + 'buttons1.html').gsub(" ","%20").downcase, browser.url.downcase)  

    assert_equal(1, browser.url_list.length)
    assert_equal(browser.url, browser.url_list[0])
    
    goto_page 'checkboxes1.html'
    assert_equal("Test page for Check Boxes", browser.title) 

    assert_equal(2, browser.url_list.length)
    assert_equal(browser.url, browser.url_list[1])
    
    browser.clear_url_list
    assert_equal(0, browser.url_list.length )
    
    browser.back
    assert_equal("Test page for buttons", browser.title)   
    
    browser.forward
    assert_equal("Test page for Check Boxes", browser.title)   
    browser.checkbox(:name, "box1").set
    assert(browser.checkbox(:name, "box1").isSet?)   
    
    browser.refresh
    # Not sure how we test this. Text fields and checkboxes dont get reset if you click the browser refresh button
    # -- this could be tested with the add-row page.
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
watir-1.6.6 unittests/navigate_test.rb
watir-1.6.6.rc2 unittests/navigate_test.rb
watir-1.6.6.rc1 unittests/navigate_test.rb