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
Example for headless chrome #325
Conversation
This example shows how to run jasmine tests in headless chrome.
Example to run jasmine tests with chrome options helps me. But I am unable to set up "webdriver.chrome.driver" in my pom.xml so that jasmine plugin recognizes where chrome driver is. I tried various options like using "systemPropertyVariables", "argLine" and "jvmArguments" but none helps.
I tried the above settings in the following plug ins:
I always get the following error when I run "mvn": [ERROR] Caused by: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html As a workaround if I run "mvn" as below it works: How do I set it up in pom.xml? What I am doing wrong? Please help |
Try adding a property to the pom like this: <properties>
<webdriver.chrome.driver>/path/chromedriver.exe</webdriver.chrome.driver>
</properties Read the documentation. Or better yet, add |
Thanks @paulpach! But it does not help (setting in properties section of pom.xml). As of now I have added that property in mvn file(/{mvn-home-folder}/bin) as a workaround:
But I am amazed how others are managing to do it without setting up in Windows PATH environment variable or changing mvn file. |
Yeah, I just added it to the PATH environment variable. I build in
different platforms, so I can't hardcode the path anywhere and I would
rather rely on the environment being set for each platform.
…On Mon, Nov 27, 2017 at 9:30 AM, yournans ***@***.***> wrote:
Thanks @paulpach <https://github.com/paulpach>! But it does not help
(setting in properties section of pom.xml). As of now I have added that
property in mvn file(/{mvn-home-folder}/bin) as a workaround:
exec "$JAVACMD"
$MAVEN_OPTS
-classpath "${M2_HOME}"/boot/plexus-classworlds-*.jar
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf"
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}"
**"-Dwebdriver.chrome.driver=/path/chromedriver.exe" **
${CLASSWORLDS_LAUNCHER} "$@"
But I am amazed how others are managing to do it without setting up in
Windows PATH environment variable or changing mvn file.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#325 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAccVwFOuABFzEnhoP1dwXaoxa9UMT1hks5s6tWogaJpZM4Oojq3>
.
|
Just hit the same problem as @yournans mentioned. I can't find any way to specify the path to chromedriver other than using mvn -Dwebdriver.chrome.driver=/path/chromedriver.exe . Has anybody solved the problem? I'm also curious is that possible somehow to run download process of chromedriver and then use it in jasmine-maven-plugin the same way it is with phantomjs? |
The next release will use headless Chrome as the default driver. You can checkout an alpha version of it here: https://github.com/searls/jasmine-maven-plugin/releases/tag/jasmine-maven-plugin-3.0-alpha-01 |
Thanks @klieber, I've already checked the alpha version, great job! While it works well on machines with Chrome already installed, it is not shipping the Chrome itself, without which the Chrome driver is useless. So If with "all-in-one" Phantomjs the build and test process was fully automated, now we need to handle manual Chrome installation. Are there any ideas about how to handle that using maven plugin? |
I don't think that is going to be possible anymore. PhantomJS is basically a dead project now and there really isn't any other way to install a simple single binary to use as the browser. Requiring a browser be installed is pretty standard these days anymore and what similar tools are doing so I don't have plans to dig into it anymore. Also, if you use Docker for your builds then there really isn't any problem because you can just install the browser with docker. That's how I'm doing the build for the plug-in now. |
Closing this as headless chrome is the default starting with 3.0-alpha-01. A stable release of 3.0 is coming soon. |
This example shows how to run jasmine tests in headless chrome.