Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win.document is undefined (Johnson::Error) #33

Open
oriolgual opened this issue Aug 27, 2010 · 1 comment
Open

win.document is undefined (Johnson::Error) #33

oriolgual opened this issue Aug 27, 2010 · 1 comment

Comments

@oriolgual
Copy link

Hi,
I was testing a jqueryUI datepicker and found this weird error. (latest capybara and envjs).

You can reproduce this error running this code:

require 'rubygems'                                                                                                                                                                                                                      
require 'capybara'
require 'capybara/dsl'
require 'capybara/envjs'

Capybara.current_driver = :envjs
Capybara.run_server = false
Capybara.app_host = 'http://jqueryui.com'
 
session = Capybara::Session.new(:envjs)
session.visit('/demos/datepicker/icon-trigger.html')
session.find(:css, 'img.ui-datepicker-trigger').trigger(:click) # win.document is undefined (Johnson::Error)
puts session.find('#ui-timepicker-div').visible?

This is the problematic jQuery code:

// Lines 6164-6169 jquery.js
// Return the scroll offset
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
  jQuery.support.boxModel && win.document.documentElement[ method ] ||
    win.document.body[ method ] :
  elem[ method ];

I'm not sure if it's a capybara-envjs bug or should I post it to envjs / johnson

@smparkes
Copy link
Owner

Nice test.

The wind.document issue seems to have been fixed in master (envjs/capy/capy-envjs).

However, that just moves things a little further down. It looks like this relies on event
bubbling in the johnson fork of envjs which doesn't work quite right right now.

Unfortunately, I'm not sure when that's going to get any attention ... I'm slammed
right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants