Cypress failed to make a connection to the Edge/Firefox in Jenkins - jenkins

I created some VueJS test and run with Cypress.
Everything is OK until I run it on Jenkins (with a GitHub hook trigger for GITScm polling)
Only cypress run --browser chrome and cypress run --browser electron work.
With Edge and Firefox, it returned this kind of error
Still waiting to connect to Edge, retrying in 1 second (attempt 62/62)
Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds.
This usually indicates there was a problem opening the Edge browser.
The CDP port requested was 63444.
Error: connect ECONNREFUSED 127.0.0.1:63444
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16)
Error: Command failed with exit code 1: npm run cypress:run
at makeError (C:\ProgramData\Jenkins\.jenkins\workspace\Homepage\node_modules\start-server-and-test\node_modules\execa\lib\error.js:60:11)
at handlePromise (C:\ProgramData\Jenkins\.jenkins\workspace\Homepage\node_modules\start-server-and-test\node_modules\execa\index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
shortMessage: 'Command failed with exit code 1: npm run cypress:run',
command: 'npm run cypress:run',
escapedCommand: '"npm run cypress:run"',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
How can I run it normally in Jenkins? Thanks in advance.

Related

iOS script is not running on Appium

When I'm trying to run iOS scripts the Appium server is running but just shows listener started on 0.0.0.0:4723. I don't know where the error is ?
Appium: Server is not running
AlexHacki- Downloads % appium --base-path /wd/hub
[Appium] Welcome to Appium v1.23.0
[Appium] Appium REST http interface listener started on 0.0.0.0:4723.
Capabilities for iOS
capabilities: {
platformName: 'iOS',
deviceName: 'iPhone',
app: '/Users/Documents/iOSTest.ipa',
automationName: 'XCUITest',
platformVersion: '15.4',
noReset: true,
formFactor: 'MOBILE'
},
Error: After running the script
022-06-09T07:00:00.296Z INFO #wdio/local-runner: Run worker command: run
2022-06-09T07:00:00.607Z DEBUG #wdio/config:utils: Found 'ts-node' package, auto-compiling TypeScript files
2022-06-09T07:00:00.979Z DEBUG #wdio/local-runner:utils: init multiremote session
2022-06-09T07:00:00.984Z ERROR #wdio/runner: Error: Required option "capabilities" is missing
at validateConfig (/Users/alex/Documents//__tests__/appium/node_modules/#wdio/config/build/utils.js:53:19)
at remote (/Users/alex/Documents/node_modules/webdriverio/build/index.js:58:48)
at /Users/alex/Documents/webdriverio/build/index.js:139:51
at Array.map (<anonymous>)
at multiremote (/Users/alex/Documents/node_modules//webdriverio/build/index.js:138:36)
at initialiseInstance (/Users/alex/Documents/node_modules/#wdio/runner/build/utils.js:73:57)
at Runner._startSession (/Users/alex/Documents/appium/node_modules/#wdio/runner/build/index.js:223:93)
at Runner._initSession (/Users/alex/Documents/appium/node_modules/#wdio/runner/build/index.js:176:36)
at Runner.run (/Users/alex/Documents/appium/node_modules/#wdio/runner/build/index.js:88:30)
2022-06-09T07:00:13.403Z DEBUG #wdio/local-runner: Runner 0-0 finished with exit code 1
[ FAILED in /Users/alex/Documents/iOSTest.ipa - /test/specs/smoke/guide.test.js
2022-06-09T07:00:13.403Z INFO #wdio/cli:launcher: Run onWorkerEnd hook
2022-06-09T07:00:13.404Z DEBUG #wdio/cli:utils: Finished to run "onWorkerEnd" hook in 0ms
2022-06-09T07:00:13.404Z INFO #wdio/cli:launcher: Run onComplete hook
Can't generate report portal launch url
Error: Request failed with status code 401:
at /Users/alex/Documents/appium/node_modules/reportportal-js-client/lib/rest.js:33:23
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Function.getLaunchUrlByParams (/Users/alex/Documents/appium/node_modules/wdio-reportportal-service/src/index.js:108:20)
at async Function.getLaunchUrl (/Users/alex/Documents/node_modules/wdio-reportportal-service/src/index.js:92:12)
at async Object.onComplete (/Users/alex/Documents/appium/conf/shared.conf.js:60:18)
at async /Users/alex/Documents/node_modules/#wdio/cli/build/utils.js:96:13
at async Promise.all (index 0)
at async Launcher.run (/Users/alex/Documents/__tests__/appium/node_modules/#wdio/cli/build/launcher.js:96:39)
Report portal link undefined
at /Users/alex/Documents/__tests__/appium/node_modules/reportportal-js-client/lib/rest.js:33:23
at processTicksAndRejections (internal/process/task_queues.js:95:5)
Error: Request failed with status code 401:
at /Users/alex/Documents/node_modules/reportportal-js-client/lib/rest.js:33:23
at processTicksAndRejections (internal/process/task_queues.js:95:5)
2022-06-09T07:00:14.462Z DEBUG #wdio/cli:utils: Finished to run "onComplete" hook in 603ms

The request to open "com.XX.XX" failed The request was denied by service delegate only while using detox

Detox versions tried : 11.0.0, 12.0.0 & 14.5.1
The app runs fine when we run it via Xcode. The Detox build command succeeds as well.
But when I start running detox tests I will get the following error
"/bin/cat /dev/null >/Users/mmoha070/Library/Developer/CoreSimulator/Devices/AC24D39E-8290-4314-90F6-685007DBACA8/data/tmp/detox.last_launch_app_log.out 2>/Users/mmoha070/Library/Developer/CoreSimulator/Devices/AC24D39E-8290-4314-90F6-685007DBACA8/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/mmoha070/Library/Detox/ios/34981937206ec401dcf4fd6235cf1a8a3f71e719/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err AC24D39E-8290-4314-90F6-685007DBACA8 com.7ElevenNow.qa.PhoenixiOS --args -detoxServer ws://localhost:53701 -detoxSessionId 34083615-b6f2-86ea-3b33-84b27024f951" failed with code = 1, stdout and stderr:
detox[75658] ERROR: [exec.js/EXEC_FAIL, #6] com.7ElevenNow.qa.PhoenixiOS: -1
detox[75658] ERROR: [exec.js/EXEC_FAIL, #6] An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):
The request to open "com.7ElevenNow.qa.PhoenixiOS" failed.
The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified.
Underlying error (domain=FBSOpenApplicationErrorDomain, code=1):
The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 1.)

Failed to execute fabric8 docker plugin

Running mvn clean install pulls up this error( Windows)
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.20.1:start (prepare-environment) on project integration-test: Execution prepare-environment of goal io.fabric8:docker-maven-plugin:0.20.1:start failed: Start-Job failed with unexpected exception: [sebp/elk:latest] "elk": Timeout after 120365 ms while waiting on url http://localhost:32774/

Jenkins job throws error when running protractor

Get the following error when protractor is about to run on a windows host via jenkins job. We run selenium hub on a linux host with the selenium node running off of windows
^
`Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (C:\dependencies-dashboard\node_modules\selenium-webdriver\http\index.js:172:16)
at ClientRequest.emit (events.js:107:17)
at Socket.socketErrorListener (_http_client.js:271:9)
at Socket.emit (events.js:107:17)
at net.js:459:14
at process._tickCallback (node.js:355:11)
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (C:\dependencies-dashboard\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (C:\dependencies-dashboard\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:131:30)
at new Driver (C:\dependencies-dashboard\node_modules\selenium-webdriver\chrome.js:810:36)
at [object Object].DirectDriverProvider.getNewDriver (C:\dependencies-dashboard\node_modules\protractor\lib\driverProviders\direct.js:68:16)
at [object Object].Runner.createBrowser (C:\dependencies-dashboard\node_modules\protractor\lib\runner.js:182:37)
at C:\dependencies-dashboard\node_modules\protractor\lib\runner.js:263:21
at _fulfilled (C:\dependencies-dashboard\node_modules\protractor\node_modules\q\q.js:797:54)
at self.promiseDispatch.done (C:\dependencies-dashboard\node_modules\protractor\node_modules\q\q.js:826:30)
at Promise.promise.promiseDispatch (C:\dependencies-dashboard\node_modules\protractor\node_modules\q\q.js:759:13)
at C:\dependencies-dashboard\node_modules\protractor\node_modules\q\q.js:525:49
[launcher] Process exited with error code 1
events.js:85
throw er; // Unhandled 'error' event
^
Error: protractor exited with code 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE`

jhipster - error executing task :bower

I am having an issue building my app based off jhipster, using gradle. It fails on task :bower. The exact error I get is:
./gradlew bower --debug
20:23:46.154 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':bower'.
20:23:46.174 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'node''. Working directory: /workplace/zupus Command: node /workplace/zupus/node_modules/bower/bin/bower install
20:23:46.174 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Environment for process 'command 'node'': {PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/jav a-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin, CMD_DURATION=7.19s, XAUTHORITY=/home/brendan/.Xauthority, __fish_help_dir=/usr/share/doc/fish, XMODIFIERS=#im=i bus, XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/, GDMSESSION=ubuntu, MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path, TEXTDOMAINDIR=/usr/share/locale/, GTK _IM_MODULE=ibus, DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-2jqL9U4Ofh, DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path, XDG_CURRENT_DESKTOP=Unity, SSH_AGENT_PID=2238, COLORTERM=gn ome-terminal, QT4_IM_MODULE=xim, UPSTART_SESSION=unix:abstract=/com/ubuntu/ups tart- session/1000/2169, SESSION_MANAGER=local/brendan-home:#/tmp/.ICE-unix/2337,unix/brendan-home:/tmp/.ICE-unix/233 7, LOGNAME=brendan, JOB=dbus, PWD=/workplace/zupus, IM_CONFIG_PHASE=1, DERBY_HOME=/usr/lib/jvm/java-8-oracle/db, LANGUAGE=en_US, WINDOWID=75497483, SHELL=/usr/bin/fish, __fish_bin_di r=/usr/bin, INSTANCE=, J2SDKDIR=/usr/lib/jvm/java-8-oracle, OLDPWD=/wor kplace/zupus, GNOME_DESKTOP_SESSION_ID=this-is-deprecated, J2REDIR=/usr/lib/jvm/java-8-oracle/jre, GTK_MODULES=overlay-scroll bar:unity-gtk-module, CLUTTER_IM_MODULE=xim, TEXTDOMAIN=im-config, XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0, COMPIZ_BIN_PATH=/usr/bin/, SESSIONTYPE=gnome-session , LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41: sg =30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*. taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;3 1: *.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*. deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpi o= 01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm= 01;35:*. pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.sv gz =01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.m kv=01;35:* .webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.a sf =01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl =01;35:*. dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx= 01 ;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3= 00;36:*. mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:, SSH_AGENT_LAUNC HE R=upstart, SHLVL=1, __fish_sysconfdir=/etc/fish, COMPIZ_CONFIG_PROFILE=ubuntu, QT_IM_MODULE=ibus, JAVA_HOME=/usr/lib/jvm/java-8-oracle, TERM=xterm, XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt , XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg, LANG=en_US .UTF-8, XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0, GNOME_KEYRING_CONTROL=/run/user/1000/keyring-k4czcd, XDG_S ES SION_ID=c2, SELINUX_INIT=YES, DISPLAY=:0, NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript, GDM_LANG=en_US, UBUNTU_MENUPROXY=1, XDG_ GR EETER_DATA_DIR=/var/lib/lightdm-data/brend an, DESKTOP_SESSION=ubuntu, GPG_AGENT_INFO=/run/user/1000/keyring-k4czcd/gpg:0:1, SESSION=ubuntu, USER=brendan, XDG_MENU_PREFIX=gnome-, VTE _V ERSION=3409, XDG_SEAT=seat0, SSH_AUTH_SOCK =/run/user/1000/keyring-k4czcd/ssh, NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat, QT_QPA_PLATFORMTHEME=appmenu-qt5, XDG_RUNTIME_DIR=/run/user/1000, XDG_VT NR =7, HOME=/home/brendan, __fish_datadir=/us r/share/fish, GNOME_KEYRING_PID=2165 }
20:23:46.175 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
20:23:46.175 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process start ed: command 'node'.
20:23:46.179 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
20:23:46.179 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are h a ndled...
20:23:46.179 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started proces s 'command 'node''
20:23:46.187 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
20:23:46.188 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command 'node'' fi nished with exit value 1 (state: FAILED)
20:23:46.188 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] F in ished executing task ':bower'
20:23:46.188 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :bower FAILED
20:23:46.189 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :bower (Thread[mai n,5,main]) completed. Took 0.036 secs.
20:23:46.189 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor ] Task worker [Thre ad[main,5,main]] finished, busy: 0.899 secs, idle: 0.001 secs
20:23:46.194 [ERROR] [org.gradle.BuildExceptionReporter]
20:23:46.194 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception .
20:23:46.194 [ERROR] [org.gradle.BuildExceptionReporter]
20:23:46.194 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
20:23:46.194 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':bower'.
20:23:46.195 [ERROR] [org.gradle.BuildExceptionReporter] > Process 'command 'node'' finished wit h non-zero exit value 1
20:23:46.195 [ERROR] [org.gradle.BuildExceptionReporter]
20:23:46.195 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
20:23:46.195 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
20:23:46.195 [LIFECYCLE] [org.gradle.BuildResultLogger]
20:23:46.196 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
20:23:46.196 [LIFECYCLE] [org.gradle.BuildResultLogger]
20:23:46.197 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 3.275 secs
I have a feeling it has to do with global vs local npm installs, but I'm scratching my head about how to fix it or even find the error. I'm hoping someone else can save me from more hours of frustration.
Thanks
Fixed this eventually, if anyone else stumbles across this the answer was that I had to uninstall node (i.e. sudo apt-get remove node) and leave nodejs in place. You should see this:
user#user /w/zupus> which node
/usr/bin/node
user#user /w/zupus> which nodejs
/usr/bin/nodejs
This is my quick and dirty fix on Mac OS:
I just ran npm install bower as sudo
sudo npm install -g bower
I used windows 7 and got this error. I was able to fix this issue by installing Git. Make sure that you close the current command prompt window and try again.
just do npm install bower in project root directory where bower.json file should present.

Resources