angular / webdriver-manager

A binary manager for E2E testing
MIT License
224 stars 116 forks source link

Update the downloaded geckodriver when running the ng e2e #455

Open cchung100m opened 4 years ago

cchung100m commented 4 years ago

Dear Experts,

I'd like to know how to force the webdriver to update the downloaded geckodriver when running the ng e2e because I already set the flags but it still did not work. Any suggestions would be appreciated. TIA

webdriver: 12.1.7 Angular CLI: 8.3.23

> webdriver-manager update --standalone true --chrome true --gecko true

curl -o /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/webdriver-manager/downloads/chromedriver.xml https://chromedriver.storage.googleapis.com/
curl -o /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/webdriver-manager/downloads/geckodriver-v0.26.0-macos.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-macos.tar.gz
curl -o /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/webdriver-manager/downloads/selenium-server-standalone-4.0.0-alpha-1.jar https://selenium-release.storage.googleapis.com/4.0/selenium-server-standalone-4.0.0-alpha-1.jar
curl -o /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/webdriver-manager/downloads/chromedriver_mac64.zip https://chromedriver.storage.googleapis.com/81.0.4044.69/chromedriver_mac64.zip

> ng e2e --webdriver-update true
Your global Angular CLI version (9.0.4) is greater than your local
version (8.3.23). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
[20:31:29] I/update - chromedriver: file exists /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_80.0.3987.106.zip
[20:31:29] I/update - chromedriver: unzipping chromedriver_80.0.3987.106.zip
[20:31:29] I/update - chromedriver: setting permissions to 0755 for /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_80.0.3987.106
[20:31:29] I/update - chromedriver: chromedriver_80.0.3987.106 up to date
10% building 4/4 modules 0 activeℹ 「wds」: Project is running at http://localhost:4200/webpack-dev-server/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: 404s will fallback to //index.html

chunk {main} main.js, main.js.map (main) 88.4 kB [initial] [rendered]
chunk {manager-manager-module} manager-manager-module.js, manager-manager-module.js.map (manager-manager-module) 1.39 MB  [rendered]
chunk {pages-user-user-module} pages-user-user-module.js, pages-user-user-module.js.map (pages-user-user-module) 45.5 kB  [rendered]
chunk {pages-workbench-workbench-module} pages-workbench-workbench-module.js, pages-workbench-workbench-module.js.map (pages-workbench-workbench-module) 256 kB  [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 283 kB [initial] [rendered]
chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 603 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 9.13 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 2.11 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 8.77 MB [initial] [rendered]
Date: 2020-04-05T12:31:59.737Z - Hash: 0e5b09f1f5cb7f6d5515 - Time: 27411ms
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
ℹ 「wdm」: Compiled successfully.

[21:06:19] I/testLogger - [firefox #11] PID: 53000
[firefox #11] Specs: /Users/cch/Downloads/submarine/submarine-workbench/workbench-web-ng/e2e/src/app.e2e-spec.ts
[firefox #11] 
[firefox #11] [21:06:19] I/direct - Using FirefoxDriver directly...
[firefox #11] [21:06:19] E/direct - Error code: 135
[firefox #11] [21:06:19] E/direct - Error message: Could not find geckodriver at /Users/cch/Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0. Run 'webdriver-manager update' to download binaries.
[firefox #11] [21:06:19] E/direct - Error: Could not find geckodriver at /Users/cch/Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0. Run 'webdriver-manager update' to download binaries.
cchung100m commented 4 years ago

Hi @cnishina

Sorry for any inconvenience.

I am running the webdriver-manager update successfully but it would fail when running ng e2e. I find that the gecko driver did not move to /node_modules/protractor/node_modules/webdriver-manager/selenium/, correctly. I would appreciate if you can share your experiences in solving it.

many thanks.

webdriver-manager update --standalone true --chrome true --gecko true

curl -o /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/webdriver-manager/downloads/chromedriver_mac64.zip https://chromedriver.storage.googleapis.com/81.0.4044.69/chromedriver_mac64.zip
curl -o /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/webdriver-manager/downloads/geckodriver-v0.26.0-macos.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-macos.tar.gz
curl -o /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/webdriver-manager/downloads/selenium-server-standalone-4.0.0-alpha-1.jar https://selenium-release.storage.googleapis.com/4.0/selenium-server-standalone-4.0.0-alpha-1.jar

ls -ltrh /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/webdriver-manager/downloads/

total 82416
-rwxr-xr-x  1 cch  staff   5.0M 10 11 06:53 geckodriver_0.26.0
-rwxr-xr-x  1 cch  staff    14M  3 15 05:40 chromedriver_81.0.4044.69
-rw-r--r--  1 cch  staff   6.7M  4  6 13:58 chromedriver_mac64.zip
-rw-r--r--  1 cch  staff    12M  4  6 13:58 selenium-server-standalone-4.0.0-alpha-1.jar
-rw-r--r--  1 cch  staff   1.9M  4  6 14:10 geckodriver-v0.26.0-macos.tar.gz
-rw-r--r--  1 cch  staff    89K  4  6 19:58 chromedriver.xml
-rw-r--r--  1 cch  staff   107K  4  6 19:58 selenium-server.xml
-rw-r--r--  1 cch  staff   329K  4  6 19:58 geckodriver.json
-rw-r--r--  1 cch  staff   328B  4  6 20:06 selenium-server.config.json
-rw-r--r--  1 cch  staff   290B  4  6 20:06 chromedriver.config.json
-rw-r--r--  1 cch  staff   276B  4  6 20:06 geckodriver.config.json

ng e2e --webdriver-update true


Your global Angular CLI version (9.0.4) is greater than your local
version (8.3.23). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
[20:31:29] I/downloader - curl -o/Users/cch/Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_80.0.3987.106.zip https://chromedriver.storage.googleapis.com/80.0.3987.16/chromedriver_mac64.zip
[20:31:29] I/update - chromedriver: unzipping chromedriver_80.0.3987.106.zip
[20:31:29] I/update - chromedriver: setting permissions to 0755 for /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_80.0.3987.106
[20:31:29] I/update - chromedriver: chromedriver_80.0.3987.106 up to date
10% building 4/4 modules 0 activeℹ 「wds」: Project is running at http://localhost:4200/webpack-dev-server/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: 404s will fallback to //index.html

chunk {main} main.js, main.js.map (main) 88.4 kB [initial] [rendered]
chunk {manager-manager-module} manager-manager-module.js, manager-manager-module.js.map (manager-manager-module) 1.39 MB  [rendered]
chunk {pages-user-user-module} pages-user-user-module.js, pages-user-user-module.js.map (pages-user-user-module) 45.5 kB  [rendered]
chunk {pages-workbench-workbench-module} pages-workbench-workbench-module.js, pages-workbench-workbench-module.js.map (pages-workbench-workbench-module) 256 kB  [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 283 kB [initial] [rendered]
chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 603 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 9.13 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 2.11 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 8.77 MB [initial] [rendered]
Date: 2020-04-05T12:31:59.737Z - Hash: 0e5b09f1f5cb7f6d5515 - Time: 27411ms
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
ℹ 「wdm」: Compiled successfully.

[21:06:19] I/testLogger - [firefox #11] PID: 53000
[firefox #11] Specs: /Downloads/submarine/submarine-workbench/workbench-web-ng/e2e/src/app.e2e-spec.ts
[firefox #11] 
[firefox #11] [21:06:19] I/direct - Using FirefoxDriver directly...
[firefox #11] [21:06:19] E/direct - Error code: 135
[firefox #11] [21:06:19] E/direct - Error message: Could not find geckodriver at /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0. Run 'webdriver-manager update' to download binaries.
[firefox #11] [21:06:19] E/direct - Error: Could not find geckodriver at /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.26.0. Run 'webdriver-manager update' to download binaries.

I guess the following target directory should contains geckodriver, doesn't it?

ls -ltrh /Downloads/submarine/submarine-workbench/workbench-web-ng/node_modules/protractor/node_modules/webdriver-manager/selenium/

total 68160
-rwxr-xr-x  1 cch  staff    14M 12 16 18:01 chromedriver_80.0.3987.106
-rw-r--r--  1 cch  staff   107K  3 31 23:09 selenium-server.xml
-rw-r--r--  1 cch  staff   328B  3 31 23:09 selenium-server.config.json
-rw-r--r--  1 cch  staff    12M  3 31 23:09 selenium-server-standalone-4.0.0-alpha-1.jar
-rw-r--r--  1 cch  staff   389K  4  1 11:35 gecko-response.json
-rw-r--r--  1 cch  staff   6.7M  4  5 21:05 chromedriver_80.0.3987.106.zip
-rw-r--r--  1 cch  staff    89K  4  6 19:40 chrome-response.xml
-rw-r--r--  1 cch  staff   682B  4  6 20:09 update-config.json