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

Can't get simple test to work #14

Open
phillipkoebbe opened this issue May 21, 2010 · 3 comments
Open

Can't get simple test to work #14

phillipkoebbe opened this issue May 21, 2010 · 3 comments

Comments

@phillipkoebbe
Copy link

I'm not sure where the best place is to post this, so if here isn't right, I'm sorry.

I'm trying to get a very simple test of capybara-envjs working, and am not having any success. I have a very simple rails app at http://github.com/phillipkoebbe/envjs_test that has an html page in root (/envjs_test.html). On that page is a button that calls a JS function to hide one div and show another div. There is a cucumber feature in features/a_test.feature that has a non javascript scenario (to prove that the hidden div is not visible) and a javascript scenario that should be visible if JS is working.

The tests all pass when using the @javascript tag (both with the selenium and culerity drivers), but when I try the @envjs tag, it fails with a message that indicates the onclick of the button didn't work, meaning javascript support isn't there.

I have also tried to set the javascript_driver to :envjs, but get the "unknown driver" error from capybara when I do.

I just updated all gems this morning, but here is a list of versions:

capybara (0.3.8)
capybara-envjs (0.1.3, 0.1.2)
cucumber (0.7.3, 0.7.2, 0.6.3, 0.6.2)
cucumber-rails (0.3.1, 0.3.0, 0.2.4)
culerity (0.2.10, 0.2.9)
envjs (0.3.5, 0.3.4)
gherkin (1.0.30, 1.0.26)
johnson (2.0.0.pre3)
rack-test (0.5.3)
rails (2.3.5, 1.2.6)
selenium-webdriver (0.0.18)

Does it matter that I'm using Prototype and not JQuery?

Anything else you need to know?

Peace.

@drnic
Copy link

drnic commented May 22, 2010

Try including the gem like:

config.gem 'capybara-envjs', :lib => 'capybara/envjs', :version => '>= 0.1.3'

@phillipkoebbe
Copy link
Author

Hi Dr. Nic,

Thanks. for the suggestion. I added that to cucumber's environment, but got the same result.

Peace.

@smparkes
Copy link
Owner

smparkes commented Jun 1, 2010

Yeah, your project looks okay. You're running into weakness in the support for CSS in envjs and in capybara-envjs. Since envjs doesn't render content, style support has never been a high priority. The display property is kind of a special case that would be nice to support, but, unfortunately, it's not there yet.

Most of the work in envjs is done and much of styling works (to some extent), but I don't think that includes treating the style as a generic attribute, which the capybara driver needs. As far as I can tell, ele.getAttribute("style") doesn't do the right thing (checked against chrome).

http://envjs.lighthouseapp.com/projects/21590-envjs/tickets/172-elgetattributestyle

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

3 participants