webdriverio / create-wdio Goto Github PK
View Code? Open in Web Editor NEWOne-line installer for WebdriverIO
Home Page: https://webdriver.io
License: MIT License
One-line installer for WebdriverIO
Home Page: https://webdriver.io
License: MIT License
Once you enter the configuration wizard and try to exit the process through e.g. CTRL+C
a success message is shown at the end, e.g.:
Running WDIO CLI Wizard...
=========================
WDIO Configuration Helper
=========================
? Where is your automation backend located? On my local machine
? Which framework do you want to use? (Use arrow keys)
โฏ mocha
jasmine
cucumber
----- CTRL+C was pressed here -----
Adding "wdio" script to package.json.
โ Success!
๐ค Successfully setup project at /private/tmp/demo ๐
Join our Gitter community and instantly find answers to your issues or queries. Or just join and say hi ๐!
๐ https://gitter.im/webdriverio/webdriverio
Visit the project on GitHub to report bugs ๐ or raise feature requests ๐ก:
๐ https://github.com/webdriverio/webdriverio
To start the test, run: $ npm run wdio
Just cancel the process and don't show any message.
8.0.9
Standalone Mode
capabilities: [{
maxInstances: 5,
browserName: 'chrome',
acceptInsecureCerts: true
}]
Starting a new wdio project with typescript
actually results in multiple errors.
I know that there is another opened issue that seems related #9334 but I needed a plain new issue to report all I've found and the corresponding fixes.
NB: I have no idea where to fix that in the code, nor time to submit a PR, so I let you guys decide what to do ;-)
After following the steps described in the How to reproduce the bug section and running the tests, here is what I have encountered:
/Users/Badisi/Workspace/test-wdio/wdio.conf.ts:1
export const config = {
^^^^^^
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1032:15)
at Module._compile (node:internal/modules/cjs/loader:1067:27)
at Module.m._compile (/Users/jpti/Workspace/test-wdio/node_modules/ts-node/src/index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Object.require.extensions.<computed> [as .ts] (/Users/jpti/Workspace/test-wdio/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:168:29)
at ModuleJob.run (node:internal/modules/esm/module_job:197:25)
This can be resolved by setting type:module
in the package.json
:
{
"type": "module"
}
@wdio/runner: Error: Cannot find module '/Users/Badisi/Workspace/test-wdio/test/pageobjects/login.page' imported from /Users/Badisi/Workspace/test-wdio/test/specs/example.e2e.ts
[0-0] at finalizeResolution (/Users/Badisi/Workspace/test-wdio/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:366:11)
[0-0] at moduleResolve (/Users/Badisi/Workspace/test-wdio/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:801:10)
[0-0] at Object.defaultResolve (/Users/Badisi/Workspace/test-wdio/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:912:11)
[0-0] at /Users/Badisi/Workspace/test-wdio/node_modules/ts-node/src/esm.ts:218:35
[0-0] at entrypointFallback (/Users/Badisi/Workspace/test-wdio/node_modules/ts-node/src/esm.ts:168:34)
[0-0] at /Users/Badisi/Workspace/test-wdio/node_modules/ts-node/src/esm.ts:217:14
[0-0] at addShortCircuitFlag (/Users/Badisi/Workspace/test-wdio/node_modules/ts-node/src/esm.ts:409:21)
[0-0] at resolve (/Users/Badisi/Workspace/test-wdio/node_modules/ts-node/src/esm.ts:197:12)
[0-0] at ESMLoader.resolve (node:internal/modules/esm/loader:530:30)
[0-0] at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18)
Looks like the issue comes from ts-node
but instead comes from typescript
.
Having set type:module
in package.json
now requires the relative import paths to have full extensions (see the blog post from Microsoft for more details).
So the solution is to put a .js
extension at the end of these imports:
// test/pageobjects/login.page.ts
// test/pageobjects/login.page.ts
import Page from './page.js';
// test/specs/example.e2e.ts
import LoginPage from '../pageobjects/login.page.js';
import SecurePage from '../pageobjects/secure.page.js';
And now everything is working as expected!
No response
npm init wdio@latest .
npm install
-> Yesnpm run wdio
-
latest
latest
WDIO Testrunner
n/a
When calling pnpm create wdio
an error is thrown.
The workflow should work as smooth as with npm and yarn.
n/a
pnpm create wdio@latest .
.../../../.pnpm-store/v3/tmp/dlx-14824 | +50 +++++
.../../../.pnpm-store/v3/tmp/dlx-14824 | Progress: resolved 50, reused 48, downloaded 2, added 50, done
**** WDIO LOGO REMVOED *****
Webdriver.IO
Next-gen browser and mobile automation
test framework for Node.js
Installing @wdio/cli to initialize project...
โ ๏ธ Ups, something went wrong: Error calling: npm install --save-dev --loglevel error @wdio/cli@latest!
when after run npx create-wdio@latest ./e2e in target folder with terminal, there has not package.json generated in target folder, instead of always generate the package.json file in /Users/administrator folder, although input the target folder path
Currently the wizard detects if Yarn is installed and defaults to that. A user should be able to force it running via NPM.
Unable to install WebDriverIO for my new Project. It says lot of error as in attached file
2023-05-31T11_49_45_931Z-debug-0.log
Steps I performed:
1 - Created a new folder with my project name
2 - Ran the command "npm init -y"
3 - Ran another command "npm init wdio@latest ./e2e".
If I run:
$ pwd
/some/other/dir
$ npm create wdio /tmp/foobar
I expect the project to be created in /tmp/foobar
but instead it gets created in /some/other/dir/tmp/foobar
.
7.16.13
14.18.2
Standalone Mode
No response
When I initialized wdio in my project, selecting TypeScript as compiler, the CLI created a wdio.config.ts
(config file in TypeScript). This is fine, but at the same time, it added a npm script to package.json
which refers to wdio.config.js
(config file in JavaScript).
It also didn't take into account, where the wdio.config.js/ts
was located. Even though I used default values for the initialization (expect using Jasmine and TypeScript), it thought my wdio.config.js/ts
was located in the root of the project, but itself created it in ./test/
.
I expected that the CLI would know what file extension the wdio config would have, and where it would be created, so the npm script in package.json
would be correct.
npm init wdio .
jasmine
TypeScript
package.json
would be "wdio": "wdio run wdio.conf.js"
Running WDIO CLI Wizard...
=========================
WDIO Configuration Helper
=========================
? Where is your automation backend located? On my local machine
? Which framework do you want to use? jasmine
? Do you want to use a compiler? TypeScript (https://www.typescriptlang.org/)
? Where are your test specs located? ./test/specs/**/*.ts
? Do you want WebdriverIO to autogenerate some test files? Yes
? Do you want to use page objects (https://martinfowler.com/bliki/PageObject.html)? Yes
? Where are your page objects located? ./test/pageobjects/**/*.ts
? 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
Installing wdio packages:
- @wdio/local-runner
- @wdio/jasmine-framework
- @wdio/spec-reporter
- wdio-chromedriver-service
- chromedriver
up to date, audited 2836 packages in 12s
191 packages are looking for funding
run `npm fund` for details
56 vulnerabilities (2 low, 47 moderate, 7 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
Packages installed successfully, creating configuration file...
Config file installed successfully, creating test files...
To have TypeScript support please add the following packages to your "types" list:
{
"compilerOptions": {
"types": ["node", "webdriverio/async", "@wdio/jasmine-framework", "expect-webdriverio"]
}
}
For for information on TypeScript integration check out: https://webdriver.io/docs/typescript
Configuration file was created successfully!
To run your tests, execute:
$ npx wdio run test/wdio.conf.ts
Adding scripts to package.json
๐ค Successfully setup project at /Users/morten/Projects/awesome-project ๐
To start the test, run: $ npm run wdio
โ awesome-project git:(wdio) โ npm run wdio
> micro-frontend-tools@0.0.0 wdio
> wdio run wdio.conf.js
? Error: Could not execute "run" due to missing configuration. Would you like to create one? No
7.16.3
14.17.5
Standalone Mode
No response
The starter project generated with @wdio/cli
does not run.
Following the getting started guide:
npx wdio .
npx wdio run ./wdio.conf.js
This outputs the following error:
Error: Could not execute "run" due to missing configuration. Would you like to create one? (y/N)
The issue here is that the wizard created a wdio.conf.ts
and not a wdio.conf.js
as stated in the doc (or as configured in the package.json script)
Replacing the command with:
npx wdio run ./wdio.conf.ts
gives the following issue:
SyntaxError: Unexpected token 'export'
Renaming wdio.conf.ts
to wdio.conf.js
and editing the file as follow:
// replace:
export const config: WebdriverIO.Config = {
// with:
exports.config = {
I expect the starter project to run without issues.
Simply follow the getting started guide:
npx wdio .
npx wdio run ./wdio.conf.js
export const config: WebdriverIO.Config = {
^^^^^^
SyntaxError: Unexpected token 'export'
at wrapSafe (internal/modules/cjs/loader.js:988:16)
at Module._compile (internal/modules/cjs/loader.js:1036:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
So as a user, you would have to add this manually to the file tsconfig.json
Our current test coverage is pretty low. It would be nice to get at least to a global coverage of about 80%.
Hello,
Thanks for you valuable time and making easy setup for wido.
Currently this single setup doing great job for creating JS script project.
Is it possible same thing to support in car of TS script?
A week or so ago, cloning a repo in my jenkins nightly run, started yelling for yarn to be installed.
+ BLAH_URL=http://172.17.0.4:3000 /ISOLATED_SELENIUM/run-tests.sh
Test Work DIR: /home/jenkins/worker/workspace/BLAH/nightly-selenium
> [email protected] test:jenkins /ISOLATED_SELENIUM
> wdio wdio.conf.js
-:...........................-:.
+ +
` '' + '...' '...' + ''
./+/ + .:://:::' '::///::' ' + ++/.
.+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
events.js:291
throw er; // Unhandled 'error' event
^
Error: spawn yarnpkg ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
at onErrorNT (internal/child_process.js:470:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
at onErrorNT (internal/child_process.js:470:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yarnpkg',
path: 'yarnpkg',
spawnargs: [ '--version' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:jenkins: 'wdio wdio.conf.js'
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test:jenkins 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! /root/.npm/_logs/2021-09-02T08_06_12_087Z-debug.log
script returned exit code 1
I was able to continue testing after adding Yarn and create a Yarn.lock. This seems like a really bad Idea.
Please advise.
I'm new to WebDriverIO. I followed the get started instructions at https://webdriver.io/docs/gettingstarted. However when I execute npm run wdio
I see the following error message
[0-0] 2022-01-07T01:32:53.026Z ERROR @wdio/local-runner: Failed launching test session: Error: Couldn't initialise "@wdio/cucumber-framework".
[0-0] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/formatter/helpers/event_data_collector' is not defined by "exports" in /Users/stagr005/workspace/wdio-sample/node_modules/@cucumber/cucumber/package.json
[0-0] at throwExportsNotFound (internal/modules/esm/resolve.js:285:9)
[0-0] at packageExportsResolve (internal/modules/esm/resolve.js:491:3)
[0-0] at resolveExports (internal/modules/cjs/loader.js:450:36)
[0-0] at Function.Module._findPath (internal/modules/cjs/loader.js:490:31)
[0-0] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:27)
[0-0] at Function.Module._load (internal/modules/cjs/loader.js:743:27)
[0-0] at Module.require (internal/modules/cjs/loader.js:965:19)
[0-0] at require (internal/modules/cjs/helpers.js:88:18)
[0-0] at Object.<anonymous> (/Users/stagr005/workspace/wdio-sample/node_modules/@wdio/cucumber-framework/build/index.js:49:48)
[0-0] at Module._compile (internal/modules/cjs/loader.js:1076:30)
[0-0] at safeRequire (/Users/stagr005/workspace/wdio-sample/node_modules/@wdio/utils/build/utils.js:187:15)
[0-0] at initialisePlugin (/Users/stagr005/workspace/wdio-sample/node_modules/@wdio/utils/build/initialisePlugin.js:30:50)
[0-0] at Runner.run (/Users/stagr005/workspace/wdio-sample/node_modules/@wdio/runner/build/index.js:82:56)
[0-0] at processTicksAndRejections (internal/process/task_queues.js:93:5)
[0-0] FAILED
I'm not sure how to resolve this. Any assistance would be appreciated
As stated in the getting started guide:
To add a full WebdriverIO setup to an existing or new project, run:
$ npx wdio .
Actually this command can only be run once and not on an existing project (with wdio already installed), otherwise it crashes.
Ex: running npx wdio .
twice results in the following error:
ERROR @wdio/config:ConfigParser: Failed loading configuration file: : Cannot find module
On an empty project:
when npx wdio .
is executed -> npm
will download wdio
package globally and run it.
On an existing project (with wdio already installed):
when npx wdio .
is executed -> npm
will use the local wdio
available in node_modules/.bin
but this one comes from the @wdio/cli
package.
latest
16.14.2
Standalone Mode
No response
While trying to use the starter toolkit, I keep getting this error.
marccaballero@LM-SJC-11016683 checkout % yarn create wdio .
yarn create v1.22.11
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
[3/4] ๐ Linking dependencies...
[4/4] ๐จ Building fresh packages...
success Installed "[email protected]" with binaries:
- create-wdio
[#############] 13/13
-:...........................-:.
+ +
`` + `...` `...` + `
./+/ + .:://:::` `::///::` ` + ++/.
.+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
Installing @wdio/cli to initialize project...
file:///Users/marccaballero/.config/yarn/global/node_modules/create-wdio/build/utils.js:16
return reject(new Error((error && error.message) ||
^
Error: Error calling: npm install --save-dev --loglevel error @wdio/cli@latest
at ChildProcess.<anonymous> (file:///Users/marccaballero/.config/yarn/global/node_modules/create-wdio/build/utils.js:16:31)
at ChildProcess.emit (node:events:526:28)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
error Command failed.
Exit code: 1
Command: /Users/marccaballero/.yarn/bin/create-wdio
Arguments: .
Directory: /Users/marccaballero/checkout/checkout
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
Initially I though it may be related to the M1 chip since I have noticed multiple libraries have had issue with this chip, but I tested in a previous version of a mac pro and it is still failing for the same reason, as you can see there's no output message shown in the error so this is what I can deliver
That the toolkit works or having documentation to manually integrate the library
Using node v16.14.2
running yarn create wdio .
marccaballero@LM-SJC-11016683 checkout % yarn create wdio .
yarn create v1.22.11
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
[3/4] ๐ Linking dependencies...
[4/4] ๐จ Building fresh packages...
success Installed "[email protected]" with binaries:
- create-wdio
[#############] 13/13
-:...........................-:.
+ +
`` + `...` `...` + `
./+/ + .:://:::` `::///::` ` + ++/.
.+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
Installing @wdio/cli to initialize project...
file:///Users/marccaballero/.config/yarn/global/node_modules/create-wdio/build/utils.js:16
return reject(new Error((error && error.message) ||
^
Error: Error calling: npm install --save-dev --loglevel error @wdio/cli@latest
at ChildProcess.<anonymous> (file:///Users/marccaballero/.config/yarn/global/node_modules/create-wdio/build/utils.js:16:31)
at ChildProcess.emit (node:events:526:28)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
error Command failed.
Exit code: 1
Command: /Users/marccaballero/.yarn/bin/create-wdio
Arguments: .
Directory: /Users/marccaballero/checkout/checkout
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
### Is there an existing issue for this?
- [X] I have searched the existing issues
In a fresh TypeScript project that has some unit tests under ./test
I created a new wdio project using the following command:
$ npm init wdio ./test
With the following answers:
? Where is your automation backend located? On my local machine
? Which framework do you want to use? mocha
? Do you want to use a compiler? TypeScript (https://www.typescriptlang.org/)
? Where are your test specs located? ./e2e
? Do you want WebdriverIO to autogenerate some test files? Yes
? Do you want to use page objects (https://martinfowler.com/bliki/PageObject.html)? No
? 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? vscode
? What is the base url? http://localhost
? Do you want me to run `npm install` Yes
Which resulted into this file structure:
It seems that:
./test/e2e
folder is not generatedpackage.json
is generated even though the project already has onelatest (as of 2024-01-23)
v20.11.0 (Windows 10)
WDIO Testrunner
No response
Tried to set up wdio by running npm init wdio@latest .
To have wdio set up and ready to run.
npm install
at the top levelcd packages/memory
npm init wdio@latest .
$ npm init wdio@latest .
Need to install the following packages:
create-wdio@latest
Ok to proceed? (y) y
-:...........................-:.
+ +
`` + `...` `...` + `
./+/ + .:://:::` `::///::` ` + ++/.
.+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
Installing @wdio/cli to initialize project...
โ Success!
node:internal/modules/esm/resolve:214
const resolvedOption = FSLegacyMainResolve(packageJsonUrlString, packageConfig.main, baseStringified);
^
Error: Cannot find package 'C:\Users\nzaka\projects\humanwhocodes\fsx\packages\web\node_modules\@wdio\utils\node_modules\proxy-agent\package.json' imported from C:\Users\nzaka\projects\humanwhocodes\fsx\packages\web\node_modules\@wdio\utils\node_modules\@puppeteer\browsers\lib\esm\httpUtil.js
at legacyMainResolve (node:internal/modules/esm/resolve:214:26)
at packageResolve (node:internal/modules/esm/resolve:840:14)
at moduleResolve (node:internal/modules/esm/resolve:910:20)
at defaultResolve (node:internal/modules/esm/resolve:1130:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36)
{
code: 'ERR_MODULE_NOT_FOUND'
}
Node.js v20.11.0
โ ๏ธ Ups, something went wrong: Error calling: npx wdio co
nfig!
npm ERR! code 1
npm ERR! path C:\Users\nzaka\projects\humanwhocodes\fsx\packages\web
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c create-wdio "."
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\nzaka\AppData\Local\npm-cache\_logs\2024-01-24T00_21_30_109Z-debug.log
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
### Is there an existing issue for this?
- [X] I have searched the existing issues
I bootstrapped this project fairly quickly. We now need to make sure it is unit tested.
This worked last night but when trying to setup a new framework by running the command given below tonight, it is giving errors
Command to Run : npm init wdio@latest ./e2e
Output of the command:
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
-:...........................-:.
+ +
`` + `...` `...` + `
./+/ + .:://:::` `::///::` ` + ++/.
.+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
Installing @wdio/cli to initialize project...
โ Success!
? What type of testing would you like to do? E2E Testing - of Web or Mobile Applications
? Where is your automation backend located? On my local machine
? Which environment you would like to automate? Web - web applications in the browser
? With which browser should we start? Chrome
? Which framework do you want to use? Cucumber (https://cucumber.io/)
? Do you want to use a compiler? TypeScript (https://www.typescriptlang.org/)
? Do you want WebdriverIO to autogenerate some test files? Yes
? Where should these feature files be located? C:\Projects\SourceTrials\wdtests\e2e\features**.feature
? Where should these step definitions be located? C:\Projects\SourceTrials\wdtests\e2e\features\step-definitions\steps.ts
? Do you want to use page objects (https://martinfowler.com/bliki/PageObject.html)? Yes
? Where are your page objects located? C:\Projects\SourceTrials\wdtests\e2e\features\pageobjects**.ts
? 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
Setting up TypeScript...
โ Success!
Installing wdio packages:
added 159 packages, and audited 612 packages in 31s
88 packages are looking for funding
run npm fund
for details
9 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run npm audit
for details.
โ Success!
Creating a WebdriverIO config file...
โ Success!
Autogenerating test files...
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]
--multi-run Run individual spec files x amount of times [number]
--mochaOpts Mocha options
--jasmineOpts Jasmine options
--cucumberOpts Cucumber options
--autoCompileOpts Auto compilation options
--coverage Enable coverage for browser runner
--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.12.1)
Error:
7| */
8| if (answers.usePageObjects) { %>
9| <%- answers.isUsingTypeScript || answers.esmSupport
10| ?import LoginPage from '${relativePath}/login.page${answers.esmSupport ? '.js' : ''}';
11| :const LoginPage = require('${relativePath}/login.page');
%>
12| <%- answers.isUsingTypeScript || answers.esmSupport
relativePath is not defined
at eval ("C:\Projects\SourceTrials\wdtests\e2e\node_modules\@wdio\cli\build\templates\exampleFiles\cucumber\step_definitions\steps.js.ejs":25:33)
at steps.js (C:\Projects\SourceTrials\wdtests\e2e\node_modules\ejs\lib\ejs.js:703:17)
at tryHandleCache (C:\Projects\SourceTrials\wdtests\e2e\node_modules\ejs\lib\ejs.js:274:36)
at exports.renderFile (C:\Projects\SourceTrials\wdtests\e2e\node_modules\ejs\lib\ejs.js:491:10)
at node:internal/util:375:7
at new Promise ()
at node:internal/util:361:12
at generateLocalRunnerTestFiles (file:///C:/Projects/SourceTrials/wdtests/e2e/node_modules/@wdio/cli/build/utils.js:369:35)
at async createWDIOConfig (file:///C:/Projects/SourceTrials/wdtests/e2e/node_modules/@wdio/cli/build/utils.js:730:13)
at async runConfigCommand (file:///C:/Projects/SourceTrials/wdtests/e2e/node_modules/@wdio/cli/build/commands/config.js:119:5)
at createWDIOConfig (file:///C:/Projects/SourceTrials/wdtests/e2e/node_modules/@wdio/cli/build/utils.js:735:15)
at async runConfigCommand (file:///C:/Projects/SourceTrials/wdtests/e2e/node_modules/@wdio/cli/build/commands/config.js:119:5)
at async Object.handler (file:///C:/Projects/SourceTrials/wdtests/e2e/node_modules/@wdio/cli/build/commands/config.js:129:5)
npm ERR! code 1
npm ERR! path C:\Projects\SourceTrials\wdtests
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c create-wdio ./e2e
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Users\v\AppData\Local\npm-cache_logs\2023-07-10T13_32_20_639Z-debug-0.log
Not entirely sure what the problem is or what change to cause this error. Any help would be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.