question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WDIO Configuration Helper doesn't work using yarn

See original GitHub issue

The problem

WDIO Configuration Helper doesn’t work using yarn@1.0.1.

Environment

  • WebdriverIO version: 4.8.0
  • Node.js version: 8.2.1
  • Standalone mode or wdio testrunner: testrunner
  • if wdio testrunner, running synchronous or asynchronous tests: n/a
  • Additional wdio packages used (if applicable): n/a

Details

11:18 $ ./node_modules/.bin/wdio config

=========================
WDIO Configuration Helper
=========================

? Where do you want to execute your tests? On my local machine
? Which framework do you want to use? jasmine
? Shall I install the framework adapter for you? Yes
? Where are your test specs located? ./test/specs/**/*.js
? Which reporter do you want to use?  dot - https://github.com/webdriverio/wdio-dot-reporter,  spec - https://github.com/webdriverio/wdio-spec-reporter,  allure - https://github.com/webdriverio/wdio-allu
re-reporter,  json - https://github.com/fijijavis/wdio-json-reporter,  concise - https://github.com/FloValence/wdio-concise-reporter
? Shall I install the reporter library for you? Yes
? Do you want to add a service to your test setup?  selenium-standalone - https://github.com/webdriverio/wdio-selenium-standalone-service,  webpack - https://github.com/leadpages/wdio-webpack-service,  w
ebpack-dev-server - https://gitlab.com/Vinnl/wdio-webpack-dev-server-service
? Shall I install the services for you? Yes
? Level of logging verbosity verbose
? In which directory should screenshots gets saved if a command fails? ./errorShots/
? What is the base url? http://localhost

Installing wdio packages:

Packages installed successfully, creating configuration file...
fs.js:652
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/path/to/node_modules/webdriverio/build/lib/helpers/wdio.conf.ejs'
    at Object.fs.openSync (fs.js:652:18)
    at Object.fs.readFileSync (fs.js:553:33)
    at renderConfigurationFile (/path/to/node_modules/webdriverio/build/lib/cli.js:292:28)
    at /path/to/node_modules/webdriverio/build/lib/cli.js:282:17
    at /path/to/node_modules/npm-install-package/index.js:31:5
    at ChildProcess.exithandler (child_process.js:262:7)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:921:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

I’m opening this to track the issue that is related to here: https://github.com/webdriverio/webdriverio/issues/2215 https://github.com/webdriverio/webdriverio/issues/2218

Link to Selenium/WebdriverIO logs

N/A

Code To Reproduce Issue [ Good To Have ]

N/A

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ayoolaaocommented, Oct 17, 2018

My observations:

  • You install ‘webdriverIO’ with yarn and the yarn.lock is updated/created.
  • Then you run: ‘./node_modules/.bin/wdio config’ and select config options
  • I think the issue is that the WDIO configuration helper uses npm to install selected dependencies (e.g spec reporter, jasmine etc),
  • hence creating a package-lock.json file. Causing this issue because webdriverio in yarn.lock and not in the package-lock.json with selected reporters, frameworks etc.

Walk-around fix:

  1. Install ‘webdriverio’ with: yarn add -D webdriverio
  2. Run wdio config helper: ./node_modules/.bin/wdio config ![screen shot 2018-10-17 at 5 00 21 pm](https://user-images.githubusercontent.com/23148951/47121128-a9914a80-d22e-11e8-8b46-401aad9d3e18.png)
  3. Select desired options but don’t the have helper install any of them for you, by responding with ‘no’ (e.g Shall I install the framework adapter for you? No).
  4. Configuration file was created successfully!
  5. Manually install the required services, frameworks and/or reporters with yarn either by: a. Adding them to your package.json file and running yarn install b. Yarn add each one of them
Desktop/a-yarn ❯❯❯❯❯ yarn add -D webdriverio
yarn add v1.10.1
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...

success Saved lockfile.
success Saved 137 new dependencies.
✨  Done in 4.99s.
Desktop/a-yarn ❯❯❯❯❯ ./node_modules/.bin/wdio config

WDIO Configuration Helper

? Where do you want to execute your tests? On my local machine
? Which framework do you want to use? jasmine
? Shall I install the framework adapter for you? No
? Where are your test specs located? ./test/specs/**/*.js
? Which reporter do you want to use?  spec - https://github.com/webdriverio/wdio-spec-reporter
? Shall I install the reporter library for you? No
? Do you want to add a service to your test setup?  selenium-standalone - https://github.com/webdriverio/wdio-se
lenium-standalone-service,  visual-regression - https://github.com/zinserjan/wdio-visual-regression-service
? Shall I install the services for you? No
? Level of logging verbosity silent
? In which directory should screenshots gets saved if a command fails? ./errorShots/
? What is the base url? http://localhost

Configuration file was created successfully!
To run your tests, execute:

$ wdio wdio.conf.js

Desktop/a-yarn ❯❯❯❯❯                                                                                       26s
0reactions
gitowieccommented, Oct 11, 2018

I have the same issue WDIO just deleted half of the packages from node_modules and broke with this error:

WDIO Configuration Helper
=========================

? Where do you want to execute your tests? On my local machine
? Which framework do you want to use? mocha
? Shall I install the framework adapter for you? Yes
? Where are your test specs located? ./test/specs/**/*.js
? Which reporter do you want to use?  spec - https://github.com/webdriverio/wdio-spec-reporter
? Shall I install the reporter library for you? Yes
? Do you want to add a service to your test setup?  selenium-standalone - https://github.com/webdriverio/wdio-selenium-standalone-service
? Shall I install the services for you? Yes
? Level of logging verbosity silent
? In which directory should screenshots gets saved if a command fails? ./errorShots/
? What is the base url? http://127.0.0.1:8899

Installing wdio packages:

Packages installed successfully, creating configuration file...
fs.js:646
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/home/user/workspace/web-ui/node_modules/webdriverio/build/lib/helpers/wdio.conf.ejs'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at renderConfigurationFile (/home/user/workspace/web-ui/node_modules/webdriverio/build/lib/cli.js:315:28)
    at /home/user/workspace/web-ui/node_modules/webdriverio/build/lib/cli.js:305:17
    at /home/user/workspace/web-ui/node_modules/npm-install-package/index.js:31:5
    at ChildProcess.exithandler (child_process.js:267:7)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
error Command failed with exit code 1.
Read more comments on GitHub >

github_iconTop Results From Across the Web

@wdio/config | Yarn - Package Manager
A helper utility to parse and validate WebdriverIO options. webdriver, wdio, wdio-utility. readme. WDIO Configurations Utility. A helper utility to parse ...
Read more >
Configuration File - WebdriverIO
The configuration file contains all necessary information to run your test suite. It's a NodeJS module that exports a JSON.
Read more >
Getting an error when running "npx wdio config" - Stack Overflow
Seems to be a problem with the latest version of the @wdio/cli dependency. I solved the problem by using an older version and...
Read more >
wdio-eslinter-service - npm
To also have the eslinter service use an existing eslintrc configuration in your project, set includeProjectEslintrc to true in the wdio.conf.js ...
Read more >
View Raw - UNPKG
exclude?: string[]; /** * Files to watch when running `wdio` with the `--watch` ... @param config wdio configuration object * @param capabilities list...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found