klassijs/klassi-js

Hangs on exit

whiskyplausible opened this issue · 2 comments

Hello! Thanks so much for the handy package - it's the only way I've managed to get Cucumber to work with webdriver.io, after trying out all the boiler plate projects etc.

Just having a little issue here though - I'm just running the example Duck Duck Go scripts, and they all run well, and complete and the report is produced. The problem is after this it just hangs and then eventually quits with a timeout.

It's running on a pretty much barebones package.json, Windows 10 64bit, node v8.10.0, Chrome 65.

Was also wondering - what's the best way to prevent it trying to email out the report?

> a_ap-ui-test-suite@1.0.0 runtests C:\Users\Computer\a_ap\a_ap-ui-test-suite
> node ./node_modules/webdriverio-cucumber-js/index.js

@search @wip
Feature: Searching for apps with duckduckgo

    As an internet user
    In order to find out more about certain user apps
    I want to be able to search for information about the required apps

  @search @wip
  Scenario: User inputs some search data
{"message":"The errorLog File has NOT been created: Error: ENOENT: no such file or directory, open 'C:\\Users\\Computer\\a_ap\\a_ap-ui-test-suite\\log\\errorLog\\KlassiTechAutomatedTestReport-13-04-2018-11:15:24.json'","level":"error"}
{"message":"The infoLog File has NOT been created: Error: ENOENT: no such file or directory, open 'C:\\Users\\Computer\\a_ap\\a_ap-ui-test-suite\\log\\infoLog\\KlassiTechAutomatedTestReport-13-04-2018-11:15:24.json'","level":"error"}
  √ Given The user arrives on the duckduckgo search page
{"message":"this is checking whats being returned:- DuckDuckGo — Privacy, simplified.","level":"info"}
{"message":"Search function completed","level":"info"}
  √ When they input space 1999
{ sessionId: '85981c0cbffbd0b930c4ece123ed26ee',
  status: 0,
  value:
   { ELEMENT: '0.550723880856145-1',
     'element-6066-11e4-a52e-4f735466cecf': '0.550723880856145-1' },
  selector: 'div#links' }
finished this bit
  √ Then they should see some results

  @search @wip
  Scenario: User inputs some search data
{"message":"The infoLog File has NOT been created: Error: ENOENT: no such file or directory, open 'C:\\Users\\Computer\\a_ap\\a_ap-ui-test-suite\\log\\infoLog\\KlassiTechAutomatedTestReport-13-04-2018-11:15:29.json'","level":"error"}
{"message":"The errorLog File has NOT been created: Error: ENOENT: no such file or directory, open 'C:\\Users\\Computer\\a_ap\\a_ap-ui-test-suite\\log\\errorLog\\KlassiTechAutomatedTestReport-13-04-2018-11:15:29.json'","level":"error"}
  √ Given The user arrives on the duckduckgo search page
{"message":"this is checking whats being returned:- DuckDuckGo — Privacy, simplified.","level":"info"}
{"message":"Search function completed","level":"info"}
  √ When they input angry birds
{ sessionId: 'b23681a13af34aaf89387b6dc0e36309',
  status: 0,
  value:
   { ELEMENT: '0.6262359681794236-1',
     'element-6066-11e4-a52e-4f735466cecf': '0.6262359681794236-1' },
  selector: 'div#links' }
finished this bit
  √ Then they should see some results

2 scenarios (2 passed)
6 steps (6 passed)
0m04.594s
Cucumber HTML report C:\Users\Computer\a_ap\a_ap-ui-test-suite\reports\KlassiTech Automated Test Report-13-04-2018.html generated successfully.

C:\Users\Computer\a_ap\a_ap-ui-test-suite\node_modules\cucumber\lib\cucumber\runtime\event_broadcaster.js:30
            process.nextTick(function(){ throw error; }); // prevent swallow by unhandled rejection
                                         ^
node_modules\webdriverio-cucumber-js\runtime\world.js:248 function timed out after 60000 milliseconds
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! a_ap-ui-test-suite@1.0.0 runtests: `node ./node_modules/webdriverio-cucumber-js/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the a_ap-ui-test-suite@1.0.0 runtests script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Computer\AppData\Roaming\npm-cache\_logs\2018-04-13T10_16_34_229Z-debug.log


Log file:


0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'runtests' ]
2 info using npm@5.6.0
3 info using node@v8.10.0
4 verbose run-script [ 'preruntests', 'runtests', 'postruntests' ]
5 info lifecycle a_ap-ui-test-suite@1.0.0~preruntests: a_ap-ui-test-suite@1.0.0
6 info lifecycle a_ap-ui-test-suite@1.0.0~runtests: a_ap-ui-test-suite@1.0.0
7 verbose lifecycle a_ap-ui-test-suite@1.0.0~runtests: unsafe-perm in lifecycle true
8 verbose lifecycle a_ap-ui-test-suite@1.0.0~runtests: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Computer\a_ap\a_ap-ui-test-suite\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files (x86)\Bitvise SSH Client;C:\Users\Computer\AppData\Local\Microsoft\WindowsApps;C:\Users\Computer\AppData\Local\atom\bin;C:\Users\Computer\AppData\Roaming\npm;C:\Program Files\Microsoft VS Code\bin
9 verbose lifecycle a_ap-ui-test-suite@1.0.0~runtests: CWD: C:\Users\Computer\a_ap\a_ap-ui-test-suite
10 silly lifecycle a_ap-ui-test-suite@1.0.0~runtests: Args: [ '/d /s /c',
10 silly lifecycle   'node ./node_modules/webdriverio-cucumber-js/index.js' ]
11 silly lifecycle a_ap-ui-test-suite@1.0.0~runtests: Returned: code: 1  signal: null
12 info lifecycle a_ap-ui-test-suite@1.0.0~runtests: Failed to exec runtests script
13 verbose stack Error: a_ap-ui-test-suite@1.0.0 runtests: `node ./node_modules/webdriverio-cucumber-js/index.js -b firefox`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid a_ap-ui-test-suite@1.0.0
15 verbose cwd C:\Users\Computer\a_ap\a_ap-ui-test-suite
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "runtests"
18 verbose node v8.10.0
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error a_ap-ui-test-suite@1.0.0 runtests: `node ./node_modules/webdriverio-cucumber-js/index.js -b firefox`
22 error Exit status 1
23 error Failed at the a_ap-ui-test-suite@1.0.0 runtests script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Hi whiskyplausible,

I have to do an update but in the mean time if you add these lines of code it will solve the problem.
The problem has to do with the email functionality so here goes

in world.js about ln: 267 replace with

reporter.generate(reportOptions);
if(program.email) {
return helpers.klassiEmail();
}
done();
}

also add to your list of const:
program = require('commander'),
++++++++______
in mailer.js right after ln: 56
add:
process.exit();
++++++++____

in index.js
add to the list of .options before .parse(process.argv):

.option('-e, --email [optional]', 'email for sending reports to stakeholders')

++++++++_____

I will update the framework in the next couple of days, thanks for pointing out the issue.

This has been fixed and code updated