Webdriver IO face with spec node found error above Node.js version 14 - webdriver-io

Description:
I can't trigger webdriver io test feature under node.js 16.
I have tried 14.20.0 worked for me, but face with element locating issue.
With node version below, all same issue happened:
v16.16.0
v18.12.1
v18.13.0
v19.4.0
And most unbelievable is that, same code code with same node and npm version on windows machine, all works good and pass.
I'm very confused about if the webdriver io is not supported on Mac or not.
Env:
1.Mac OS 12.6.2 (21G320)
2.Node version v16.16.0
3.Npm version 9.4.0
Error Log:
automationtests#1.0.0 Test
npx wdio run wdio.conf.ts
Execution of 0 workers started at 2023-02-07T05:43:36.724Z
Starting Cucumber Test
2023-02-07T05:43:38.278Z ERROR #wdio/cli:launcher: No specs found to run, exiting with failure
2023-02-07T05:43:38.332Z ERROR #wdio/cli:utils: Error in onCompleteHook: Error: There were issues reading JSON-files from '.tmp/json'.
at collectJSONS (/Users/jjiang310/IdeaProjects/fc-ui-test-automation/node_modules/multiple-cucumber-html-reporter/lib/collect-jsons.js:27:15)
at Object.generateReport [as generate] (/Users/jjiang310/IdeaProjects/fc-ui-test-automation/node_modules/multiple-cucumber-html-reporter/lib/generate-report.js:79:23)
at Object.onComplete (/Users/jjiang310/IdeaProjects/fc-ui-test-automation/wdio.conf.ts:407:38)
at /Users/jjiang310/IdeaProjects/fc-ui-test-automation/node_modules/#wdio/cli/build/utils.js:99:19
at Array.map ()
at runOnCompleteHook (/Users/jjiang310/IdeaProjects/fc-ui-test-automation/node_modules/#wdio/cli/build/utils.js:97:39)
at Launcher.run (/Users/jjiang310/IdeaProjects/fc-ui-test-automation/node_modules/#wdio/cli/build/launcher.js:96:75)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Spec Files: 0 passed, 0 total (0% completed) in 00:00:01
I have tried different node version, and test the same code with same node and npm version run on Windows machine can all pass which can make sure there is no code level problem to make the test case failed.
I expected the code can run and pass on Mac machine same as the windows.

Related

Unable to build app for production using Vue-tour library

We are not able to build the app into production. While we run npm run build we get an error, "expected and declaration or statement expected in a jsx file".
Steps to Reproduce:
Install v-tour and setup all tours for testing in local.
run npm run build
check the console for error
Expected behavior:
The app has to properly be built for production without any errors
Desktop (please complete the following information):
OS: Windows 11
Browser : Chrome
Version : 105.0.5195.127
Vue : #vue/cli 4.4.6
Node : 14.19.0
ScreenShots:
I've added an issue in v-tour's github repo

WebdriverIO SevereServiceErrror not stopping the test run

I have setup a custom wdio service (as per the documentation) which is used to create a build for the Angles automation dashboard.
As part of this service I want to use the SevereServiceError when it is unable to create the build and stop the run. However in my example test it throws the error and simply continues the test run. See logs here:
2022-03-05T07:28:36.936Z INFO #wdio/cli:launcher: Run onPrepare hook
2022-03-05T07:28:36.936Z INFO chromedriver: Start Chromedriver (/git/angles/webdriverio-example/node_modules/chromedriver/lib/chromedriver/chromedriver) with args --port=9515 --url-base=/
2022-03-05T07:28:36.982Z ERROR #wdio/cli:utils: A service failed in the 'onPrepare' hook
SevereServiceError: Unable to create a build due to connect ECONNREFUSED 127.0.0.1:3000.
at /Users/sergios/Documents/git/angles/webdriverio-example/node_modules/angles-wdio-reporter/src/integrations/wdio/AnglesWDIOService.ts:57:15
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async /Users/sergios/Documents/git/angles/webdriverio-example/node_modules/#wdio/cli/build/utils.js:28:17
at async Promise.all (index 1)
at async Launcher.run (/Users/sergios/Documents/git/angles/webdriverio-example/node_modules/#wdio/cli/build/launcher.js:86:13)
Continue...
2022-03-05T07:28:36.985Z INFO chromedriver: Starting ChromeDriver 98.0.4758.102 (273bf7ac8c909cde36982d27f66f3c70846a3718-refs/branch-heads/4758#{#1151}) on port 9515
2022-03-05T07:28:36.987Z INFO chromedriver: Only local connections are allowed.
You can run the example yourself by cloning the example repo and running npm run test.
NOTE: This should fail because it's looking for a local instance of the Angles dashboard.
Any ideas why the SevereServiceError isn't stopping the test run?
By updating wdio dependencies and ts-node and typescript to current versions this issue has been resolved. The test run now stops when the SeverServiceError is thrown.

Failure during cypress open after cypress v8.4.0 upgrade

I'm trying to use cypress 8.4.0. Used 'npm install cypress --save-dev' to install it. However, after installation, running any command
npx cypress open/ run end up with error.
It looks like this is your first time using Cypress: 8.4.0
Cypress failed to start.
This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies
Please refer to the error below for more details.
----------
Command failed with exit code 2147483651: C:\Users\NEX20UR\AppData\Local\Cypress\Cache\8.4.0\Cypress\Cypress.exe --smoke-test --ping=672
----------
When I run 'npx cypress verify', I got below error:
Cypress verification timed out.
This command failed with the following output:
C:\Users\NEX20UR\AppData\Local\Cypress\Cache\8.4.0\Cypress\Cypress.exe --smoke-test --ping=466
----------
Command timed out after 30000 milliseconds: C:\Users\NEX20UR\AppData\Local\Cypress\Cache\8.4.0\Cypress\Cypress.exe --smoke-test --ping=466
Timed out
more details:
Cypress package version: 8.4.0
Cypress binary version: 8.4.0
Electron version: 13.2.0
Bundled Node version:
14.16.0
PS: I uninstalled and installed many times.
Remove cache from location mentioned below:
C:\Users\username\AppData\Local\Cypress
then reinstall cypress
npm install --save-dev cypress#8.4.0 -force,

Protractor installed in offline mode - error for webdriver-manager start - what am I doing wrong

I need to install and use Protractor / Selenium on the machine without Internet access.
To do that, I've tried to download all needed files and copy them to the destination machine.
On my machine (with Internet access)
I installed Protractor and Selenium webdriver with the following command:
npm install -g protractor
webdriver-manager update
On destination machine (without Internet access)
I copied all files from the location returned by npm config get prefix to the computer without Internet access.
Then I executed following command on the machine without Internet access:
npm --cache-min 9999999 install -g protractor
which seems to succeed.
However, when I try to execute webdriver-manager start command, I receive following error message:
events.js:183
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND chromedriver.storage.googleapis.com
chromedriver.storage.googleapis.com:443
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
I receive the same error when executing webdriver-manager update (as in this case: webdriver-manager start: Error: connect ETIMEDOUT)
Question
What am I doing wrong? How should I properly setup Protractor and webdriver on the machine without Internet access?
Because webdriver-manager start will look up the latest version number of selenium-server.jar and webdriver binaries through internet no matter they are already exists on local.
But webdriver-manager not supply cmd option to disable the looking up.
The quick way is to run the java cmd behind webdriver-manager start directly to skip the looking up.
java
-Dwebdriver.chrome.driver=C:\Tools\npm-global\node_modules\webdriver-manager\selenium\chromedriver_2.38.exe
-Dwebdriver.gecko.driver=C:\Tools\npm-global\node_modules\webdriver-manager\selenium\geckodriver-v0.20.1.exe
-jar C:\Tools\npm-global\node_modules\webdriver-manager\selenium\selenium-server-standalone-3.11.0.jar
-port 4444
The complex way is to change webdriver-manager code or setup a mirror on local and use cmd option: --alternate_cdn and point it to your local mirror url. ( I didn't verify this can work, get it after read some source code)

skeleton-typescript-webpack fails when running npm start or npm run build on Windows 7

I'm running Windows 7 64bit with Node v6.5.0 and NPM 3.10.3. I ran npm install in the skeleton-typescript-webpack folder and all the packages installed fine. When I run any commands that call webpack though, I get the errors below.
When I run npm run build I get this error:
When I run npm start I get this error:
As you can see, the command that is run before the npm build error happens is concerning webpack, and same with the command that is run before the npm start error happens.
Anyone have an idea on how to fix this?
The skeleton skeleton-typescript-webpack uses TypeScript 2.0 for compilation.
This gives tries to compile adm-zip which is in the selenium-webdriver node module. And this gives an error on a break statement after a return statement.
The file .\nodes_modules\selenium-webdriver\node_modules\adm-zip\zipEntry.js gives the issue. You have to comment out two break; statements in the file on line 96 and line 115. After this you get a correct build.