angular / webdriver-manager

A binary manager for E2E testing
MIT License
225 stars 117 forks source link

Unit tests fail on Windows 10 / NodeJS 8.11.2 / NPM 5.6.0 #312

Open bedrin opened 6 years ago

bedrin commented 6 years ago

Unit tests fail (commit f17b226) on Windows 10 / NodeJS 8.11.2 / NPM 5.6.0

> npm run test

> webdriver-manager@12.0.6 pretest c:\work\github\webdriver-manager
> tsc && gulp copy

[23:35:19] Using gulpfile c:\work\github\webdriver-manager\gulpfile.js
[23:35:19] Starting 'copy'...
[23:35:19] Finished 'copy' after 49 ms

> webdriver-manager@12.0.6 test c:\work\github\webdriver-manager
> npm run test-unit && npm run test-e2e

> webdriver-manager@12.0.6 test-unit c:\work\github\webdriver-manager
> jasmine

Started
...............................................FFFF{ Error: ENOENT: no such file or directory, stat 'c:\work\github\webdriver-manager\selenium_test\foobar.jar'
    at Object.fs.statSync (fs.js:948:11)
    at files_1.Downloader.getFile.then.result (c:\work\github\webdriver-manager\built\spec\files\downloader_spec.js:32:31)
    at <anonymous>
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat',
  path: 'c:\\work\\github\\webdriver-manager\\selenium_test\\foobar.jar' }
F...................................

Failures:
1) status should show the version number of the default and latest versions
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at ontimeout (timers.js:498:11)
        at tryOnTimeout (timers.js:323:5)
        at Timer.listOnTimeout (timers.js:290:5)
  Message:
    Expected ' 2.44.0' to contain '2.44.0 [last]'.
  Stack:
    Error: Expected ' 2.44.0' to contain '2.44.0 [last]'.
        at UserContext.it (c:\work\github\webdriver-manager\built\spec\cmds\status_spec.js:63:46)
  Message:
    Expected 1 to equal 2.
  Stack:
    Error: Expected 1 to equal 2.
        at UserContext.it (c:\work\github\webdriver-manager\built\spec\cmds\status_spec.js:65:48)
  Message:
    Expected ' 2.24' to contain '2.20 [last]'.
  Stack:
    Error: Expected ' 2.24' to contain '2.20 [last]'.
        at UserContext.it (c:\work\github\webdriver-manager\built\spec\cmds\status_spec.js:66:44)
  Message:
    Expected undefined to contain '2.24'.
  Stack:
    Error: Expected undefined to contain '2.24'.
        at UserContext.it (c:\work\github\webdriver-manager\built\spec\cmds\status_spec.js:67:44)

2) update for update-config.json should create a file for chrome
  Message:
    Error: EEXIST: file already exists, mkdir 'c:\work\github\webdriver-manager\selenium_test'
  Stack:
    Error: EEXIST: file already exists, mkdir 'c:\work\github\webdriver-manager\selenium_test'
        at Object.fs.mkdirSync (fs.js:885:18)
        at UserContext.beforeEach (c:\work\github\webdriver-manager\built\spec\cmds\update_spec.js:25:16)
  Message:
    TypeError: Cannot set property 'versionCustom' of undefined
  Stack:
    TypeError: Cannot set property 'versionCustom' of undefined
        at Program.update [as runMethod] (c:\work\github\webdriver-manager\built\lib\cmds\update.js:116:56)
        at Program.run (c:\work\github\webdriver-manager\built\lib\cli\programs.js:61:37)
        at UserContext.it (c:\work\github\webdriver-manager\built\spec\cmds\update_spec.js:41:30)
  Message:
    Error: EPERM: operation not permitted, lstat 'c:\work\github\webdriver-manager\selenium_test\selenium-server-standalone-2.44.0.jar'
  Stack:
    Error: EPERM: operation not permitted, lstat 'c:\work\github\webdriver-manager\selenium_test\selenium-server-standalone-2.44.0.jar'
        at Object.fs.lstatSync (fs.js:941:11)
        at rimrafSync (c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:291:24)
        at c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:342:5
        at Array.forEach (<anonymous>)
        at rmkidsSync (c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:341:26)
        at rmdirSync (c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:334:7)
        at fixWinEPERMSync (c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:209:5)
        at Function.rimrafSync [as sync] (c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:311:28)
        at UserContext.afterEach (c:\work\github\webdriver-manager\built\spec\cmds\update_spec.js:28:20)

3) update for update-config.json should create a file for standalone
  Message:
    Error: EEXIST: file already exists, mkdir 'c:\work\github\webdriver-manager\selenium_test'
  Stack:
    Error: EEXIST: file already exists, mkdir 'c:\work\github\webdriver-manager\selenium_test'
        at Object.fs.mkdirSync (fs.js:885:18)
        at UserContext.beforeEach (c:\work\github\webdriver-manager\built\spec\cmds\update_spec.js:25:16)
  Message:
    TypeError: Cannot set property 'versionCustom' of undefined
  Stack:
    TypeError: Cannot set property 'versionCustom' of undefined
        at Program.update [as runMethod] (c:\work\github\webdriver-manager\built\lib\cmds\update.js:116:56)
        at Program.run (c:\work\github\webdriver-manager\built\lib\cli\programs.js:61:37)
        at UserContext.it (c:\work\github\webdriver-manager\built\spec\cmds\update_spec.js:64:30)
  Message:
    Error: EPERM: operation not permitted, lstat 'c:\work\github\webdriver-manager\selenium_test\selenium-server-standalone-2.44.0.jar'
  Stack:
    Error: EPERM: operation not permitted, lstat 'c:\work\github\webdriver-manager\selenium_test\selenium-server-standalone-2.44.0.jar'
        at Object.fs.lstatSync (fs.js:941:11)
        at rimrafSync (c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:291:24)
        at c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:342:5
        at Array.forEach (<anonymous>)
        at rmkidsSync (c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:341:26)
        at rmdirSync (c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:334:7)
        at fixWinEPERMSync (c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:209:5)
        at Function.rimrafSync [as sync] (c:\work\github\webdriver-manager\node_modules\rimraf\rimraf.js:311:28)
        at UserContext.afterEach (c:\work\github\webdriver-manager\built\spec\cmds\update_spec.js:28:20)

4) downloader get file should download a file with mismatch content length
  Message:
    Error: EEXIST: file already exists, mkdir 'c:\work\github\webdriver-manager\selenium_test'
  Stack:
    Error: EEXIST: file already exists, mkdir 'c:\work\github\webdriver-manager\selenium_test'
        at Object.fs.mkdirSync (fs.js:885:18)
        at UserContext.beforeEach (c:\work\github\webdriver-manager\built\spec\files\downloader_spec.js:24:16)
  Message:
    Failed
  Stack:
    Error: Failed
        at update_1.program.run.then.catch.err (c:\work\github\webdriver-manager\built\spec\cmds\status_spec.js:32:18)
        at <anonymous>
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at ontimeout (timers.js:498:11)
        at tryOnTimeout (timers.js:323:5)
        at Timer.listOnTimeout (timers.js:290:5)

5) downloader get file should not download a file if the content lengths match
  Message:
    Error: EEXIST: file already exists, mkdir 'c:\work\github\webdriver-manager\selenium_test'
  Stack:
    Error: EEXIST: file already exists, mkdir 'c:\work\github\webdriver-manager\selenium_test'
        at Object.fs.mkdirSync (fs.js:885:18)
        at UserContext.beforeEach (c:\work\github\webdriver-manager\built\spec\files\downloader_spec.js:24:16)
  Message:
    Expected undefined to be truthy.
  Stack:
    Error: Expected undefined to be truthy.
        at files_1.Downloader.getFile.then.result (c:\work\github\webdriver-manager\built\spec\files\downloader_spec.js:30:32)
        at <anonymous>
  Message:
    Failed
  Stack:
    Error: Failed
        at files_1.Downloader.getFile.then.catch.error (c:\work\github\webdriver-manager\built\spec\files\downloader_spec.js:39:22)
        at <anonymous>

87 specs, 5 failures
Finished in 19.557 seconds

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webdriver-manager@12.0.6 test-unit: `jasmine`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webdriver-manager@12.0.6 test-unit 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\bedrin\AppData\Roaming\npm-cache\_logs\2018-06-03T20_35_42_806Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webdriver-manager@12.0.6 test: `npm run test-unit && npm run test-e2e`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webdriver-manager@12.0.6 test 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\bedrin\AppData\Roaming\npm-cache\_logs\2018-06-03T20_35_42_854Z-debug.log

bedrin@BEDRIN-LAPTOP c:\work\github\webdriver-manager
> node -v
v8.11.2

bedrin@BEDRIN-LAPTOP c:\work\github\webdriver-manager
> npm -v
5.6.0
rikhil9 commented 6 years ago

I am also facing the same issue. The problem is with Node 8.11.1 version and npm 6.1.0. I am using windows 7 machine.

cnishina commented 5 years ago

Could you try this again with webdriver-manager master branch? I changed a lot of the tests and developed this entire project on Windows 10.

cnishina commented 5 years ago

To run just the unit test, I think it is: npm run test-unit