[ 
http://jira.openqa.org/browse/WTR-295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zeljko closed WTR-295.
----------------------

    Resolution: Won't Fix

If this is still a problem, please report it here: 
https://github.com/watir/watir-classic/issues

> FireWatir on Mac OS X: Prevent RuntimeError in test_existing_window
> -------------------------------------------------------------------
>
>                 Key: WTR-295
>                 URL: http://jira.openqa.org/browse/WTR-295
>             Project: Watir
>          Issue Type: Bug
>          Components: Unit Tests
>    Affects Versions: 1.6.2
>         Environment: Mac OS X 10.5.6, Ruby 1.8.6, Firefox 3.0.6
>            Reporter: Fritz Anderson
>             Fix For: Soon
>
>
> The FireWatir unit tests for Mac OS X are much-improved recently, but there 
> remains one place where they run afoul of the restriction that no more than 
> one instance of Firefox may run at a time. test_existing_window in 
> attach_to_existing_window_test.rb attempts to open several "windows" 
> (application instances), and this raises a RuntimeError. The test is reported 
> to be in error.
> This occurs when you run watir/firewatir/unittests/mozilla_all_tests.rb .
> This is a proposed patch. It intercepts the RuntimeError and abandons the 
> test. All tests run cleanly with it installed, and its sole effect is to skip 
> assertions on conditions that cannot arise.
> A caveat may be that in later versions, the multiple-instance error would not 
> be the only RuntimeError possible in this test. It may be wise to re-raise 
> the exception if e.message !~ /(?i)\bmac\b/ .
> $ git diff
> diff --git a/commonwatir/unittests/attach_to_existing_window_test.rb 
> b/commonwat
> index d412335..e804aa7 100644
> --- a/commonwatir/unittests/attach_to_existing_window_test.rb
> +++ b/commonwatir/unittests/attach_to_existing_window_test.rb
> @@ -37,7 +37,16 @@ class TC_ExistingWindow < Test::Unit::TestCase
>    end
>    
>    def test_existing_window
> -    open_several_windows
> +       begin
> +           open_several_windows
> +       rescue RuntimeError => e
> +               # On Mac OS X, this will raise a RuntimeError, because Firefox
> +               # does not support multiple instances on Mac OS X.
> +               # Throw in a trivial assertion to keep the unit test framework
> +               # happy, then bail.
> +               assert true
> +               return
> +       end
>        
>      b1 = Browser.attach(:title , /buttons/i)
>      assert_equal("Test page for buttons", b1.title)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.openqa.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to