goenning / typescript-selenium-example

Example of Page Object with Selenium, Node.js and Typescript
MIT License
116 stars 60 forks source link

Problem with running scripts #2

Open flywojt opened 6 years ago

flywojt commented 6 years ago

Hi. I am trying to run tests but I have got such errors:

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! ts-selenium@1.0.0 tdd: `rm -rf dist && tsc && mocha -t 10000 dist/tests`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the ts-selenium@1.0.0 tdd 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:

I searched google, but I did not find a solution. Any Idea? :)

P.S. Thanks for nice framework

goenning commented 6 years ago

That description doesn’t say much. Is there any other message/log?

flywojt commented 6 years ago

No. I write simple test to check out if everything is ok. Chrome is launched, and correct page is loaded but there is no any actions like send keys or clicks. It looks like that this is something with Webdriver.

flywojt commented 6 years ago

Full logs:

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/Cellar/node@6/6.12.0/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'run', 1 verbose cli 'tdd' ] 2 info using npm@5.6.0 3 info using node@v9.4.0 4 verbose run-script [ 'pretdd', 'tdd', 'posttdd' ] 5 info lifecycle ts-selenium@1.0.0~pretdd: ts-selenium@1.0.0 6 info lifecycle ts-selenium@1.0.0~tdd: ts-selenium@1.0.0 7 verbose lifecycle ts-selenium@1.0.0~tdd: unsafe-perm in lifecycle true 8 verbose lifecycle ts-selenium@1.0.0~tdd: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/flywojt/Desktop/typescript-selenium-example-master/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/Frameworks/Python.framework/Versions/2.7/bin 9 verbose lifecycle ts-selenium@1.0.0~tdd: CWD: /Users/flywojt/Desktop/typescript-selenium-example-master 10 silly lifecycle ts-selenium@1.0.0~tdd: Args: [ '-c', 'rm -rf dist && tsc && mocha -t 20000 dist/tests' ] 11 silly lifecycle ts-selenium@1.0.0~tdd: Returned: code: 1 signal: null 12 info lifecycle ts-selenium@1.0.0~tdd: Failed to exec tdd script 13 verbose stack Error: ts-selenium@1.0.0 tdd: rm -rf dist && tsc && mocha -t 20000 dist/tests 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16) 13 verbose stack at EventEmitter.emit (events.js:160:13) 13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:160:13) 13 verbose stack at maybeClose (internal/child_process.js:943:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) 14 verbose pkgid ts-selenium@1.0.0 15 verbose cwd /Users/flywojt/Desktop/typescript-selenium-example-master 16 verbose Darwin 17.3.0 17 verbose argv "/usr/local/Cellar/node@6/6.12.0/bin/node" "/usr/local/bin/npm" "run" "tdd" 18 verbose node v9.4.0 19 verbose npm v5.6.0 20 error code ELIFECYCLE 21 error errno 1 22 error ts-selenium@1.0.0 tdd: rm -rf dist && tsc && mocha -t 20000 dist/tests 22 error Exit status 1 23 error Failed at the ts-selenium@1.0.0 tdd script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

flywojt commented 6 years ago

It seems that using yarn resolve problems but I have got another issue: Error: Timeout of 20000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.