Sha256: 1a78864c5d750e59ddc2e95d657c4c1772dfe69c015d8b410339a2900ae7ab16

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

# revision: $Revision$

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

class TC_PopUps < Test::Unit::TestCase
  tags :must_be_visible, :creates_windows, :unreliable

  def setup
    browser.goto("file://#{$myDir}/html/popups1.html")
  end
  
  def startClicker( button , waitTime = 0.5)
    w = WinClicker.new
    longName = browser.dir.gsub("/" , "\\" )
    shortName = w.getShortFileName(longName)
    c = "start rubyw #{shortName }\\watir\\clickJSDialog.rb #{button } #{ waitTime} "
    puts "Starting #{c}"
    w.winsystem(c )   
    w = nil
  end
  
  def test_simple
    startClicker("OK")
    browser.button("Alert").click
  end
  
  def test_confirm
    startClicker("OK")
    browser.button("Confirm").click
    assert( browser.text_field(:name , "confirmtext").verify_contains("OK") )
    
    startClicker("Cancel")
    browser.button("Confirm").click
    assert( browser.text_field(:name , "confirmtext").verify_contains("Cancel") )
  end
  
  def xtest_Prompt
    startClicker("OK")
    browser.button("Prompt").click
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-1.6.5 unittests/popups_test.rb