Sha256: 6859dcb1de90b9e30bc5b42fedac83ca274f0e4080b682136e8160e54bc3addf

Contents?: true

Size: 1.22 KB

Versions: 3

Compression:

Stored size: 1.22 KB

Contents

# feature tests for attaching to new Firefox windows
# revision: $Revision: 1.0 $

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
require 'unittests/setup'

class TC_NewWindow < Test::Unit::TestCase
    include FireWatir

    def setup
      $ff.goto($htmlRoot + "new_browser.html")
    end

    def test_simply_attach_to_new_window_using_title
        $ff.link(:text, 'New Window').click
        ff_new = $ff.attach(:title, 'Pass Page')
        assert(ff_new.text.include?('PASS'))
        ff_new.close
        #$ff.link(:text, 'New Window').click
    end
    
    def test_simply_attach_to_new_window_using_url
        $ff.link(:text, 'New Window').click
        ff_new = $ff.attach(:url, /pass\.html/)
        assert(ff_new.text.include?('PASS'))
        ff_new.close
        #$ff.link(:text, 'New Window').click
    end

    def test_new_window_exists
        assert_raises(NoMatchingWindowFoundException , "NoMatchingWindowFoundException was supposed to be thrown" ) {   $ff.attach(:title, "missing_title")   }  
        assert_raises(NoMatchingWindowFoundException , "NoMatchingWindowFoundException was supposed to be thrown" ) {   $ff.attach(:url, "missing_url")   }  
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
firewatir-1.2.0 unittests/attach_to_new_window_test.rb
firewatir-1.2.1 unittests/attach_to_new_window_test.rb
firewatir-1.1.1 unittests/attach_to_new_window_test.rb