【问题标题】:Getting an error when running "npx wdio config"运行“npx wdio config”时出错
【发布时间】:2021-07-28 07:31:34
【问题描述】:

当我尝试通过运行“npx wdio config”将“Hello World”测试套件设置到我的项目中时,出现以下错误。我按照https://webdriver.io/docs/gettingstarted 上的说明进行操作,但仍然无法正常工作。

谁能帮我解决这个问题:

WDIO Configuration Helper


? Where is your automation backend located? (Use arrow keys)
❯ On my local machine 
  In the cloud using Experitest 
  In the cloud using Sauce Labs 
  In the cloud using Browserstack or Testingbot or LambdaTest or a different service 
  I have my own Selenium cloud (node:2831) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'find' of undefined
    at Object.run (/Users/gustavosuarez/web/mo-appium-wdio-jasmine/node_modules/@wdio/cli/build/index.js:67:19)
    at Object.<anonymous> (/Users/gustavosuarez/web/mo-appium-wdio-jasmine/node_modules/@wdio/cli/bin/wdio.js:11:21)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47

【问题讨论】:

    标签: node.js reactjs webdriver-io


    【解决方案1】:

    似乎是最新版本的@wdio/cli 依赖项有问题。我通过使用旧版本解决了这个问题,它现在可以工作了("@wdio/cli": "7.3.1")。只需将该依赖项添加到您的 package.json 并再次运行 yarnnpm install,然后运行 ​​npx wdio config 即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-17
      • 2020-04-22
      • 2022-06-22
      • 1970-01-01
      • 2023-02-14
      • 2021-07-10
      • 2022-01-03
      • 2019-12-29
      相关资源
      最近更新 更多