When I run wdio-runner, I have got "wdio-cli: Can't identify message from worker" warning message - webdriver-io

I have had a problem with WebdriverIO & Cucumber.
I used latest version of WebdriverIO (#v5.x.x) and Cucumber v4. When I run my test suite, the console shows me a warning message. Also, no Cucumber .json data file is created in the process.
The warning message:
WARN wdio-cli: Can't identify message from worker:
Here is my package.json file:
"dependencies": {
"#wdio/allure-reporter": "^5.4.16",
"#wdio/cli": "^5.4.17",
"#wdio/local-runner": "^5.4.17",
"#wdio/selenium-standalone-service": "^5.4.14",
"#wdio/spec-reporter": "^5.4.15",
"chai": "^4.2.0",
"cucumber": "^4.0.0",
"moment": "^2.24.0",
"wdio-cucumber-framework": "^2.2.8",
"webdriverio": "^5.4.17"
},
"devDependencies": {
"#babel/cli": "^7.2.3",
"#babel/core": "^7.2.2",
"#babel/preset-env": "^7.3.1",
"#babel/register": "^7.0.0"
},
Here is console output:
"C:\Program Files\nodejs\node.exe" D:\Git\Aydes-Wdio\e2e\node_modules\#wdio\cli\bin\wdio.js Conf/wdio.conf.js --suite Test
2019-02-18T08:52:46.911Z DEBUG wdio-config: #wdio/sync not found, running tests asynchronous
2019-02-18T08:52:47.729Z DEBUG wdio-cli:run: Run suite with config Conf/wdio.conf.js and params { _: [ 'Conf/wdio.conf.js' ],
suite: [ 'Test' ],
'$0': 'node_modules\\#wdio\\cli\\bin\\wdio.js' }
cπŸ• 1 running, 0 passed, 0 failed, 1 total (0% completed)
πŸ•‘ 1 running, 0 passed, 0 failed, 1 total (0% completed)
πŸ•’ 1 running, 0 passed, 0 failed, 1 total (0% completed)
πŸ•“ 1 running, 0 passed, 0 failed, 1 total (0% completed)
πŸ•” 1 running, 0 passed, 0 failed, 1 total (0% completed)
πŸ•• 1 running, 0 passed, 0 failed, 1 total (0% completed)
πŸ•– 1 running, 0 passed, 0 failed, 1 total (0% completed)
c
Stdout:
2019-02-18T08:52:48.887Z INFO wdio-cli:Launcher: Run onPrepare hook
2019-02-18T08:52:51.456Z INFO wdio-local-runner: Start worker 0-0 with arg: Conf/wdio.conf.js,--suite,Test
2019-02-18T08:53:05.197Z DEBUG wdio-local-runner: Runner 0-0 finished with exit code 0
2019-02-18T08:53:05.199Z INFO wdio-cli:Launcher: Run onComplete hook
Stderr:
2019-02-18T08:53:00.118Z WARN wdio-cli: Can't identify message from worker: {"event":"suite:start","cid":"0-0","uid":"Demo Page of Google1","title":"Demo Page of Google","pending":false,"parent":null,"type":"suite","file":"Web\\Features\\Test.feature","err":{},"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"keyword":"Feature"}, ignoring!
2019-02-18T08:53:00.137Z WARN wdio-cli: Can't identify message from worker: {"event":"suite:start","cid":"0-0","uid":"Search a text in Google3","title":"Search a text in Google","pending":false,"parent":"Demo Page of Google1","type":"suite","file":"Web\\Features\\Test.feature","err":{},"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"keyword":null}, ignoring!
2019-02-18T08:53:00.140Z WARN wdio-cli: Can't identify message from worker: {"event":"test:start","cid":"0-0","uid":"I open \"http://www.google.com\" the website4","title":"I open \"http://www.google.com\" the website","pending":false,"parent":"Search a text in Google3","type":"test","file":"Web\\Features\\Test.feature","err":{},"duration":0,"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"featureName":"Demo Page of Google","scenarioName":"Search a text in Google","keyword":null}, ignoring!
2019-02-18T08:53:04.769Z WARN wdio-cli: Can't identify message from worker: {"event":"test:pass","cid":"0-0","uid":"I open \"http://www.google.com\" the website4","title":"I open \"http://www.google.com\" the website","pending":false,"parent":"Search a text in Google3","type":"test","file":"Web\\Features\\Test.feature","err":{},"duration":4629,"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"keyword":"Given "}, ignoring!
2019-02-18T08:53:04.771Z WARN wdio-cli: Can't identify message from worker: {"event":"suite:end","cid":"0-0","uid":"Search a text in Google3","title":"Search a text in Google","pending":false,"parent":"Demo Page of Google1","type":"suite","file":"Web\\Features\\Test.feature","err":{},"duration":4634,"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"keyword":null}, ignoring!
2019-02-18T08:53:04.773Z WARN wdio-cli: Can't identify message from worker: {"event":"suite:end","cid":"0-0","uid":"Demo Page of Google1","title":"Demo Page of Google","pending":false,"parent":null,"type":"suite","file":"Web\\Features\\Test.feature","err":{},"duration":4655,"runner":{"0-0":{"maxInstances":5,"browserName":"chrome"}},"specs":["D:\\Git\\Aydes-Wdio\\e2e\\Web\\Features\\Test.feature"],"tags":[],"keyword":null}, ignoring!
Test Suites: 1 passed, 1 total (100% completed)
Time: πŸ•— 16.46s
Process finished with exit code 0

I have found my mistake.
Here is explaining why cucumber not running on wdio V5
To use Cucumber you have to use WebdriverIO v4 until the framework has been migrated to v5

Related

Webdriverio Cucumberjs tests for a React Native app fails on AWS Device Farm - Socket hang up

I'm writing End-to-ends tests for a React Native app using WebdriverIo, Appium and Cucumberjs and deploying the tests on the AWS Device Farm.
The tests are working fine both on the Android simulator and on an actual real device. Though, on AWS, it throws errors such as (node:3113) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized" and RequestError: socket hang up. This is shown in more detail below:
[DeviceFarm] echo "Start Appium Node test"
Start Appium Node test
[DeviceFarm] npm run only-one-test-aws
> e2e-cucumber-wdio-appium#1.0.0 only-one-test-aws /tmp/scratch0EgKio.scratch/test-packageFvDXet
> npx wdio ./wdio.android.conf.js --spec ./features/recarga/verificacacaoCodigoDeAcessoInvalido.feature
Execution of 1 spec files started at 2020-06-04T18:23:19.220Z
2020-06-04T18:23:19.223Z INFO #wdio/cli:launcher: Run onPrepare hook
2020-06-04T18:23:19.254Z INFO #wdio/cli:launcher: Run onWorkerStart hook
2020-06-04T18:23:19.256Z INFO #wdio/local-runner: Start worker 0-0 with arg: ./wdio.android.conf.js,--spec,./features/recarga/verificacacaoCodigoDeAcessoInvalido.feature
[0-0] 2020-06-04T18:23:20.961Z INFO #wdio/local-runner: Run worker command: run
[0-0] 2020-06-04T18:23:21.062Z DEBUG #wdio/local-runner:utils: init remote session
[0-0] 2020-06-04T18:23:21.095Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] RUNNING in undefined - /features/recarga/verificacacaoCodigoDeAcessoInvalido.feature
[0-0] 2020-06-04T18:23:22.697Z DEBUG #wdio/local-runner:utils: init remote session
[0-0] 2020-06-04T18:23:22.714Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-06-04T18:23:22.717Z INFO webdriver: [POST] http://127.0.0.1:4723/wd/hub/session
[0-0] 2020-06-04T18:23:22.717Z INFO webdriver: DATA {
capabilities: { alwaysMatch: {}, firstMatch: [ {} ] },
desiredCapabilities: {}
}
[0-0] (node:3113) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-0] 2020-06-04T18:24:52.853Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option.
[0-0] 2020-06-04T18:24:52.856Z INFO webdriver: Retrying 1/3
[0-0] 2020-06-04T18:24:52.857Z INFO webdriver: [POST] http://127.0.0.1:4723/wd/hub/session
[0-0] 2020-06-04T18:24:52.857Z INFO webdriver: DATA {
capabilities: { alwaysMatch: {}, firstMatch: [ {} ] },
desiredCapabilities: {}
}
[0-0] 2020-06-04T18:24:54.004Z DEBUG webdriver: request failed due to response error: unknown error
[0-0] 2020-06-04T18:24:54.004Z WARN webdriver: Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: end of central directory record signature not found
[0-0] 2020-06-04T18:24:54.005Z INFO webdriver: Retrying 2/3
[0-0] 2020-06-04T18:24:54.014Z INFO webdriver: [POST] http://127.0.0.1:4723/wd/hub/session
[0-0] 2020-06-04T18:24:54.014Z INFO webdriver: DATA {
capabilities: { alwaysMatch: {}, firstMatch: [ {} ] },
desiredCapabilities: {}
}
[0-0] 2020-06-04T18:24:54.030Z ERROR webdriver: RequestError: socket hang up
at ClientRequest.<anonymous> (/tmp/scratch0EgKio.scratch/test-packageFvDXet/node_modules/got/dist/source/core/index.js:817:25)
at Object.onceWrapper (events.js:417:26)
at ClientRequest.emit (events.js:322:22)
at ClientRequest.EventEmitter.emit (domain.js:482:12)
at ClientRequest.origin.emit (/tmp/scratch0EgKio.scratch/test-packageFvDXet/node_modules/#szmarczak/http-timer/dist/source/index.js:39:20)
at Socket.socketOnEnd (_http_client.js:453:9)
at Socket.emit (events.js:322:22)
at Socket.EventEmitter.emit (domain.js:482:12)
at endReadableNT (_stream_readable.js:1187:12)
at connResetException (internal/errors.js:608:14)
at Socket.socketOnEnd (_http_client.js:453:23)
at Socket.emit (events.js:322:22)
at Socket.EventEmitter.emit (domain.js:482:12)
at endReadableNT (_stream_readable.js:1187:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
[0-0] 2020-06-04T18:24:54.031Z ERROR #wdio/runner: Error: Failed to create session.
socket hang up
at startWebDriverSession (/tmp/scratch0EgKio.scratch/test-packageFvDXet/node_modules/webdriver/build/utils.js:45:11)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[0-0] Error: Failed to create session.
socket hang up
2020-06-04T18:24:54.147Z DEBUG #wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in undefined - /features/recarga/verificacacaoCodigoDeAcessoInvalido.feature
2020-06-04T18:24:54.148Z INFO #wdio/cli:launcher: Run onComplete hook
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:01:34
2020-06-04T18:24:54.164Z INFO #wdio/local-runner: Shutting down spawned worker
2020-06-04T18:24:54.416Z INFO #wdio/local-runner: Waiting for 0 to shut down gracefully
2020-06-04T18:24:54.417Z INFO #wdio/local-runner: shutting down
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! e2e-cucumber-wdio-appium#1.0.0 only-one-test-aws: `npx wdio ./wdio.android.conf.js --spec ./features/recarga/verificacacaoCodigoDeAcessoInvalido.feature`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the e2e-cucumber-wdio-appium#1.0.0 only-one-test-aws 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! /home/device-farm/.npm/_logs/2020-06-04T18_24_54_506Z-debug.log
[DEVICEFARM] ########### Entering phase post_test ###########
[DEVICEFARM] ########### Finish executing testspec ###########
[DEVICEFARM] ########### Setting upload permissions ###########
[DEVICEFARM] Tearing down your device. Your tests report will come shortly.
I also tried this question's solution by installing the webdriverio and #wdio/cli dependencies globally, though it did not work to me.
PS: I've already been able to successfully perform tests on the AWS Device Farm using webdriverio and cucumber. Though, these errors started to show up for me recently and I still have no clue on how to solve them.
Can someone please help me with this?

Courgette - issue with running test

I'm trying to use Courgette to test an Angular web app. This is my first time so I started with a tutorial from here:
The thing is that I can't run even the built in test. this is my conf.js:
const path = require('path');
require('babel-core/register');
const specsPath = 'uiTests';
const outputPath = 'uiTestResult';
const cukeTractorPath = 'node_modules/cucumber-protractor/uiTestHelpers';
exports.pomConfig = {
outputPath,
timeoutInSeconds: 10,
pagesPath: path.resolve(specsPath, 'pages'),
componentsPath: path.resolve(specsPath, 'components'),
baseUrl: 'https://www.google.com/', // <------------ SET THE URL TO YOUR PROJECT HERE
};
exports.cucumberHtmlReporterConfig = {};
const cukeTags = process.env.cukeTags ? process.env.cukeTags.replace(',', ' or ') : '';
const protractorConfig = {
directConnect: true,
ignoreUncaughtExceptions: true,
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
specs: [
`${specsPath}/features/**/*.feature`,
],
capabilities: {
// acceptInsecureCerts: true, // uncomment to ignore SSL warnings
'shardTestFiles': !cukeTags && !process.env.linearise && !process.env.showStepDefinitionUsage,
'maxInstances': 4,
browserName: 'chrome',
chromeOptions: {
args: ['--window-size=1100,800'].concat(process.env.disableHeadless ? [] : ['--headless', '--disable-gpu']),
},
// 'browserName': 'firefox',
// 'moz:firefoxOptions': {
// args: [].concat(process.env.disableHeadless ? [] : ['-headless']),
// prefs: {
// 'general.useragent.override': 'Automated tests',
// },
// },
},
cucumberOpts: {
'require': [
// `${specsPath}/helpers/globals.js`,
`${cukeTractorPath}/globals.js`,
`${cukeTractorPath}/hooks/attachScenarioNameBefore.js`,
`${cukeTractorPath}/hooks/attachScreenshotAfter.js`,
`${cukeTractorPath}/hooks/pageObjectModelBefore.js`,
`${cukeTractorPath}/hooks/addMethodsBefore.js`,
`${cukeTractorPath}/hooks/setDefaultTimeout.js`,
`${cukeTractorPath}/stepDefinitions/*.js`,
`${specsPath}/stepDefinitions/*.js`,
// `${specsPath}/helpers/hooks.js`,
],
'tags': ['~ignore'].concat(cukeTags || []),
'format': [
'node_modules/cucumber-protractor/cucumberFormatter.js',
`json:./${outputPath}/report.json`,
].concat(process.env.showStepDefinitionUsage ? 'node_modules/cucumber/lib/formatter/usage_formatter.js' : []),
'profile': false,
'no-source': true,
},
onPrepare: () => { browser.ignoreSynchronization = true; },
};
exports.config = protractorConfig;
And this is the message from the terminal:
> c10#1.0.0 ct C:\Users\Melinda\Desktop\Protractor\c10
> set NODE_OPTIONS=--no-deprecation | cuketractor
Brm brm... off we go!
[09:04:34] I/launcher - Running 1 instances of WebDriver
[09:04:34] I/direct - Using ChromeDriver directly...
DevTools listening on ws://127.0.0.1:12249/devtools/browser/748be31e-7dd6-4f56-95d5-eba8122e4012
Test feature::: Clicking I’m Feeling Lucky without typing a search query goes straight to doodles
Getting full url: https://www.google.com/
Given I am on the 'Google Home' page ---> PASSED
[09:04:38] W/element - more than one element found for locator By(css selector, [name="btnI"]) - the first result will be used
When I click 'I’m Feeling Lucky' ---> FAILED
Then I expect the url to contain 'google.com/doodles' ---> SKIPPED
Screenshot of: Clicking I’m Feeling Lucky without typing a search query goes straight to doodles
*************************************
ScreenshotFilePath:
uiTestResult\Clicking-I’m-Feeling-Lucky-without-typing-a-search-query-goes-straight-to-doodles-1558944278600.png
*************************************
-------------------------------------
---FAIL---
[09:04:38] I/launcher - 0 instance(s) of WebDriver still running
[09:04:38] I/launcher - chrome #01 failed 1 test(s)
[09:04:38] I/launcher - overall: 1 failed spec(s)
[09:04:38] E/launcher - Process exited with error code 1
Cucumber HTML report C:\Users\Melinda\Desktop\Protractor\c10\uiTestResult\cucumberReport.html generated successfully.
------------------ Scenario Error --------------- Clicking I’m Feeling Lucky without typing a search query goes straight
to doodles
Tags: #google, #google-feeling-lucky
Step: When I click 'I’m Feeling Lucky'
Location: node_modules\cucumber-protractor\uiTestHelpers\stepDefinitions\commonWhenSteps.js:46
Feature: uiTests\features\google.feature:4
Error message: ElementNotVisibleError: element not visible
(Session info: headless chrome=74.0.3729.169)
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 10.0.17134 x86_64)
at Object.checkLegacyResponse (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\http.js:441:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: WebElement.click()
at Driver.schedule (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\webdriver.js:807:17)
at WebElement.schedule_ (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\webdriver.js:2010:25)
at WebElement.click (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\webdriver.js:2092:17)
at actionFn (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\protractor\built\element.js:89:44)
at Array.map (<anonymous>)
at actionResults.getWebElements.then (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\protractor\built\element.js:461:65)
at ManagedPromise.invokeCallback_ (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\promise.js:1376:14)
at TaskQueue.execute_ (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\promise.js:3084:14)
at TaskQueue.executeNext_ (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\promise.js:3067:27)
at asyncRun (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\promise.js:2927:27)
at C:\Users\Melinda\Desktop\Protractor\c10\node_modules\selenium-webdriver\lib\promise.js:668:7
at process._tickCallback (internal/process/next_tick.js:68:7)Error
at ElementArrayFinder.applyAction_ (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\protractor\built\element.js:459:27)
at ElementArrayFinder.(anonymous function).args [as click] (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\protractor\built\element.js:91:29)
at ElementFinder.(anonymous function).args [as click] (C:\Users\Melinda\Desktop\Protractor\c10\node_modules\protractor\built\element.js:831:22)
-----SCREENSHOT - hold cmd (on mac) and click .png below if using iterm ----
ScreenshotFilePath: uiTestResult\Clicking-I’m-Feeling-Lucky-without-typing-a-search-query-goes-straight-to-doodles-1558944278600.png
---------
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Total Scenarios β”‚ Successful β”‚ Failures β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 1 β”‚ 0 β”‚ 1 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! c10#1.0.0 ct: `set NODE_OPTIONS=--no-deprecation | cuketractor`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the c10#1.0.0 ct 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\Melinda\AppData\Roaming\npm-cache\_logs\2019-05-27T08_04_38_705Z-debug.log
And my log file:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Melinda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'ct' ]
2 info using npm#6.9.0
3 info using node#v10.15.3
4 verbose run-script [ 'prect', 'ct', 'postct' ]
5 info lifecycle c10#1.0.0~prect: c10#1.0.0
6 info lifecycle c10#1.0.0~ct: c10#1.0.0
7 verbose lifecycle c10#1.0.0~ct: unsafe-perm in lifecycle true
8 verbose lifecycle c10#1.0.0~ct: PATH: C:\Users\Melinda\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Melinda\Desktop\Protractor\c10\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Melinda\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Taurus\bin;C:\Program Files\Taurus\bin;C:\Program Files\Java\jdk-10.0.2\bin;C:\Program Files\Java\jre-10.0.2\bin;C:\Users\Melinda\Downloads\apache-jmeter-4.0\apache-jmeter-4.0\bin;C:\Users\Melinda\AppData\Local\Taurus\bin;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Melinda\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Melinda\AppData\Roaming\npm
9 verbose lifecycle c10#1.0.0~ct: CWD: C:\Users\Melinda\Desktop\Protractor\c10
10 silly lifecycle c10#1.0.0~ct: Args: [ '/d /s /c',
10 silly lifecycle 'set NODE_OPTIONS=--no-deprecation | cuketractor' ]
11 silly lifecycle c10#1.0.0~ct: Returned: code: 1 signal: null
12 info lifecycle c10#1.0.0~ct: Failed to exec ct script
13 verbose stack Error: c10#1.0.0 ct: `set NODE_OPTIONS=--no-deprecation | cuketractor`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Melinda\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Melinda\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid c10#1.0.0
15 verbose cwd C:\Users\Melinda\Desktop\Protractor\c10
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Melinda\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "ct"
18 verbose node v10.15.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error c10#1.0.0 ct: `set NODE_OPTIONS=--no-deprecation | cuketractor`
22 error Exit status 1
23 error Failed at the c10#1.0.0 ct script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I'm not even sure where the problem is. According to the error message the element in my 'When' section can't be found but chrome doesn't even open up in the first place.
Can anyone help with this?
It could either be that the sample was broken at the time or that your locale is different to en-gb and the text is wrong in the button. Isn't the most reliable of samples, needs to be changed to something more stable ideally, something hosted by courgette.

"Connection refused! Is selenium server started?" error in VueJS Nightwatch E2E tests using ChromeDriver and Chrome

I have a VueJS app that has the default Nightwatch E2E tests. I just spent some time getting user accounts and auth set up. After doing so, when I try to run my E2E tests, they fail mysteriously. Here's the command line output I get:
code/premium-poker-tools [master●] Β» npm run e2e
> premium-poker-tools#1.0.0 e2e /Users/adamzerner/code/premium-poker-tools
> node test/e2e/runner.js
> Starting dev server...
Starting to optimize CSS...
> Listening at http://localhost:8080
Starting selenium server... started - PID: 58502
[BABEL] Note: The code generator has deoptimised the styling of "/Users/adamzerner/code/premium-poker-tools/test/e2e/specs/hit-calculator.js" as it exceeds the max of "500KB".
player
1
2
3
1) "before all" hook
0 passing (2s)
1 failing
1) player "before all" hook:
Connection refused! Is selenium server started?
npm ERR! code ELIFECYCLE
npm ERR! errno 10
npm ERR! premium-poker-tools#1.0.0 e2e: `node test/e2e/runner.js`
npm ERR! Exit status 10
npm ERR!
npm ERR! Failed at the premium-poker-tools#1.0.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/adamzerner/.npm/_logs/2019-05-23T19_47_08_016Z-debug.log
code/premium-poker-tools [master●] Β»
And here is /Users/adamzerner/.npm/_logs/2019-05-27T17_44_07_557Z-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/11.11.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run',
1 verbose cli 'e2e' ]
2 info using npm#6.9.0
3 info using node#v11.11.0
4 verbose run-script [ 'pree2e', 'e2e', 'poste2e' ]
5 info lifecycle premium-poker-tools#1.0.0~pree2e: premium-poker-tools#1.0.0
6 info lifecycle premium-poker-tools#1.0.0~e2e: premium-poker-tools#1.0.0
7 verbose lifecycle premium-poker-tools#1.0.0~e2e: unsafe-perm in lifecycle true
8 verbose lifecycle premium-poker-tools#1.0.0~e2e: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/adamzerner/code/premium-poker-tools/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/adamzerner/.rvm/bin
9 verbose lifecycle premium-poker-tools#1.0.0~e2e: CWD: /Users/adamzerner/code/premium-poker-tools
10 silly lifecycle premium-poker-tools#1.0.0~e2e: Args: [ '-c', 'node test/e2e/runner.js' ]
11 silly lifecycle premium-poker-tools#1.0.0~e2e: Returned: code: 10 signal: null
12 info lifecycle premium-poker-tools#1.0.0~e2e: Failed to exec e2e script
13 verbose stack Error: premium-poker-tools#1.0.0 e2e: `node test/e2e/runner.js`
13 verbose stack Exit status 10
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:197:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:197:13)
13 verbose stack at maybeClose (internal/child_process.js:984:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid premium-poker-tools#1.0.0
15 verbose cwd /Users/adamzerner/code/premium-poker-tools
16 verbose Darwin 18.6.0
17 verbose argv "/usr/local/Cellar/node/11.11.0/bin/node" "/usr/local/bin/npm" "run" "e2e"
18 verbose node v11.11.0
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 10
22 error premium-poker-tools#1.0.0 e2e: `node test/e2e/runner.js`
22 error Exit status 10
23 error Failed at the premium-poker-tools#1.0.0 e2e script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 10, true ]
For one, the Connection refused! Is selenium server started? error seems wrong. Above that it says Starting selenium server... started - PID: 58502, and I see a Chrome browser pop up very briefly and then immediately close.
Here is the code for the before block in question:
before(function (browser, done) {
console.log(1);
equityCalculator = browser.page['equity-calculator']();
console.log(2);
equityCalculator.navigate();
console.log(3);
browser.pause(20000);
equityCalculator
.waitForElementVisible('#app', 50000, function () {
console.log(4);
browser.resizeWindow(1440, 852, function () {
console.log(5);
done();
});
})
;
});
I've been trying to pin down where the problem occurs, but I'm having a lot of trouble. 1, 2, and 3 get logged out, but not 4 or 5, so that helps. But if 3 gets logged out, why isn't browser.pause(20000) working?
I've also been trying to mess around in my actual code to see where the issue is. I tried some alert statements in main.js to try to pinpoint the issue:
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
alert(1);
window.$ = require('jquery');
require('bootstrap');
alert(2);
import Vue from 'vue';
import store from '#/store';
import App from './App';
import router from './router';
import monkeyPatches from '#/services/monkey-patches';
import axios from 'axios';
import VueAxios from 'vue-axios';
alert(3);
Vue.config.productionTip = false
Vue.use(VueAxios, axios);
axios.interceptors.request.use(
function(config) {
config.withCredentials = true;
return config;
},
function(error) {
return Promise.reject(error);
}
);
/* eslint-disable no-new */
new Vue({
el: '#app',
router: router,
store: store,
template: '<App/>',
components: { App }
});
$(function () {
$('[data-toggle="popover"]').popover();
});
// if (navigator.serviceWorker) {
// navigator.serviceWorker.register('/service-worker.js').catch(function() {
// console.log('Service worker registration failed.');
// });
// }
But weirdly, alert(1) isn't even working. So I feel at a loss. From what I understand, the top of main.js is the "beginning" of a Vue app, and if it's not even reaching that point, what is going on? equityCalculator = browser.page['equity-calculator'](); and equityCalculator.navigate(); seem pretty standard. Here's a snippet of the page object:
module.exports = {
url: 'http://localhost:8080/equity-calculator',
elements: {
'app': '#app',
When I start my dev server and go to that url, it totally works. And my E2E tests were all working perfectly before I implemented user accounts and auth, I didn't change this file, and yet now I'm having the issue.
I'm not sure where I can go from here. Help!
Update:
Excerpt from package.json:
{
...
"dependencies": {
...
"chromedriver": "^2.45.0",
"cross-spawn": "^6.0.5",
"nightwatch": "^0.9.21",
"selenium-server": "^3.141.59",
},
}
Here's nightwatch.conf.js:
require('babel-register')
let config = require('../../config')
// http://nightwatchjs.org/gettingstarted#settings-file
module.exports = {
src_folders: ['test/e2e/specs'],
output_folder: 'test/e2e/reports',
custom_assertions_path: ['test/e2e/custom-assertions'],
page_objects_path: 'test/e2e/page-objects',
globals_path: 'test/e2e/globals.js',
test_runner : 'mocha',
selenium: {
start_process: true,
server_path: require('selenium-server').path,
host: '127.0.0.1',
port: 4444,
cli_args: {
'webdriver.chrome.driver': require('chromedriver').path
}
},
test_settings: {
default: {
selenium_port: 4444,
selenium_host: 'localhost',
silent: true,
globals: {
devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port),
handStrings: [
'aa', 'aks', 'aqs', 'ajs', 'ats', 'a9s', 'a8s', 'a7s', 'a6s', 'a5s', 'a4s', 'a3s', 'a2s',
'ako', 'kk', 'kqs', 'kjs', 'kts', 'k9s', 'k8s', 'k7s', 'k6s', 'k5s', 'k4s', 'k3s', 'k2s',
'aqo', 'kqo', 'qq', 'qjs', 'qts', 'q9s', 'q8s', 'q7s', 'q6s', 'q5s', 'q4s', 'q3s', 'q2s',
'ajo', 'kjo', 'qjo', 'jj', 'jts', 'j9s', 'j8s', 'j7s', 'j6s', 'j5s', 'j4s', 'j3s', 'j2s',
'ato', 'kto', 'qto', 'jto', 'tt', 't9s', 't8s', 't7s', 't6s', 't5s', 't4s', 't3s', 't2s',
'a9o', 'k9o', 'q9o', 'j9o', 't9o', '99', '98s', '97s', '96s', '95s', '94s', '93s', '92s',
'a8o', 'k8o', 'q8o', 'j8o', 't8o', '98o', '88', '87s', '86s', '85s', '84s', '83s', '82s',
'a7o', 'k7o', 'q7o', 'j7o', 't7o', '97o', '87o', '77', '76s', '75s', '74s', '73s', '72s',
'a6o', 'k6o', 'q6o', 'j6o', 't6o', '96o', '86o', '76o', '66', '65s', '64s', '63s', '62s',
'a5o', 'k5o', 'q5o', 'j5o', 't5o', '95o', '85o', '75o', '65o', '55', '54s', '53s', '52s',
'a4o', 'k4o', 'q4o', 'j4o', 't4o', '94o', '84o', '74o', '64o', '54o', '44', '43s', '42s',
'a3o', 'k3o', 'q3o', 'j3o', 't3o', '93o', '83o', '73o', '63o', '53o', '43o', '33', '32s',
'a2o', 'k2o', 'q2o', 'j2o', 't2o', '92o', '82o', '72o', '62o', '52o', '42o', '32o', '22',
],
}
},
chrome: {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true
}
},
firefox: {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true
}
}
}
}
And for Java/JDK:
code/premium-poker-tools-api [master] Β» java --version
java 9.0.4
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
When I look in my Java Control Panel, it says that I'm up to date.
I'm not sure how to figure out which Selenium version or Chrome version I'm using. For Chrome, if I open up Chrome and go to "About Google Chrome" it says 74.0.3729.169, the up to date one, and I assume my tests are using that same version.
This log message...
Starting selenium server... started - PID: 58502
and the subsequent error message...
Connection refused! Is selenium server started?
...implies that the WebDriver instance i.e. ChromeDriver though initiated but was unable to communicate with the WebBrowsing i.e. Chrome session.
Some more details about the:
Selenium version.
JDK version.
Selenium Server mode (Standalone/Grid).
ChromeDriver version.
Chrome version.
Would have helped us to debug the issue in a better way. However as you have mentioned "1, 2, and 3 get logged out, but not 4 or 5", possibly the issue stems out from the following code block:
equityCalculator
.waitForElementVisible('#app', 50000, function () {
console.log(4);
browser.resizeWindow(1440, 852, function () {
console.log(5);
done();
});
})
Reason
As per the discussion Connection refused! Is selenium server started nightwatch on edge your main issue seems to be incompatibility between the version of the binaries you are using.
Solution
Upgrade JDK to recent levels JDK 8u212.
Upgrade Selenium to current levels Version 3.141.59.
Upgrade ChromeDriver to ChromeDriver v74.0 level.
Upgrade Chrome version to Chrome v74 levels. (as per ChromeDriver v74.0 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test.
Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
Outro
'Connection refused! Is selenium server started?\n' while running Nightwatch.js tests against Selenium Grid
Resolution
updating npm resolved the issue (as per OP's comments)
npm update

loopback3 app continous integration tests do not exit

I am trying to deploy my loopback app with CI, and jest does not exit, and as a result CI cannot continue. Same thing happens on my locale if I stop the database container.My tests are not running against db, but I think when jest boots up the app, it tries to connect, and I tried to catch and close the connection but it did not help. Here is the output from jest tests.
Test Suites: 3 passed, 3 total
Tests: 13 passed, 13 total
Snapshots: 0 total
Time: 6.304s
Ran all test suites.
● Cannot log after tests are done. Did you forget to wait for something async in your test?
Attempted to log "Connection fails: Error: connect ECONNREFUSED 127.0.0.1:5432
It will be retried for the next request.".
at BufferedConsole.error (node_modules/jest-util/build/BufferedConsole.js:136:10)
at msg (node_modules/strong-globalize/lib/globalize.js:245:13)
at packMessage (node_modules/strong-globalize/lib/globalize.js:227:16)
at Object.rfc5424 (node_modules/strong-globalize/lib/globalize.js:242:12)
at StrongGlobalize.error (node_modules/strong-globalize/lib/strong-globalize.js:163:26)
at DataSource.postInit (node_modules/loopback-datasource-juggler/lib/datasource.js:479:13)
at PendingItem.callback (node_modules/loopback-connector-postgresql/lib/postgresql.js:103:17)
at client.connect (node_modules/pg-pool/index.js:248:23)
at Connection.connectingErrorHandler (node_modules/pg/lib/client.js:140:14)
error: uncaughtException: connect ECONNREFUSED 127.0.0.1:5432 date=Fri Feb 22 2019 20:54:31 GMT+0300 (+03), pid=86092, uid=501, gid=20, cwd=/Users/hazimdikenli/workspace/ATEZ-BTD/app, execPath=/Users/hazimdikenli/.nvm/versions/node/v8.11.3/bin/node, version=v8.11.3, argv=[/Users/hazimdikenli/.nvm/versions/node/v8.11.3/bin/node, /Users/hazimdikenli/workspace/ATEZ-BTD/app/node_modules/jest-worker/build/workers/processChild.js], rss=237056000, heapTotal=201125888, heapUsed=157644632, external=419986, loadavg=[3.91162109375, 3.453125, 3.39453125], uptime=3318870, trace=[column=11, file=util.js, function=Object._errnoException, line=992, method=_errnoException, native=false, column=20, file=util.js, function=_exceptionWithHostPort, line=1014, method=null, native=false, column=14, file=net.js, function=TCPConnectWrap.afterConnect [as oncomplete], line=1186, method=afterConnect [as oncomplete], native=false], stack=[Error: connect ECONNREFUSED 127.0.0.1:5432, at Object._errnoException (util.js:992:11), at _exceptionWithHostPort (util.js:1014:20), at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)]
● process.exit called with "1"
at gracefulExit (node_modules/winston/lib/winston/logger.js:660:15)
at done (node_modules/winston/node_modules/async/lib/async.js:167:19)
at node_modules/winston/node_modules/async/lib/async.js:40:16
at Object.<anonymous>.exports.Console.onComplete (node_modules/winston/lib/winston/transports/transport.js:128:7)
at Object.<anonymous>.exports.Console.Object.<anonymous>.Console.log (node_modules/winston/lib/winston/transports/console.js:128:8)
at Object.<anonymous>.exports.Console.Object.<anonymous>.Transport.logException (node_modules/winston/lib/winston/transports/transport.js:134:8)
at logAndWait (node_modules/winston/lib/winston/logger.js:649:15)
My tests are not running against db, but I think when jest boots up the app, it tries to connect, and I tried to catch and close the connection but it did not help. I think this is happening when the app boots up by jest.So how can I catch this, or make the jest exit with success.
Thanks in advance.
Try using "lazyConnect" to defer connection until its required
"postgres": {
"host": "/var/run/postgresql/",
"port": "5432",
"database": "dbname",
"username": "dbuser",
"password": "dbpassword",
"name": "postgres",
"connector": "postgresql",
"lazyConnect": true
}

npm err! fetch failed in jenkins?

Getting following errors in jenkins.. Any help
npm ERR! fetch failed https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.5.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 502
npm ERR! fetch failed https://registry.npmjs.org/uid-safe/-/uid-safe-1.0.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 502
something is up with the cdn hosting of version 1.0.5. You can force the dependency using cookie-signature to require 1.0.6. Express is dependent on this module and you would be able to resolve the issue like so:
"express": {
"version": "~4.9.0",
"from": "express#~4.9.0",
"dependencies": {
"cookie-signature": {
"version": "1.0.6",
"from": "cookie-signature#1.0.6"
}
}
},