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

Couldn't find element inside the FancyBox container #29

Open
millisami opened this issue Aug 16, 2010 · 11 comments
Open

Couldn't find element inside the FancyBox container #29

millisami opened this issue Aug 16, 2010 · 11 comments

Comments

@millisami
Copy link

I'm using FancyBox to load the content via ajax request in a Rails3rc app.

The following is the feature which passes/works in development, testing via browser, but when I try to test it via envjs, it blows up.
Then I should see "You are Doing Good" within "#fancybox-inner" # features/step_definitions/web_steps.rb:107
scope '//[@id = 'fancybox-inner']' not found on page (Capybara::ElementNotFound)
./features/step_definitions/web_steps.rb:14:in with_scope' ./features/step_definitions/web_steps.rb:108:in/^(?:|I )should see "([^"]
)"(?: within "([^"]*)")?$/'
features/homepage.feature:34:in `Then I should see "You are Doing Good" within "#fancybox-inner"'
This is the generated link to be clicked.
Do Good

And this is the jquery/fancybox hook that makes it work.
jQuery(document).ready(function($) {
$("a.do_good_order").fancybox({
'hideOnContentClick': true,
'width': 400,
'height': 300,
'autoScale': false,
'autoDimensions': false
});
});

From the error above, its complaining about the scope '//*[@id = 'fancybox-inner']' not found on page (Capybara::ElementNotFound)

So, my question is, does capybara-envjs supports or can detect the elements inside the #fancybox-inner div which is a overlayed container of FancyBox??

@smparkes
Copy link
Owner

Overlays should be fine: they're still in the DOM.

You could try seeing if it's getting created, by looking at the innerHTML of the container ...

@millisami
Copy link
Author

Well, the same code above does work with selenium webdriver when I run the feature.
I hope this confirms that the innerHTML is right.

When I change the capybara driver to use envjs, it fails.

@smparkes
Copy link
Owner

Sorry; didn't mean to imply that the code wasn't right. I actually suspect some event processing isn't working and the overlay DOM elements aren't getting created. But I'm not sure.

Can you put an example somewhere I can try?

@millisami
Copy link
Author

Alright, here is the repo http://github.com/millisami/capybara-envjs-experiment
It has two branches. master branch has the selenium one which works and another branch named envjs, which uses the envjs modified one which is failing.

@smparkes
Copy link
Owner

Thanks. I'll try to look at this this weekend.

@millisami
Copy link
Author

Sure, I am waiting eagerly coz I don't like the selenium opening firefox everytime. It drgas me.

@millisami
Copy link
Author

Hi, did you get any time to look up the problem??

@smparkes
Copy link
Owner

smparkes commented Sep 2, 2010

Still trying. Time's tight.

@smparkes
Copy link
Owner

smparkes commented Sep 2, 2010

Looks like you need style support that's not in envjs.

I had to tweak a couple of things to get the test to work: I had to comment-out the javascript emulation stuff in the config and it looks like the javascript support was turned off (#@javascript?)

When I did that, it caused errors in env-js's timer loop. The fancybox code is trying to do something with the CSS style attribute which is not currently supported (at least in the johnson fork ... not sure where the rhino port stands on this).

@millisami
Copy link
Author

So, does that mean I have to abandon it for a while ?

@smparkes
Copy link
Owner

smparkes commented Sep 3, 2010

At this point, I don't see this getting worked on by me in the next month or two. I'd like to, at some point, but I'm not sure when that's going to be possible. So unless someone steps up ...

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