webdriverio-boneyard / gulp-webdriver

gulp-webdriver is a gulp plugin to run selenium tests with the WebdriverIO testrunner
http://webdriver.io
MIT License
76 stars 33 forks source link

fix wedriverio bin path issue #27

Closed aliokan closed 8 years ago

aliokan commented 9 years ago

fix #20 wedriverio bin path issue due to flattening dependency, based on https://github.com/npm/npm/issues/9718#issuecomment-142464880 solution.

!!! only tested on npm 2.14.2 and node v4.0.0 on MacOS 10.9.5

benweizhu commented 8 years ago

When will they fix this issue?

kresli commented 8 years ago

This is not working on node 5.0.0 npm 3.3.7 Removing __dirname from wdioBin = path.join(__dirname, 'node_modules', '.bin', isWin ? 'wdio.cmd' : 'wdio'); fix this at least on 3.3.7 version

aliokan commented 8 years ago

It's work with node v5.0.0 and npm 3.3.6 In this patch __dirname is removed :

-            wdioBin = path.join(__dirname, 'node_modules', '.bin', isWin ? 'wdio.cmd' : 'wdio');
+            wdioBin = require.resolve(path.join('webdriverio', 'bin', isWin ? 'wdio.cmd' : 'wdio'));
kresli commented 8 years ago

Sorry, you are right. But either this is merged with master I still see the old index.js content. I triple check the gulp-webdriver version in my project and its on 1.0.1 ( installed by npm install gulp-webdriver@1.0.1 ). Not sure if this is an issue with npm :/ If I clone this repo, everything is up to date. If I try to install it with npm, I have old version of index.js

aliokan commented 8 years ago

Look the branch Master commits history : https://github.com/webdriverio/gulp-webdriver/commits/master My patch is applied after the v1.0.1 release. If you want to install a commit not already released, you can specify directly a commit needed, for example : npm install https://github.com/webdriverio/gulp-webdriver.git#9fa76d2c2035c2db28944c11b2c0be6991a1c931

kresli commented 8 years ago

Thanks. Works like a charm!