FormidableLabs / rowdy

A small, rambunctious WD.js / WebdriverIO configuration wrapper.
MIT License
28 stars 9 forks source link

Win: Phantom not executable. #10

Closed ryan-roemer closed 9 years ago

ryan-roemer commented 9 years ago

Error from npm test.

[SERVER] [stderr] 15:19:06.455 ERROR - org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "X:\scm\fmd\rowdy\node_modules\.bin\phantomjs" (in directory "."):
CreateProcess error=193, %1 is not a valid Win32 application)
[SERVER] [stderr] 15:19:06.455 DEBUG - Exception: [null, newSession {desiredCapabilities=Capabilities [{browserName=phantomjs, javascriptEnabled=true, version=, platform=ANY}]}]

... but weirdly:

X:\scm\fmd\rowdy>node_modules\.bin\phantomjs
phantomjs> phantom.exit()

works.

Potentially related issues:

Full npm test works with:

diff --git a/lib/server.js b/lib/server.js
index 8080633..ee5b006 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -86,7 +86,10 @@ Server.prototype.start = function (callback) {

   // Start selenium process.
   selenium.start({
-    seleniumArgs: debug ? ["-debug"] : [],
+    seleniumArgs: [].concat(
+      debug ? ["-debug"] : [],
+     ["-Dphantomjs.binary.path=..\\..\\node_modules\\phantomjs\\lib\\phantom\\phantomjs.exe"]
+    ),
     spawnOptions: {
       stdio: "pipe"
     },

TASK: