Closed punkisdead closed 11 years ago
this really is s a htmlunit problem, not a jasmine problem, try and see if you can use the phantomjs runner: http://searls.github.io/jasmine-maven-plugin/phantomjs.html
or mabe try a different browser emulation for htmlunit, eg. CHROME
Hi, I'm facing the same kind of problem with the following configuration and jQuery JavaScript Library v1.10.2:
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>1.3.1.2</version>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.12</version>
</dependency>
</dependencies>
…
</plugin>
Could you explain how to "try a different browser emulation for htmlunit, eg. CHROME" with an example or pointing the documentation ?
Note that running "mvn jasmine:bdd" works like a charm
Could you explain how to "try a different browser emulation for htmlunit, eg. CHROME" with an example or pointing the documentation ?
It looks like you do it by adding a browserVersion tag to your jasmin-maven-plugin
<configuration>
<browserVersion>CHROME</browserVersion>
</configuration>
However, that does not seem to be compatible with jquery at all (tried 1.8.0, 1.8.3, 1.9.0, 1.9.1, 1.10.2, 2.0.0, 2.0.3), e.g. (w/ 2.0.3):
net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot find function addEventListener in object [object HTMLDocument]. (http://localhost:55267/src/lib/jquery-2.0.3.js#834)
Realted HtmlUnit bug seems to be https://sourceforge.net/p/htmlunit/bugs/1536/
I did some testing of different
@pimlottc There really isn't anything I can do about HtmlUnit's deficiencies. This is exactly why we added support for using phantomjs in place of HtmlUnit.
We are on the latest version of HtmlUnit so if you are experiencing issues you should really be sending them to the HtmlUnit team so they can fix the issues in the next version.
I'm going to go ahead and close this issue since in my opinion it has been fixed now that we support phantomjs.
I understand that, I just wanted to document what does and doesn't work currently. Especially since HtmlUnit is the "out of the box" default solution, and a large part of using jasmine-maven-plugin is to be able to take advantage of the maven repository system. PhantomJS is a good fallback, but having to setup and maintain an external platform-dependent binary negates much of the benefit in using a maven-based solution.
I know it's a tough situation since HtmlUnit is not really in your control but unfortunately it has a large influence in the usefulness of jasmine-maven-plugin. I will definitely try to work with the HtmlUnit team in getting this resolved, but I've got a bit to learn about it first.
There's been some good progress on issue HtmlUnit-1536, looks like this may be fixed in the next release!
@punkisdead I got this to work by using phantomjs per @klieber's comment.
I upgraded our project from jQuery 1.8.0 to 1.9.1 and running the tests in the browser using
mvn jasmine:bdd
works just fine, but when runningmvn jasmine:test
it fails with the following errors:Using jasmine-maven-plugin version 1.3.1.2, and selenium-htmlunit version 2.32.0