Проект встроен в Angular 8. Чтобы обслуживать ответы на API, я реализовал фиктивный сервер. Мой пакет. json содержит следующие сценарии:
"scripts": {
"ng": "ng",
"mock": "node lib/stub-server",
"start": "concurrently --kill-others \"npm:mock\" \"ng serve\"",
"validate-pipeline-quality": "node validate-pipeline-quality.js",
"build": "ng build --prod --output-hashing=none && node build-element.js",
"test": "ng test --watch=false",
"lint": "ng lint",
"e2e": "concurrently --kill-others --success \"first\" \"ng e2e\" \"npm:mock\""
},
В последнее время я сталкиваюсь с ошибкой при выполнении npm запуска e2e. Ниже приведена ошибка:
FVFXR3EBHV2H:communication-preference-public smukher$ npm run e2e
> communication-preference-public@1.1.0 e2e /Users/smukher/AEVA/Applications/Frontend/communication-preference-public
> concurrently --kill-others --success "first" "ng e2e" "npm:mock"
[mock]
[mock] > communication-preference-public@1.1.0 mock /Users/smukher/AEVA/Applications/Frontend/communication-preference-public
[mock] > node lib/stub-server
[mock]
[mock] /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/lib/stub-server/../../test/stub-server
[mock] Mock Server is listening at 8080
[0] [10:38:03] I/config_source - curl -o/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
[0] [10:38:06] I/update - chromedriver: file exists /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_80.0.3987.16.zip
[0] [10:38:06] I/update - chromedriver: unzipping chromedriver_80.0.3987.16.zip
[0] [10:38:06] I/update - chromedriver: setting permissions to 0755 for /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_80.0.3987.16
[0] [10:38:06] I/update - chromedriver: chromedriver_80.0.3987.16 up to date
[0] ℹ 「wds」: Project is running at http://localhost:4200/webpack-dev-server/
[0] ℹ 「wds」: webpack output is served from /
[0] ℹ 「wds」: 404s will fallback to //index.html
[0]
[0] chunk {main} main.js, main.js.map (main) 42.8 kB [initial] [rendered]
[0] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 268 kB [initial] [rendered]
[0] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
[0] chunk {scripts} scripts.js, scripts.js.map (scripts) 13.7 kB [entry] [rendered]
[0] chunk {styles} styles.js, styles.js.map (styles) 10.1 kB [initial] [rendered]
[0] chunk {vendor} vendor.js, vendor.js.map (vendor) 4.58 MB [initial] [rendered]
[0] Date: 2020-02-05T09:38:15.981Z - Hash: de103d383b4a486e03cd - Time: 7446ms
[0] ** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
[0] ℹ 「wdm」: Compiled successfully.
[0] [10:38:16] I/launcher - Running 2 instances of WebDriver
[0] [10:38:17] I/testLogger -
[0] ------------------------------------
[0]
[0] [10:38:17] I/testLogger - [chrome #01] PID: 6939
[0] [chrome #01] Specs: /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/e2e/src/app.component.ispec.ts
[0] [chrome #01]
[0] [chrome #01] [10:38:16] I/direct - Using ChromeDriver directly...
[0] [chrome #01]
[0] [chrome #01] /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/error.js:546
[0] [chrome #01] throw new ctor(message);
[0] [chrome #01] ^
[0] [chrome #01] SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 80
[0] [chrome #01] (Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Mac OS X 10.14.6 x86_64)
[0] [chrome #01] at Object.checkLegacyResponse (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/error.js:546:15)
[0] [chrome #01] at parseHttpResponse (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/http.js:509:13)
[0] [chrome #01] at doSend.then.response (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/http.js:441:30)
[0] [chrome #01] at process._tickCallback (internal/process/next_tick.js:68:7)
[0] [chrome #01] From: Task: WebDriver.createSession()
[0] [chrome #01] at Function.createSession (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
[0] [chrome #01] at Function.createSession (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/chrome.js:761:15)
[0] [chrome #01] at Direct.getNewDriver (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/driverProviders/direct.js:77:33)
[0] [chrome #01] at Runner.createBrowser (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/runner.js:195:43)
[0] [chrome #01] at q.then.then (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/runner.js:339:29)
[0] [chrome #01] at _fulfilled (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:834:54)
[0] [chrome #01] at /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:863:30
[0] [chrome #01] at Promise.promise.promiseDispatch (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:796:13)
[0] [chrome #01] at /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:556:49
[0] [chrome #01] at runSingle (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:137:13)
[0]
[0] [10:38:17] I/testLogger -
[0]
[0] [10:38:17] E/launcher - Runner process exited unexpectedly with error code: 1
[0] [10:38:17] I/launcher - 1 instance(s) of WebDriver still running
[0] [10:38:17] I/testLogger -
[0] ------------------------------------
[0]
[0] [10:38:17] I/testLogger - [chrome #11] PID: 6940
[0] [chrome #11] Specs: /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/e2e/src/app.component.ispec.ts
[0] [chrome #11]
[0] [chrome #11] [10:38:16] I/direct - Using ChromeDriver directly...
[0] [chrome #11]
[0] [chrome #11] /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/error.js:546
[0] [chrome #11] throw new ctor(message);
[0] [chrome #11] ^
[0] [chrome #11] SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 80
[0] [chrome #11] (Driver info: chromedriver=80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185}),platform=Mac OS X 10.14.6 x86_64)
[0] [chrome #11] at Object.checkLegacyResponse (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/error.js:546:15)
[0] [chrome #11] at parseHttpResponse (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/http.js:509:13)
[0] [chrome #11] at doSend.then.response (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/http.js:441:30)
[0] [chrome #11] at process._tickCallback (internal/process/next_tick.js:68:7)
[0] [chrome #11] From: Task: WebDriver.createSession()
[0] [chrome #11] at Function.createSession (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
[0] [chrome #11] at Function.createSession (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/selenium-webdriver/chrome.js:761:15)
[0] [chrome #11] at Direct.getNewDriver (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/driverProviders/direct.js:77:33)
[0] [chrome #11] at Runner.createBrowser (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/runner.js:195:43)
[0] [chrome #11] at q.then.then (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/protractor/built/runner.js:339:29)
[0] [chrome #11] at _fulfilled (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:834:54)
[0] [chrome #11] at /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:863:30
[0] [chrome #11] at Promise.promise.promiseDispatch (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:796:13)
[0] [chrome #11] at /Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:556:49
[0] [chrome #11] at runSingle (/Users/smukher/AEVA/Applications/Frontend/communication-preference-public/node_modules/q/q.js:137:13)
[0]
[0] [10:38:17] I/testLogger -
[0]
[0] [10:38:17] E/launcher - Runner process exited unexpectedly with error code: 1
[0] [10:38:17] I/launcher - 0 instance(s) of WebDriver still running
[0] [10:38:17] I/launcher - chrome #01 failed with exit code: 1
[0] [10:38:17] I/launcher - chrome #11 failed with exit code: 1
[0] [10:38:17] I/launcher - overall: 2 process(es) failed to complete
[0] [10:38:17] E/launcher - Process exited with error code 100
[0] ng e2e exited with code 1
--> Sending SIGTERM to other processes..
[mock] npm run mock exited with code SIGTERM
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! communication-preference-public@1.1.0 e2e: `concurrently --kill-others --success "first" "ng e2e" "npm:mock"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the communication-preference-public@1.1.0 e2e 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! /Users/smukher/.npm/_logs/2020-02-05T09_38_17_200Z-debug.log
Я проверил версию хромедрайвера и обновил его. Я проверил версию webdriver-manager в Protractor, то есть также 12.1.7 Я попробовал все трюки, упомянутые в Интернете. Но в моем случае ничего не помогло.
Может ли кто-нибудь помочь мне в этом?
Спасибо
Шасвата Мукерджи