Closed chriscuba23 closed 1 year ago
Just for clarification, does this work locally for you?
And, since nodejs stacks are generally unhelpful, how do you know that the error is coming from /upload
command?
Good morning! Yes it works locally (using Windows). I know that the error comes from the /upload command because I just skipped the test or commented the line that had the upload command and I did not get this failure as I describe above. Would a video of the actions and/or the log file of Bamboo be more helpful?
Could you please add verbose logging please, that will help a lot!
@AutomatedTester sadly you wont get any more info with that, but here it goes
build 02-Nov-2022 12:21:40 Running e2e tests on Selenium grid
build 02-Nov-2022 12:21:40 Launching up to 20 concurrent test worker processes...
build 02-Nov-2022 12:21:40
build 02-Nov-2022 12:21:41 Started child process for: Scenarios/par1.js
build 02-Nov-2022 12:21:41 Started child process for: Scenarios/par2.js
error 02-Nov-2022 12:21:43 → Error
error 02-Nov-2022 12:21:43
error 02-Nov-2022 12:21:43 uncaughtException: Unexpected token / in JSON at position 0
error 02-Nov-2022 12:21:43 SyntaxError: Unexpected token / in JSON at position 0
error 02-Nov-2022 12:21:43 at parse (<anonymous>)
error 02-Nov-2022 12:21:43 at parseChannelMessages (node:internal/child_process/serialization:120:15)
error 02-Nov-2022 12:21:43 at parseChannelMessages.next (<anonymous>)
error 02-Nov-2022 12:21:43 at Pipe.channel.onread (node:internal/child_process:609:18)
build 02-Nov-2022 12:21:43
build 02-Nov-2022 12:21:43 ───────────────────────────────────────────────────────────────────────────────────────────────────
build 02-Nov-2022 12:21:43
build 02-Nov-2022 12:21:43 TEST FAILURE (2.772s):
build 02-Nov-2022 12:21:43 - 1 error during execution;
build 02-Nov-2022 12:21:43 - 0 tests failed;
build 02-Nov-2022 12:21:43 - 0/NA tests passed
I can run the single file test if you want where I target the js file and not the folder that contains it though. Would running this with verbose be of any help?
Update
I have tried to reproduce the error on mac OS but not able to reproduce it. I have created a Github repo for test files. https://github.com/prudhvi22/nightwatch-bamboo-issue. I will try on CentOS Linux 7.
Output
build 08-Nov-2022 20:03:44 > nightwatch "--env" "selenium.chrome"
build 08-Nov-2022 20:03:44
build 08-Nov-2022 20:03:44 Running: selenium.chrome: par1.js
build 08-Nov-2022 20:03:44 Running: selenium.chrome: par2.js
build 08-Nov-2022 20:04:14
build 08-Nov-2022 20:04:14 ┌ ────────────────── ✔ selenium.chrome: par2.js ─────────────────────────────┐│ ││ selenium.chrome: par2.js ││ selenium.chrome: par2.js [Par2] Test Suite ││ selenium.chrome: par2.js ────────────────────────────────── ││ selenium.chrome: par2.js Using: chrome (103.0.5060.53) on MAC OS X. ││ selenium.chrome: par2.js – Navigate to MT ││ selenium.chrome: par2.js - Loading url: https://www.marinetraffic.com/ ││ selenium.chrome: par2.js ℹ Loaded url https://www.marinetraffic.com/ in ││ 1099ms ││ selenium.chrome: par2.js ✔ Element <.qc-cmp2-summary-buttons > ││ :nth-child(2)> was not present after 11 milliseconds. ││ selenium.chrome: par2.js ✔ selenium.chrome: par2.js [Par2] Navigate to ││ MT (4.025s) ││ selenium.chrome: par2.js ││ selenium.chrome: par2.js – User login ││ selenium.chrome: par2.js ✔ Element <#email> was visible after 533 ││ milliseconds. ││ selenium.chrome: par2.js ✔ Element <#password> was visible after 15 ││ milliseconds. ││ selenium.chrome: par2.js ✔ Element <#login_form_submit> was visible ││ after 12 milliseconds. ││ selenium.chrome: par2.js ✔ Element <button#user-logggin> was visible ││ after 2833 milliseconds. ││ selenium.chrome: par2.js ✔ selenium.chrome: par2.js [Par2] User login ││ (3.64s) ││ selenium.chrome: par2.js – Navigate to My Account > Photos Uploaded > ││ Upload a Photo ││ selenium.chrome: par2.js - Loading url: ││ https://www.marinetraffic.com/en/photos/upload ││ selenium.chrome: par2.js ℹ Loaded url ││ https://www.marinetraffic.com/en/photos/upload in 16837ms ││ selenium.chrome: par2.js ✔ Element <span.input-group-btn> was visible ││ after 15 milliseconds. ││ selenium.chrome: par2.js ✔ selenium.chrome: par2.js [Par2] Navigate to ││ My Account > Photos Uploaded > Upload a Photo (16.858s) ││ selenium.chrome: par2.js ││ selenium.chrome: par2.js – Upload a single photo ││ selenium.chrome: par2.js ✔ Element <.btn-file input[type="file"]> was ││ present after 7 milliseconds. ││ selenium.chrome: par2.js ✔ selenium.chrome: par2.js [Par2] Upload a ││ single photo (5.027s) ││ │└──────────────────────────────────────────────────────────────────────────────┘
build 08-Nov-2022 20:04:21
build 08-Nov-2022 20:04:21 ┌ ────────────────── ✔ selenium.chrome: par1.js ─────────────────────────────┐│ ││ selenium.chrome: par1.js [Par1] Test Suite ││ selenium.chrome: par1.js ────────────────────────────────── ││ selenium.chrome: par1.js Using: chrome (103.0.5060.53) on MAC OS X. ││ selenium.chrome: par1.js – Navigate to MT ││ selenium.chrome: par1.js - Loading url: https://www.marinetraffic.com/ ││ selenium.chrome: par1.js ℹ Loaded url https://www.marinetraffic.com/ in ││ 9536ms ││ selenium.chrome: par1.js ✔ Element <.qc-cmp2-summary-buttons > ││ :nth-child(2)> was not present after 4 milliseconds. ││ selenium.chrome: par1.js ✔ selenium.chrome: par1.js [Par1] Navigate to ││ MT (9.662s) ││ selenium.chrome: par1.js ││ selenium.chrome: par1.js – User login ││ selenium.chrome: par1.js ✔ Element <#email> was visible after 9173 ││ milliseconds. ││ selenium.chrome: par1.js ✔ Element <#password> was visible after 13 ││ milliseconds. ││ selenium.chrome: par1.js ✔ Element <#login_form_submit> was visible ││ after 11 milliseconds. ││ selenium.chrome: par1.js ✔ Element <button#user-logggin> was visible ││ after 2750 milliseconds. ││ selenium.chrome: par1.js ✔ selenium.chrome: par1.js [Par1] User login ││ (12.131s) ││ selenium.chrome: par1.js ││ selenium.chrome: par1.js – Navigate to My Account > Photos Uploaded > ││ Upload a Photo ││ selenium.chrome: par1.js - Loading url: ││ https://www.marinetraffic.com/en/photos/upload ││ selenium.chrome: par1.js ℹ Loaded url ││ https://www.marinetraffic.com/en/photos/upload in 10047ms ││ selenium.chrome: par1.js ✔ Element <span.input-group-btn> was visible ││ after 21 milliseconds. ││ selenium.chrome: par1.js ✔ selenium.chrome: par1.js [Par1] Navigate to ││ My Account > Photos Uploaded > Upload a Photo (10.076s) ││ selenium.chrome: par1.js – Upload a single photo ││ selenium.chrome: par1.js ✔ Element <.btn-file input[type="file"]> was ││ present after 7 milliseconds. ││ selenium.chrome: par1.js ✔ selenium.chrome: par1.js [Par1] Upload a ││ single photo (5.036s) ││ │└──────────────────────────────────────────────────────────────────────────────┘
build 08-Nov-2022 20:04:21
build 08-Nov-2022 20:04:21 ✨ PASSED. 14 total assertions (37.57s)
build 08-Nov-2022 20:04:22 Wrote HTML report file to: /Users/prudhvi/work/nightwatch-bamboo/local-working-dir/NIG-BAM-JOB1/reports/nightwatch-html-report/index.html
build 08-Nov-2022 20:04:22
simple 08-Nov-2022 20:04:22 Finished task 'test' with result: Success
simple 08-Nov-2022 20:04:22 Running post build plugin 'Artifact Copier'
simple 08-Nov-2022 20:04:22 Running post build plugin 'npm Cache Cleanup'
simple 08-Nov-2022 20:04:22 Running post build plugin 'NCover Results Collector'
simple 08-Nov-2022 20:04:22 Running post build plugin 'Build Results Label Collector'
simple 08-Nov-2022 20:04:22 Running post build plugin 'Clover Results Collector'
simple 08-Nov-2022 20:04:22 Running post build plugin 'Docker Container Cleanup'
simple 08-Nov-2022 20:04:22 Finalising the build...
simple 08-Nov-2022 20:04:22 Stopping timer.
simple 08-Nov-2022 20:04:22 Build NIG-BAM-JOB1-25 completed.
simple 08-Nov-2022 20:04:22 Running on server: post build plugin 'Build Hanging Detection Configuration'
simple 08-Nov-2022 20:04:22 Running on server: post build plugin 'NCover Results Collector'
simple 08-Nov-2022 20:04:22 Running on server: post build plugin 'Build Labeller'
simple 08-Nov-2022 20:04:22 Running on server: post build plugin 'Clover Delta Calculator'
simple 08-Nov-2022 20:04:22 Running on server: post build plugin 'Maven Dependencies Postprocessor'
simple 08-Nov-2022 20:04:22 All post build plugins have finished
simple 08-Nov-2022 20:04:22 Generating build results summary...
simple 08-Nov-2022 20:04:22 Saving build results to disk...
simple 08-Nov-2022 20:04:22 Store variable context...
simple 08-Nov-2022 20:04:22 Finished building NIG-BAM-JOB1-25.```
Hello @prudhvi22 and thank you for the response. What is your Selenium Grid configuration and what does your folder tree look like? Unfortunately I cannot view your folder in Github to check the repo for the test files
Hello @chriscuba23 and thank you for the response. The folder tree structure is :
/test/parallel/parallel1/par1.js /test/parallel/parallel1/par2.js
I am using the same nightwatch.conf.js
as provided.
Nightwatch.js Version 2.3.9
Node Version 16.13.2
Browser Chrome 103.0.5060.53
You can view folder structure here https://github.com/prudhvi22/nightwatch-bamboo-issue
thank you for the response @prudhvi22 let me try again then
Failed again.. Perhaps you should try reproducing it on the exact setup. Would you like to have a chat over at Discord?
@prudhvi22 found the culprit. It was the https://www.npmjs.com/package/downloads-folder package I guess it cannot sync with the new Nightwatch on *nix As an alternative whoever uses this package along with Nightwatch has to do it the hard way, which means to create a string of the path rather that expecting the package to find it for him
Thanks for helping find the issue. It looks like on *nix, you need to do special things according to that package anyway and we can't fix that. I am glad that you found a workaround. Closing this issue as there is nothing for us to action here.
thanx @AutomatedTester . Close it yes
@AutomatedTester fyi an update of the package did the trick
Description of the bug/issue
When I run a test folder on CI that has a test file that has the new uploadFile() function in it I expect the command to run with no errors. Instead at runtime I get the following error and test is being terminated
Steps to reproduce
Since its not a nightwatch code issue rather than integration with Bamboo CI I will add the appropriate code to run in a later step
But first you have to create this folder tree
/tests/parallel/parallel1/par1.js /tests/parallel/parallel1/par2.js
don't worry about the path below since the test fails way before that
Sample test
Command to run
Verbose Output
Nightwatch Configuration
Nightwatch.js Version
2.3.9
Node Version
16.13.2
Browser
Chrome 103.0.5060.53
Operating System
CentOS Linux 7
Additional Information
tests run on Selenium Grid with the same OS as above