eduardogch / gulp-chimp

Gulp plugin to interact with the Chimp.js
MIT License
3 stars 3 forks source link

Port error when using gulp-chimp with external config file #6

Closed MacDennis76 closed 7 years ago

MacDennis76 commented 7 years ago

Hello,

I would like to use gulp to automate various testing tasks. I am currently trying to get the gulp-chimp wrapper to work but I haven't been successful yet.

Expected behaviour

gulp-chimp wrapper working without errors when using external config file Config file: https://github.com/eduardogch/gulp-chimp/blob/master/chimp.conf.js

Actual behaviour

Error:

[chimp] Running... [15:52:08] 'chimp' errored after 56 ms [15:52:08] Error: options.port is required

Exact steps to reproduce / repository that demonstrates the problem

Run gulp-chimp example as stated in the Chimp installation instructions.

Version & tools:

Chimp: 0.47.1 Node.js: 6.9.4 Java: 1.8.0_91 9 (64 bit) Operation system: Windows10 64bit

Console / Log Output

[chimp] Running... [15:52:08] 'chimp' errored after 56 ms [15:52:08] Error: options.port is required at new Selenium (D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\dist\lib\selenium.js:29:11) at Chimp._createProcesses (D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\dist\lib\chimp.js:532:22) at Chimp._startProcesses (D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\dist\lib\chimp.js:490:25) at D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:607:21 at D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:246:17 at iterate (D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:146:13) at D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:157:25 at D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:248:21 at D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:612:34 at Chimp.interrupt (D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\dist\lib\chimp.js:432:5) at D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:607:21 at D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:246:17 at iterate (D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:146:13) at async.eachSeries (D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:162:9) at _asyncMap (D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:245:13) at Object.mapSeries (D:\temp\chimp2\node_modules\gulp-chimp\node_modules\chimp\node_modules\async\lib\async.js:228:23)

Thanks!

eduardogch commented 7 years ago

Hi,

I just publish a new version who is setting a random port for selenium and webdriver
https://github.com/eduardogch/gulp-chimp/blob/master/chimp.conf.js#L3

Hope that fix the issue!

MacDennis76 commented 7 years ago

Hi,

Thanks for the quick reply.

My current task: gulp.task('chimp', function () { return chimp('./config/chimp.conf.js'); });

I would like to configure the bare minimum and chimp.conf.js only contains: module.exports = { path: './features', };

I now run gulp chimp and I get the following output ..

[13:26:19] Requiring external module babel-register [13:26:21] Using gulpfile D:\temp\chimp2\gulpfile.babel.js [13:26:21] Starting 'chimp'... [13:26:21] Selenium running in port: 3742 [13:26:21] WebDriverio running in port: 2800

[chimp] Running... [13:26:21] 'chimp' errored after 61 ms [13:26:21] Error: options.port is required at new Chromedriver (D:\temp\chimp2\node_modules\chimp\dist\lib\chromedriver.js:19:15) at Chimp._createProcesses (D:\temp\chimp2\node_modules\chimp\dist\lib\chimp.js:567:26) at Chimp._startProcesses (D:\temp\chimp2\node_modules\chimp\dist\lib\chimp.js:511:25) at D:\temp\chimp2\node_modules\async\lib\async.js:607:21 at D:\temp\chimp2\node_modules\async\lib\async.js:246:17 at iterate (D:\temp\chimp2\node_modules\async\lib\async.js:146:13) at D:\temp\chimp2\node_modules\async\lib\async.js:157:25 at D:\temp\chimp2\node_modules\async\lib\async.js:248:21 at D:\temp\chimp2\node_modules\async\lib\async.js:612:34 at Chimp.interrupt (D:\temp\chimp2\node_modules\chimp\dist\lib\chimp.js:453:5) at D:\temp\chimp2\node_modules\async\lib\async.js:607:21 at D:\temp\chimp2\node_modules\async\lib\async.js:246:17 at iterate (D:\temp\chimp2\node_modules\async\lib\async.js:146:13) at async.eachSeries (D:\temp\chimp2\node_modules\async\lib\async.js:162:9) at _asyncMap (D:\temp\chimp2\node_modules\async\lib\async.js:245:13) at Object.mapSeries (D:\temp\chimp2\node_modules\async\lib\async.js:228:23)

Any idea?

I am trying to get the WebDriverIO Boilerplate working with chimp and gulp-chimp. https://github.com/webdriverio/cucumber-boilerplate

And if I change my config file to:

module.exports = { port: 4444, path: './features' };

Then I get the following output which implies that I need to configure the Cucumber HTML reporting feature?

[13:36:41] Requiring external module babel-register [13:36:42] Using gulpfile D:\temp\chimp2\gulpfile.babel.js [13:36:43] Starting 'chimp'... [13:36:43] Selenium running in port: 5222 [13:36:43] WebDriverio running in port: 8165

[chimp] Running... [13:36:43] Finished 'chimp' after 70 ms [chimp][helper] setupBrowserAndDDP had error SyntaxError: Unexpected token u in JSON at position 0 at Object.parse (native) at setupBrowser (D:\temp\chimp2\node_modules\chimp\dist\lib\chimp-helper.js:94:43) at Object.setupBrowserAndDDP (D:\temp\chimp2\node_modules\chimp\dist\lib\chimp-helper.js:247:7) at D:\temp\chimp2\node_modules\chimp\dist\lib\cucumberjs\hooks.js:21:24 at D:\temp\chimp2\node_modules\chimp\node_modules\meteor-promise\fiber_pool.js:32:39 SyntaxError: Unexpected token u in JSON at position 0 at Object.parse (native) at setupBrowser (D:\temp\chimp2\node_modules\chimp\dist\lib\chimp-helper.js:94:43) at Object.setupBrowserAndDDP (D:\temp\chimp2\node_modules\chimp\dist\lib\chimp-helper.js:247:7) at D:\temp\chimp2\node_modules\chimp\dist\lib\cucumberjs\hooks.js:21:24 at D:\temp\chimp2\node_modules\chimp\node_modules\meteor-promise\fiber_pool.js:32:39 Cucumber steps failed D:\temp\chimp2\node_modules\gulp-chimp\index.js:100 if (options.htmlReport.enable) {

MacDennis76 commented 7 years ago

This issue can be closed. I have solved this issue by adding all options to the config file including port and cucumber HTML report options.