Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to run tests after updating project dependencies : wdio not finding conf.js file #6244

Closed
pfoucray opened this issue Dec 18, 2020 · 8 comments

Comments

@pfoucray
Copy link

pfoucray commented Dec 18, 2020

[//]: # NOTE: This repository only maintains packages that are listed in the Readme. Please make sure that your issue is directly caused by one of these packages and if not file an issue in the correct 3rd party package repository.

Environment (please complete the following information):

  • WebdriverIO version: ^6.10.0
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: sync
  • Node.js version: 12.19.0
  • NPM version: 6.14.8
  • Browser name and version: mobile testing (appium)
  • Platform name and version: Windows 10
  • Additional wdio packages used (if applicable): [e.g. @wdio/spec reporter, @wdio/selenium-standalone service]

Config of WebdriverIO
shared.config.js, imported in different config.js files, that are called through wdio CLI
Ex : npx wdio ./config/wdio.browserstack.local.conf.js
image

Describe the bug
I have a version of my project with node_modules installed, locally.
As soon as I perform a yarn install / yarn add -D node_module_name
it becomes impossible for wdio CLI to find my .conf.js file.
message : ? Error: Could not execute "run" due to missing configuration. Would you like to create one? (y/N)

I can assure that deleting the complete folder node_module to replace by the one used before performing a yarn install / add will "fix" the issue.
In other words, I'm unable to update my project dependancies, it "breaks" wdio

To Reproduce
Steps to reproduce the behavior:
start tests using npx wdio wdio.cong.js
everything runs smooth
perform and yarn install / yarn add
don't change anything in the src code
wdio will not find the conf file, with the exact same command.

Expected behavior
I should be able to update my project dependancies (with minor versions) or add node-modules (such as official reporters like Allure) without breaking wdio

Additional context
Add any other context about the problem here.
image

@pfoucray pfoucray changed the title unable to run tests after project dependencies : wdio not finding conf.js file unable to run tests after updating project dependencies : wdio not finding conf.js file Dec 18, 2020
@pfoucray
Copy link
Author

For information, seeing bugs that a similare to my issue, refering to yarn not working with webdriver
#2218
#2215 (comment)
I deleted all node_modules and performed npm install (IO yarn install)
Seems to work.
Will perform tests and keep updated

@christian-bromann
Copy link
Member

@pfoucray please ensure that you have updated all WebdriverIO related packages. The issues you have linked are 3 years old and unrelated to this. I will close this but happy to re-open in case this bug continues to appear after updating all packages.

@pfoucray
Copy link
Author

pfoucray commented Dec 18, 2020

@christian-bromann
FYI :
"devDependencies": {
"@types/chai": "^4.2.14",
"@types/cucumber": "^6.0.1",
"@types/node": "^14.14.10",
"@types/webdriverio": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^4.8.2",
"@typescript-eslint/parser": "^4.8.2",
"@wdio/allure-reporter": "^6.10.6",
"@wdio/browserstack-service": "^6.10.0",
"@wdio/cli": "^6.10.0",
"@wdio/cucumber-framework": "^6.8.0",
"@wdio/junit-reporter": "^6.10.6",
"@wdio/local-runner": "^6.10.0",
"@wdio/spec-reporter": "^6.8.1",
"@wdio/sync": "^6.10.0",
"chai": "^4.2.0",
"cucumber": "^7.0.0-rc.0",
"dotenv": "^8.2.0",
"eslint": "^7.14.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"multiple-cucumber-html-reporter": "^1.18.0",
"prettier": "^2.2.0",
"rimraf": "^3.0.2",
"ts-node": "^9.0.0",
"typescript": "^4.1.2",
"wdio-cucumberjs-json-reporter": "^2.0.2",
"wdio-native-app-compare-service": "^1.2.0",
"webdriverio": "^6.10.0"
},
"dependencies": {
"@wdio/appium-service": "^6.10.0",
"appium": "^1.19.1"
}

ANOTHER THING :
my team mate, same project, can perform yarn install with no issues. I realy don't understand what difference I have in my setup, since our sources are exact same

@christian-bromann
Copy link
Member

@pfoucray make sure you clean your node_modules directory and remove the package-lock.json and install everything fresh.

@pfoucray
Copy link
Author

@christian-bromann
What I did is clone the repo twice brand new :
First folder : yarn install then npx run wdio.conf.js then yarn upgrade then run wdio.conf.js
Second folder : npm install then npx run wdio.conf.js then npm upgrade then run wdio.conf.js
Both cases : missing configuration

Also : on the very same computer : have the project originaly cloned and working on with node_modules untuched that is working fine.
Also : my team mate can perform yarn install no problem on his windows machine.

Currently updateing npm from 6.14.8 to 6.14.9
I'm out of ideas :/

Thx for the replies and followup
Cheers

@christian-bromann
Copy link
Member

then npx run wdio.conf.js

This is not a valid wdio command.

@pfoucray
Copy link
Author

You are absolutely right, my mistake
npx wdio ./pathToMyConf.js

After npm update : seems to start.
Browserstack service refuses my credentials but it'll be another story I guess..
Node-Js makes life easy AND hard sometimes :(
Ha well...
Thank you anyways

@darkartswizard
Copy link

An alternate root cause is that the config file referenced in the Package.json under Scripts does not exist.
For a chrome.js example:
npm run chrome

In the package.json

"scripts": {
    "chrome": "wdio run config/chrome.js"
}

But there is no /config/chrome.js config file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants