0

I am following the below example to see how acceptance tests are implemented in Meteor

http://www.mhurwi.com/tutorial-test-driven-development-with-meteor-cucumber-chimp/

Below are the steps that i have tried

  1. Install Chimp globally i.e. npm install -g chimp
  2. Download the git example from the above link
  3. Run meteor application on port 3000
  4. Open a separate terminal and then execute the following command

    chimp --ddp=http://localhost:3000 --watch --path=tests

I get the following error all the time even though i am able to run the meteor application with no server or client errors

[chimp] Running...
=> Your Meteor application has errors.

Node version : 4.2.3

App Meteor version : 1.2.1

Base Meteor version : 1.4.0.1

Don't understand what is that i am doing wrong...Any help is appreciated.

Full error log below

[chimp] Chimp options are { watch: false,
  watchTags: '@focus,@dev,@watch',
  watchWithPolling: false,
  criticalSteps: null,
  criticalTag: '@critical',
  server: false,
  serverPort: 8060,
  serverHost: 'localhost',
  sync: true,
  offline: false,
  path: './features',
  format: 'pretty',
  tags: '~@ignore',
  singleSnippetPerFile: true,
  recommendedFilenameSeparator: '_',
  chai: false,
  screenshotsOnError: false,
  screenshotsPath: '.screenshots',
  captureAllStepScreenshots: false,
  saveScreenshotsToDisk: true,
  saveScreenshotsToReport: false,
  jsonOutput: null,
  compiler: 'js:E:\\Nodist\\bin\\node_modules\\chimp\\dist\\lib\\babel-register.js',
  conditionOutput: true,
  browser: 'chrome',
  platform: 'ANY',
  name: '',
  user: '',
  key: '',
  port: null,
  host: null,
  webdriverio:
   { desiredCapabilities: {},
     logLevel: 'silent',
     host: '127.0.0.1',
     port: 4444,
     path: '/wd/hub',
     baseUrl: null,
     coloredLogs: true,
     screenshotPath: null,
     waitforTimeout: 500,
     waitforInterval: 250 },
  seleniumStandaloneOptions:
   { version: '2.53.1',
     baseURL: 'https://selenium-release.storage.googleapis.com',
     drivers: { chrome: [Object], ie: [Object] } },
  noSessionReuse: false,
  simianResultEndPoint: 'api.simian.io/v1.0/result',
  simianAccessToken: false,
  simianResultBranch: null,
  simianRepositoryId: null,
  mocha: false,
  mochaTags: '',
  mochaGrep: null,
  mochaTimeout: 60000,
  mochaReporter: 'spec',
  mochaSlow: 10000,
  jasmine: false,
  jasmineConfig:
   { specDir: '.',
     specFiles: [ '**/*@(_spec|-spec|Spec).@(js|jsx)' ],
     helpers: [ 'support/**/*.@(js|jsx)' ],
     stopSpecOnExpectationFailure: false,
     random: false },
  jasmineReporterConfig: {},
  ddp: false,
  phantom_w: 1280,
  phantom_h: 1024,
  log: 'info',
  debug: false,
  seleniumDebug: null,
  debugCucumber: null,
  debugBrkCucumber: null,
  debugMocha: null,
  debugBrkMocha: null }
[chimp] Watching features with tagged with @focus,@dev,@watch
[chimp] watcher ready, running for the first time
[chimp] rerunning

[chimp] Running...
[chimp] interrupting
[chimp] no processes to interrupt
[chimp][selenium] Selenium object created
[chimp][selenium] Start
[chimp][selenium] Installing Selenium + drivers if needed
=> Your Meteor application has errors.

[chimp][selenium] hub can be seen at http://localhost:57897/wd/hub
[chimp][ddp-watcher] DDP connection error! Network error: ws://localhost:3000/websocket: connect ECONNREFUSED 127.0.0.1:3000
Unhandled rejection Error: Network error: ws://localhost:3000/websocket: connect ECONNREFUSED 127.0.0.1:3000
    at Object.ensureErrorObject (E:\Nodist\bin\node_modules\chimp\node_modules\bluebird\js\main\util.js:261:20)
    at Promise._rejectCallback (E:\Nodist\bin\node_modules\chimp\node_modules\bluebird\js\main\promise.js:469:22)
    at E:\Nodist\bin\node_modules\chimp\node_modules\bluebird\js\main\promise.js:486:17
    at onFailed (E:\Nodist\bin\node_modules\chimp\node_modules\xolvio-ddp\lib\ddp-client.js:338:7)
    at g (events.js:260:16)
    at emitOne (events.js:77:13)
    at emit (events.js:169:7)
    at null.<anonymous> (E:\Nodist\bin\node_modules\chimp\node_modules\xolvio-ddp\lib\ddp-client.js:84:12)
    at emitOne (events.js:82:20)
    at emit (events.js:169:7)
    at EventTarget.dispatchEvent (E:\Nodist\bin\node_modules\chimp\node_modules\faye-websocket\lib\faye\websocket\api\event_target.js:24:10)
    at instance._emitError (E:\Nodist\bin\node_modules\chimp\node_modules\faye-websocket\lib\faye\websocket\api.js:142:10)
    at Socket.<anonymous> (E:\Nodist\bin\node_modules\chimp\node_modules\faye-websocket\lib\faye\websocket\api.js:111:12)
    at emitOne (events.js:82:20)
    at Socket.emit (events.js:169:7)
    at emitErrorNT (net.js:1253:8)

Updated log

[chimp] Running...
[chimp] interrupting
[chimp] no processes to interrupt
[chimp][selenium] Selenium object created
[chimp][selenium] Start
[chimp][selenium] Installing Selenium + drivers if needed
=> Your Meteor application has errors.
[chimp][ddp-watcher] Connected
[chimp][ddp-watcher] ADDED to meteor_autoupdate_clientVersions:  e4NrqzoRgyNdxad2f
[chimp][ddp-watcher] ADDED to meteor_autoupdate_clientVersions:  version
[chimp][ddp-watcher] ADDED to meteor_autoupdate_clientVersions:  version-cordova
[chimp][ddp-watcher] ADDED to meteor_autoupdate_clientVersions:  version-refreshable
[chimp][ddp-watcher] meteor_autoupdate_clientVersions ready:
[chimp][ddp-watcher] [object Object]

[chimp][selenium] hub can be seen at http://localhost:62772/wd/hub
[chimp] Finished running async processes with errors
[chimp] run complete with errors [Error: Unable to connect to selenium]
[chimp] finished rerun
Adi
  • 127
  • 2
  • 14
  • Need a bit more info than that. Could you post the full error log? Try running with --debug and see what output you get – Xolv.io Aug 16 '16 at 11:35
  • Full error log added – Adi Aug 16 '16 at 14:41
  • Are you able to browse to localhost:3000 from your browser? – Xolv.io Aug 16 '16 at 15:09
  • I have added 127.0.0.1 to proxy and i am getting a different error now. Please see new log – Adi Aug 16 '16 at 15:16
  • Yes i am able to browse localhost:3000 – Adi Aug 16 '16 at 15:34
  • Chimp starts Selenium on a random port, as you can see in the line "hub can be seen at http://localhost:62772/wd/hub", whatever you did for the proxy to get 3000 working, you need to do the same for a HUGE port range , like from 3000-90000 – Xolv.io Aug 16 '16 at 22:24
  • I am able to browse to the hub locations as well on different ports... I have to run chimp with the example on a different laptop i get the exact same error..Not sure why this error occurs. – Adi Aug 17 '16 at 11:00

2 Answers2

0

The latest version of Chimp.js requires Oracle's JDK 1.8 or higher. You can download Oracle's latest JDK here. Confirm your version by running java -version.

hwillson
  • 1,399
  • 9
  • 7
  • This is the version of my machine java version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode) . Is this the correct version @hwillson? – Adi Aug 16 '16 at 14:02
  • That version looks good to me. I had a similar problem and upgrading the JDK fixed the issue for me. As mentioned in the comments on your original post, showing the results of running `chimp --ddp=http://localhost:3000 --watch --path=tests --debug` would help with debugging. – hwillson Aug 16 '16 at 14:16
  • Can you try downgrading to chimp version 0.38.0? `npm -g remove chimp; npm -g install chimp@0.38.0` – hwillson Aug 16 '16 at 15:02
  • Do you have the JDK or the JRE? You need the JDK – Xolv.io Aug 16 '16 at 15:09
0

This seems to be a proxy issue. My corporate group policy seems to enforce a different proxy settings which ideally replace my system proxy bypass settings.

Once i connected my laptop to guest wifi, which doesn't use any proxy settings, selenium server was suddenly reachable and then chimp ran my test successfully.

Adi
  • 127
  • 2
  • 14