webdriverio: [🐛 Bug]: Getting Started does not work on Windows 10
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
latest
Node.js Version
v18.12.0
Mode
WDIO Testrunner
Which capabilities are you using?
Not capability dependent
What happened?
I decided to check out v8 of WebdriverIO, and I saw on the release video that there is a new 'Getting Started" script, so I headed over to the documentation and then ran:
npm init wdio ./wdio_v8
and I got this output:
PS Y:\vitaqai_itc_testing> npm init wdio ./wdio_v8
-:...........................-:.
+ +
`` + `...` `...` + `
./+/ + .:://:::` `::///::` ` + ++/.
.+oo+ + /:+ooo+-/ /-+ooo+-/ ./ + +oo+.
-ooo+ + /-+ooo+-/ /-+ooo+-/ .: + +ooo.
-+o+ + `::///:-` `::///::` + +o+-
``. /. ````` ````` .: .``
.----------------------------.
`-::::::::::::::::::::::::::::::::::::::::-`
.+oooo/:------------------------------:/oooo+.
`.--/oooo- :oooo/--.`
.::-``:oooo` .oooo-``-::.
./-` -oooo`--.: :.-- .oooo- `-/.
-/` `-/oooo////////////////////////////////////oooo/.` `/-
`+` `/+oooooooooooooooooooooooooooooooooooooooooooooooo+:` .+`
-/ +o/.:oooooooooooooooooooooooooooooooooooooooooooo:-/o/ +.
-/ .o+ -oooosoooososssssooooo------------------:oooo- `oo` +.
-/ .o+ -oooodooohyyssosshoooo` .oooo- oo. +.
-/ .o+ -oooodooysdooooooyyooo` `.--.`` .:::-oooo- oo. +.
-/ .o+ -oooodoyyodsoooooyyooo.//-..-:/:.`.//.`./oooo- oo. +.
-/ .o+ -oooohsyoooyysssysoooo+-` `-:::. .oooo- oo. +.
-/ .o+ -ooooosooooooosooooooo+//////////////////oooo- oo. +.
-/ .o+ -oooooooooooooooooooooooooooooooooooooooooooo- oo. +.
-/ .o+ -oooooooooooooooooooooooooooooooooooooooooooo- oo. +.
-+////o+` -oooo---:///:----://::------------------:oooo- `oo////+-
+ooooooo/`-oooo``:-```.:`.:.`.+/- .::::::::::` .oooo-`+ooooooo+
oooooooo+`-oooo`-- `/` .:+ -/-`/` .:::::::::: .oooo-.+oooooooo
+-/+://-/ -oooo-`:`.o-`:.:-````.: .///:`````` -oooo-`/-//:+:-+
: :..--:-:.+ooo+/://o+/-.-:////:-....-::::-....--/+ooo+.:.:--.-- /
- /./`-:-` .:///+/ooooo/+///////////////+++ooooo/+///:. .-:.`+./ :
:-:/. :`ooooo`/` .:.ooooo : ./---
:`ooooo`/` .:.ooooo :
:`ooooo./` .:-ooooo :
:`ooooo./` .:-ooooo :
`...:-+++++:/. ./:+++++-:...`
:-.````````/../ /.-:````````.:-
-/::::::::://:/+ `+/:+::::::::::+.
:oooooooooooo++/ +++oooooooooooo-
Webdriver.IO
Next-gen browser and mobile automation
test framework for Node.js
Creating WebdriverIO project in Y:\vitaqai_itc_testing\wdio_v8
Creating a package.json for the directory.
✔ Success!
Installing @wdio/cli to initialize project.
✔ Success!
Running WDIO CLI Wizard...
===============================
🤖 WDIO Configuration Wizard 🧙
===============================
? A project named "webdriverio-tests" was detected at "Y:\vitaqai_itc_testing\wdio_v8", correct? Yes
? Where should your tests be launched? local - for e2e testing of web and mobile applications
? Where is your automation backend located? On my local machine
? Which framework do you want to use? Mocha (https://mochajs.org/)
? Do you want to use a compiler? No!
? Do you want WebdriverIO to autogenerate some test files? Yes
? Where should these files be located? Y:\vitaqai_itc_testing\wdio_v8\test\specs\**\*.js
? Do you want to use page objects (https://martinfowler.com/bliki/PageObject.html)? Yes
? Where are your page objects located? Y:\vitaqai_itc_testing\wdio_v8\test\pageobjects\**\*.js
? Which reporter do you want to use? spec
? Do you want to add a plugin to your test setup?
? Do you want to add a service to your test setup? chromedriver
? What is the base url? http://localhost
? Do you want me to run `npm install` Yes
Installing wdio packages:
- @wdio/local-runner@latest
- @wdio/mocha-framework@latest
- @wdio/spec-reporter@latest
- wdio-chromedriver-service
- chromedriver
added 91 packages, and audited 536 packages in 12s
118 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
✔ Success!
Creating a WebdriverIO config file...
✔ Success!
Autogenerating test files...
✔ Success!
Adding "wdio" script to package.json.
wdio.js config
Initialize WebdriverIO and setup configuration in your current project.
Options:
--version Show version number [boolean]
--watch Run WebdriverIO in watch mode [boolean]
-h, --hostname automation driver host address [string]
-p, --port automation driver port [number]
--path path to WebDriver endpoints (default "/") [string]
-u, --user username if using a cloud service as automation backend
[string]
-k, --key corresponding access key to the user [string]
-l, --logLevel level of logging verbosity
[choices: "trace", "debug", "info", "warn", "error", "silent"]
--bail stop test runner after specific amount of tests have fa
iled [number]
--baseUrl shorten url command calls by setting a base url[string]
-w, --waitforTimeout timeout for all waitForXXX commands [number]
-f, --framework defines the framework (Mocha, Jasmine or Cucumber) to r
un the specs [string]
-r, --reporters reporters to print out the results on stdout [array]
--suite overwrites the specs attribute and runs the defined sui
te [array]
--spec run only a certain spec file - overrides specs piped fr
om stdin [array]
--exclude exclude certain spec file from the test run - overrides
exclude piped from stdin [array]
--mochaOpts Mocha options
--jasmineOpts Jasmine options
--cucumberOpts Cucumber options
--autoCompileOpts Auto compilation options
--yarn Install packages via Yarn package manager.
[boolean] [default: false]
-y, --yes will fill in all config defaults without prompting
[boolean] [default: false]
-t, --npmTag define NPM tag to use for WebdriverIO related packages
[string] [default: "latest"]
--help Show help [boolean]
Documentation: https://webdriver.io
@wdio/cli (v8.0.2)
Error: ⚠️ Couldn't add script to package.json: Error: spawn npm ENOENT
at ChildProcess.<anonymous> (file:///Y:/vitaqai_itc_testing/wdio_v8/node_modules/@wdio/cli/build/utils.js:491:31)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
at createWDIOScript (file:///Y:/vitaqai_itc_testing/wdio_v8/node_modules/@wdio/cli/build/utils.js:655:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runConfigCommand (file:///Y:/vitaqai_itc_testing/wdio_v8/node_modules/@wdio/cli/build/commands/config.js:117:5)
at async Object.handler (file:///Y:/vitaqai_itc_testing/wdio_v8/node_modules/@wdio/cli/build/commands/config.js:125:5)
file:///C:/Users/ross/AppData/Local/npm-cache/_npx/4ecb0eecc8f083d6/node_modules/create-wdio/build/utils.js:19
return reject(new Error((error && error.message) ||
^
Error: Error calling: npx wdio config
at ChildProcess.<anonymous> (file:///C:/Users/ross/AppData/Local/npm-cache/_npx/4ecb0eecc8f083d6/node_modules/create-wdio/build/utils.js:19:31)
at ChildProcess.emit (node:events:513:28)
at cp.emit (C:\Users\ross\AppData\Local\npm-cache\_npx\4ecb0eecc8f083d6\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5)
Node.js v18.12.0
npm ERR! code 1
npm ERR! path Y:\vitaqai_itc_testing
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c create-wdio ./wdio_v8
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ross\AppData\Local\npm-cache\_logs\2022-12-02T12_53_41_664Z-debug-0.log
Obviously this shouldn’t happen, but just to check I decided to see if there was enough there that a test would run, so I did this:
cd wdio_v8
npx wdio run ./wdio.conf.js
and got this:
PS Y:\vitaqai_itc_testing> cd wdio_v8
PS Y:\vitaqai_itc_testing\wdio_v8> npx wdio run ./wdio.conf.js
2022-12-02T12:57:25.588Z WARN @wdio/config:ConfigParser: pattern . estspecs***.js did not match any file
Execution of 0 workers started at 2022-12-02T12:57:25.592Z
2022-12-02T12:57:25.750Z INFO @wdio/cli:launcher: Run onPrepare hook
2022-12-02T12:57:26.199Z INFO chromedriver: Initiate Chromedriver Launcher (v8.0.0)
2022-12-02T12:57:26.207Z INFO chromedriver: Start Chromedriver (Y:\vitaqai_itc_testing\wdio_v8\node_modules\chromedriver\lib\chromedriver\chromedriver.exe) with args --port=9515 --url-base=/
2022-12-02T12:57:27.104Z INFO chromedriver: Starting ChromeDriver 108.0.5359.71 (1e0e3868ee06e91ad636a874420e3ca3ae3756ac-refs/branch-heads/5359@{#1016}) on port 9515
2022-12-02T12:57:27.105Z INFO chromedriver: Only local connections are allowed.
2022-12-02T12:57:27.106Z INFO chromedriver: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
2022-12-02T12:57:27.114Z INFO chromedriver: ChromeDriver was started successfully.
2022-12-02T12:57:27.160Z WARN @wdio/config:ConfigParser: pattern . estspecs***.js did not match any file
2022-12-02T12:57:27.161Z ERROR @wdio/cli:launcher: No specs found to run, exiting with failure
2022-12-02T12:57:27.162Z INFO @wdio/cli:launcher: Run onComplete hook
Spec Files: 0 passed, 0 total (0% completed) in 00:00:01
2022-12-02T12:57:27.165Z INFO @wdio/local-runner: Shutting down spawned worker
2022-12-02T12:57:27.416Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2022-12-02T12:57:27.417Z INFO @wdio/local-runner: shutting down
I get the same result when I do:
mkdir wdio_v8
cd wdio_v8
npm init -y
npm init wdio .
What is your expected behavior?
I expected the setup to run without error and an example test to run.
How to reproduce the bug.
To reproduce the bug run:
npm init wdio ./wdio_v8
cd wdio_v8
npx wdio run ./wdio.conf.js
In a Windows 10 Powershell window.
Relevant log output
Log output already provided.
Code of Conduct
- I agree to follow this project’s Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (13 by maintainers)
Commits related to this issue
- Fixed npm pkg set call for Windows - fixes #9289 — committed to webdriverio/webdriverio by christian-bromann 2 years ago
I’m happy to have a crack at this.
Why do we now handle file specs as URL’s with the
file:///type prefix ?