Trying to use device farm for web app test automation in mobile devices. Source code tests are written in nightwatch.js.
Below are the nightwatch configuration :
{
custom_assertions_path: 'custom-assertions',
test_settings: {
default: {
selenium: {
start_process: false,
port: 4723,
host: "localhost",
silent: true,
},
android: {
desiredCapabilities = {
browserName: "Chrome",
platformName: "Android",
platformVersion: "7.0",
device: "Android",
deviceName: "Pixel 2",
avd: "Pixel_2_API_24",
}
}
}
Test are running fine locally using emulator
But in device farms getting following error. Nightwatch not able to connect to appium(ECONNREFUSED).
Starting automation...
Done processing feature files.
Done killing webdriver processes.
Running cucumber...
- [0;36mConnecting to localhost on port 4723...
[0m
[1;31m POST /wd/hub/session - ECONNREFUSED
Error: connect ECONNREFUSED 127.0.0.1:4723[0m
⚠ [0;31mError connecting to localhost on port 4723.[0m
VError: a BeforeAll hook errored on slave 0, process exiting: dist/src/cucumber.conf.js:64: An error occurred while retrieving a new session: "Connection refused to 127.0.0.1:4723". If the Webdriver/Selenium service is managed by Nightwatch, check if "start_process" is set to "true".
at _bluebird.default.each (/tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_module
Below are the test log in device farm.
[DEVICEFARM] Setting up your device. This usually takes 2-3 minutes.
[DEVICEFARM] ########### Start executing testspec ###########
[DEVICEFARM] ########### Entering phase install ###########
[DeviceFarm] echo "Navigate to test package directory"
Navigate to test package directory
[DeviceFarm] cd $DEVICEFARM_TEST_PACKAGE_PATH
[DeviceFarm] npm install *.tgz
npm WARN deprecated core-js#2.6.11: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
> core-js#2.6.11 postinstall /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
[96mThank you for using core-js ([94m https://github.com/zloirock/core-js [96m) for polyfilling JavaScript standard library![0m
[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: [0m
[96m>[94m https://opencollective.com/core-js [0m
[96m>[94m https://www.patreon.com/zloirock [0m
[96mAlso, the author of core-js ([94m https://github.com/zloirock [96m) is looking for a good job -)[0m
npm WARN saveError ENOENT: no such file or directory, open '/tmp/scratch9MGzGQ.scratch/test-package4sST7I/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/tmp/scratch9MGzGQ.scratch/test-package4sST7I/package.json'
npm WARN bitcentralqa-base-nightwatch-framework#0.1.6 requires a peer of cucumber#^6.0.5 but none is installed. You must install peer dependencies yourself.
npm WARN bitcentralqa-base-nightwatch-framework#0.1.6 requires a peer of nightwatch#^1.3.6 but none is installed. You must install peer dependencies yourself.
npm WARN bitcentralqa-base-nightwatch-framework#0.1.6 requires a peer of nightwatch-api#^3.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN bitcentralqa-base-nightwatch-framework#0.1.6 requires a peer of selenium-server#^3.141.59 but none is installed. You must install peer dependencies yourself.
npm WARN bitcentralqa-base-nightwatch-framework#0.1.6 requires a peer of selenium-server-standalone-jar#^3.141.59 but none is installed. You must install peer dependencies yourself.
npm WARN cucumber-pretty#6.0.0 requires a peer of cucumber#>=6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN test-package4sST7I No description
npm WARN test-package4sST7I No repository field.
npm WARN test-package4sST7I No README data
npm WARN test-package4sST7I No license field.
+ bitcentralqa-base-nightwatch-framework#0.1.6
added 127 packages from 111 contributors and audited 127 packages in 37.515s
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
[DeviceFarm] export APPIUM_VERSION=1.14.2
[DeviceFarm] avm $APPIUM_VERSION
/usr/bin/avm: line 261: appium: command not found
[36m exists[0m : [90m[0m
[DeviceFarm] ln -s /usr/local/avm/versions/$APPIUM_VERSION/node_modules/.bin/appium /usr/local/avm/versions/$APPIUM_VERSION/node_modules/appium/bin/appium.js
[DeviceFarm] if [ $(echo $APPIUM_VERSION | cut -d "." -f2) -ge 15 ]; then
DEVICEFARM_DEVICE_UDID_FOR_APPIUM=$(echo $DEVICEFARM_DEVICE_UDID | tr -d "-");
DEVICEFARM_WDA_DERIVED_DATA_PATH=$DEVICEFARM_WDA_DERIVED_DATA_PATH_V2;
else
DEVICEFARM_DEVICE_UDID_FOR_APPIUM=$DEVICEFARM_DEVICE_UDID;
DEVICEFARM_WDA_DERIVED_DATA_PATH=$DEVICEFARM_WDA_DERIVED_DATA_PATH_V1;
fi
[DEVICEFARM] ########### Entering phase pre_test ###########
[DeviceFarm] if [ $DEVICEFARM_DEVICE_PLATFORM_NAME = "Android" ]; then echo "Start appium server for android"; (appium --log-timestamp --default-capabilities "{\"deviceName\": \"$DEVICEFARM_DEVICE_NAME\", \"platformName\":\"$DEVICEFARM_DEVICE_PLATFORM_NAME\", \"app\":\"$DEVICEFARM_APP_PATH\", \"udid\":\"$DEVICEFARM_DEVICE_UDID\", \"platformVersion\":\"$DEVICEFARM_DEVICE_OS_VERSION\", \"browserName\":\"Chrome\", \"chromedriverExecutable\":\"$DEVICEFARM_CHROMEDRIVER_EXECUTABLE\"}" >> $DEVICEFARM_LOG_DIR/appiumlog.txt 2>&1 &); fi
Start appium server for android
[DeviceFarm] if [ $DEVICEFARM_DEVICE_PLATFORM_NAME = "iOS" ]; then echo "Start appium server for iOS"; (appium --log-timestamp --default-capabilities "{\"usePrebuiltWDA\": true, \"derivedDataPath\":\"$DEVICEFARM_WDA_DERIVED_DATA_PATH\", \"deviceName\": \"$DEVICEFARM_DEVICE_NAME\", \"platformName\":\"$DEVICEFARM_DEVICE_PLATFORM_NAME\", \"app\":\"$DEVICEFARM_APP_PATH\", \"automationName\":\"XCUITest\", \"udid\":\"$DEVICEFARM_DEVICE_UDID_FOR_APPIUM\", \"platformVersion\":\"$DEVICEFARM_DEVICE_OS_VERSION\", \"browserName\":\"Safari\"}" >> $DEVICEFARM_LOG_DIR/appiumlog.txt 2>&1 &); fi
[DeviceFarm] start_appium_timeout=0; while [ true ]; do
if [ $start_appium_timeout -gt 60 ];
then
echo "appium server never started in 60 seconds. Exiting";
exit 1;
fi;
grep -i "Appium REST http interface listener started on 0.0.0.0:4723" $DEVICEFARM_LOG_DIR/appiumlog.txt >> /dev/null 2>&1;
if [ $? -eq 0 ];
then
echo "Appium REST http interface listener started on 0.0.0.0:4723";
break;
else
echo "Waiting for appium server to start. Sleeping for 1 second";
sleep 1;
start_appium_timeout=$((start_appium_timeout+1));
fi;
done;
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Appium REST http interface listener started on 0.0.0.0:4723
[DEVICEFARM] ########### Entering phase test ###########
[DeviceFarm] echo "Navigate to test source code"
Navigate to test source code
[DeviceFarm] cd $DEVICEFARM_TEST_PACKAGE_PATH/node_modules/bitcentralqa-base-nightwatch-framework
[DeviceFarm] echo "Start Appium Node test"
Start Appium Node test
[DeviceFarm] npm install && npm run e2e-build-test -- --env chrome_android_qa --tags accessFuelVideoTesterWebpagePass
> chromedriver#83.0.0 install /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/chromedriver
> node install.js
(node:4046) ExperimentalWarning: The fs.promises API is experimental
Current existing ChromeDriver binary is unavailable, proceeding with download and extraction.
Downloading from file: https://chromedriver.storage.googleapis.com/83.0.4103.39/chromedriver_linux64.zip
Saving to file: /tmp/83.0.4103.39/chromedriver/chromedriver_linux64.zip
Received 1040K...
Received 2080K...
Received 3120K...
Received 4160K...
Received 5099K total.
Extracting zip contents to /tmp/83.0.4103.39/chromedriver.
Copying to target path /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/chromedriver/lib/chromedriver
Fixing file permissions.
Done. ChromeDriver binary available at /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/chromedriver/lib/chromedriver/chromedriver
> edgedriver#4.17134.1 install /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/edgedriver
> node install.js
downloadUrl:
invalid config loglevel="notice"
NOTE: Cannot find Microsoft WebDriver for the current OS: linux x64 3.13.0-139-generic
> iedriver#3.14.2 install /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/iedriver
> node install.js
Downloading 64 bit Windows IE driver server
-----
invalid config loglevel="notice"
Downloading https://selenium-release.storage.googleapis.com/3.14/IEDriverServer_x64_3.14.0.zip
tmp/iedriver64/IEDriverServer_x64_3.14.0.zip extracted to tmp/iedriver64
copying tmp/iedriver64 to /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/iedriver/lib/iedriver64
Success! IEDriverServer binary available at /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/iedriver/lib/iedriver64\IEDriverServer.exe
Downloading 32 bit Windows IE driver server
-----
Downloading https://selenium-release.storage.googleapis.com/3.14/IEDriverServer_Win32_3.14.0.zip
tmp/iedriver/IEDriverServer_Win32_3.14.0.zip extracted to tmp/iedriver
copying tmp/iedriver to /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/iedriver/lib/iedriver
Success! IEDriverServer binary available at /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/iedriver/lib/iedriver\IEDriverServer.exe
> core-js#2.6.11 postinstall /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js-pure#3.6.5 postinstall /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
> ejs#2.7.4 postinstall /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/ejs
> node ./postinstall.js
Thank you for installing [35mEJS[0m: built with the [32mJake[0m JavaScript build tool ([32mhttps://jakejs.com/[0m)
> geckodriver#1.19.1 postinstall /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/geckodriver
> node index.js
Downloading geckodriver... Extracting... Complete.
added 526 packages from 996 contributors and audited 528 packages in 91.837s
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
> bitcentralqa-base-nightwatch-framework#0.1.6 e2e-build-test /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework
> npm run clean && npm run build && npm run e2e-test -- "--env" "chrome_android_qa" "--tags" "accessFuelVideoTesterWebpagePass"
> bitcentralqa-base-nightwatch-framework#0.1.6 clean /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework
> rimraf dist/**/*
> bitcentralqa-base-nightwatch-framework#0.1.6 build /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework
> tsc --build ./tsconfig.json
> bitcentralqa-base-nightwatch-framework#0.1.6 e2e-test /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework
> node dist/index.js "--env" "chrome_android_qa" "--tags" "accessFuelVideoTesterWebpagePass"
Starting automation...
Done processing feature files.
Done killing webdriver processes.
Running cucumber...
- [0;36mConnecting to localhost on port 4723...
[0m
[1;31m POST /wd/hub/session - ECONNREFUSED
Error: connect ECONNREFUSED 127.0.0.1:4723[0m
⚠ [0;31mError connecting to localhost on port 4723.[0m
VError: a BeforeAll hook errored on slave 0, process exiting: dist/src/cucumber.conf.js:64: An error occurred while retrieving a new session: "Connection refused to 127.0.0.1:4723". If the Webdriver/Selenium service is managed by Nightwatch, check if "start_process" is set to "true".
at _bluebird.default.each (/tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/cucumber/lib/runtime/parallel/slave.js:143:49)
caused by: Error: An error occurred while retrieving a new session: "Connection refused to 127.0.0.1:4723". If the Webdriver/Selenium service is managed by Nightwatch, check if "start_process" is set to "true".
at Selenium2Protocol.handleSessionCreateError (/tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/nightwatch/lib/transport/transport.js:103:15)
at HttpRequest.request.on.err (/tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/nightwatch/lib/transport/transport.js:158:32)
at HttpRequest.emit (events.js:189:13)
at ClientRequest.originalIssuer.on.args (/tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/node_modules/nightwatch/lib/http/request.js:131:19)
at ClientRequest.emit (events.js:194:15)
at Socket.socketErrorListener (_http_client.js:399:9)
at Socket.emit (events.js:189:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process.internalTickCallback (internal/process/next_tick.js:72:19)
0 scenarios
0 steps
0m00.000s
Done running cucumber...
Done killing webdriver processes.
Cucumber HTML report /tmp/scratch9MGzGQ.scratch/test-package4sST7I/node_modules/bitcentralqa-base-nightwatch-framework/dist/reports/cucumber-chrome_android_qa-report.html generated successfully.
Finished running automation.
[DEVICEFARM] ########### Entering phase post_test ###########
[DEVICEFARM] ########### Finish executing testspec ###########
[DEVICEFARM] ########### Setting upload permissions ###########
[DEVICEFARM] Tearing down your device. Your tests report will come shortly.
Is there any missing config for nightwatch and device farm
Can you try re-running it with start_process: True and verify if port wasn't already in use.
Issue was due to piece of code killing chrome webdriver processes before start of a test run.The killing of webdrivers do not cause any problem locally with emulator , so while running tests in device farm killing of webdriver processes had to be disabled.
I have tried to make desktop exe for window using electron. I have run below command to generate sign version of exe:
electron-windows-store --input-directory .\\desktop\\dist\\win-unpacked --output-directory .\\desktop\\store --flatten true -a .\\resources\\desktop -m .\\desktop\\assets\\windows\\AppXManifest.xml --package-version 0.0.0.1 --package-name MoodleDesktop
But it give me below error:
> moodledesktop#3.5.1 windows.store D:\wamp64\www\moodle-desktop
> electron-windows-store --input-directory .\desktop\dist\win-unpacked --output-directory .\desktop\store --flatten true -a .\resources\desktop -m .\desktop\assets\windows\AppXManifest.xml --package-version 0.0.0.1 --package-name MoodleDesktop
You need at least Node 4.x to run this script
error: unknown option `--flatten'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! moodledesktop#3.5.1 windows.store: `electron-windows-store --input-directory .\desktop\dist\win-unpacked --output-directory .\desktop\store --flatten true -a .\resources\desktop -m .\desktop\assets\windows\AppXManifest.xml --package-version 0.0.0.1 --package-name VedificDesktop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the moodledesktop#3.5.1 windows.store 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\prawez.musharraf\AppData\Roaming\npm-cache\_logs\2019-02-12T09_50_34_214Z-debug.log
How we resolve this error??
Any help really appriciated.
as from sep 2018 the option flatten been removed
https://github.com/felixrieseberg/electron-windows-store/commit/dcc654df2ec2bb706dc4f1664aa4775ab320541e
that mean just remove it from the command and everything going to be okay!
Command line arguments than I used for ios-deploy.
sudo npm install -g ios-deploy --unsafe-perm --allow-root
Expected behavior
Install ios-deploy global via NPM
Actual behavior.
Ios-deploy not installed and get the error 65:
/bin/sh -c /usr/local/lib/node_modules/ios-deploy/build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D981F59D20100F954DB.sh
cp: /System/Library/PrivateFrameworks/MobileDevice.framework/XPCServices: No such file or directory
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script build/ios-deploy.build/Release/ios-deploy.build/Script-C0CD3D981F59D20100F954DB.sh
(1 failure)
npm ERR! code ELIFECYCLE
npm ERR! errno 65
npm ERR! ios-deploy#1.9.2 preinstall: ./src/scripts/check_reqs.js && xcodebuild
npm ERR! Exit status 65
npm ERR!
npm ERR! Failed at the ios-deploy#1.9.2 preinstall 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/vinicius/.npm/_logs/2018-06-20T10_50_13_426Z-debug.log
Steps to reproduce the problem
I run the command: npm install -g ios-deploy
System Specs
system_profiler SPSoftwareDataType
System Version: macOS 10.13.5 (17F77)
Kernel Version: Darwin 17.6.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Computer Name: Mac mini de Vinicius
User Name: Vinicius Ribeiro (vinicius)
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 36 minutes
ios-deploy -V
-bash: ios-deploy: command not found
3. xcodebuild -version
Xcode 9.4.1
Build version 9F2000
4. xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
lldb --version
lldb-902.0.79.7
Swift-4.1
Removed XPCServices file, and the install worked;
https://github.com/ios-control/ios-deploy/issues/346
I know very little about npm install, but I have found that when blocked from an installation on High Sierra, such as when updating ruby gems, a simple solution is to turn off SIP temporarily.
Introduction
I trying to run rails-react-boilerplate, everything goes fine, but at the end of installation (bundle install, yarn install, rake db:create ..), command with webpack simple not working. There is a link on github repository: rails-react-boilerplate.
Error
After this command npm run webpack I get this error:
openssl config failed: error:02001003:system library:fopen:No such process
> rails-react-boilerplate#1.0.0 webpack D:\code\portfolio\liftProgress
> ./node_modules/webpack/bin/webpack.js --progress --colors
'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rails-react-boilerplate#1.0.0 webpack:
`./node_modules/webpack/bin/webp
ack.js --progress --colors`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rails-react-boilerplate#1.0.0 webpack 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\Derid\AppData\Roaming\npm-cache\_logs\2017-12-
30T07_27_37_
058Z-debug.log
openssl config failed: error:02001003:system library:fopen:No such process
where I think main problem is:
'.' is not recognized as an internal or external command,
operable program or batch file.
.. but I am at one's wits' end .. very thanks for your guidance and help!:)
This is a Windows issue, you can try omitting the ./ from the actual command on the package.json file.
Actually after doing some research, including the node executable should work cross-platform:
"webpack": "node node_modules/webpack/bin/webpack.js --progress --colors",
During npm install the following error occurs during the install. The file is located in the npm virtual repo and the npm-local repo. Both files have the same checksum, but for reasons unknown Jenkins/Artifactory build returns with an expected valued different than what is actual.
Workspace, temp dir and cache for node_modules cleaned and error remains. What would cause the variance in returned shasum/chksum values?
npm ERR! shasum check failed for /var/folders/zd/d9z45rkj01ddtxxzw_2kzbvnxnn7wh/T/npm-90754-e7f5acef/artifactory.be.sharecare.com/api/npm/npm-repo/foreachasync/-/foreachasync-3.0.0.tgz
npm ERR! Expected: 5502987dc8714be3392097f32e0071c9dee07cf6
npm ERR! Actual: 3475a95a77e4dc2d2800913e6824de77b00cd80a
npm ERR! From: