我正在将 WebdriverIo 与 NodeJs 框架一起使用。我的整个代码在本地系统中运行良好。脚本运行良好。但是当我在 Heroku 中运行时,我遇到了以下错误
~ $ npx wdio run wdio.conf.js --spec ./features/sanity-test/test.feature
wdio run <configPath>
Run your WDIO configuration file to initialize your tests. (default)
Options:
--version Show version number [boolean]
Documentation: https://webdriver.io
@wdio/cli (v7.25.4)
Error: Couldn't find plugin "local" runner, neither as wdio scoped package "@wdio/local-runner" nor as community package "wdio-local-runner". Please make sure you have it installed!
at initialisePlugin (/app/node_modules/@wdio/cli/node_modules/@wdio/utils/build/initialisePlugin.js:41:11)
at new Launcher (/app/node_modules/@wdio/cli/build/launcher.js:54:53)
at launch (/app/node_modules/@wdio/cli/build/commands/run.js:125:22)
at Object.handler (/app/node_modules/@wdio/cli/build/commands/run.js:165:16)
at /app/node_modules/yargs/build/index.cjs:1:8993
at j (/app/node_modules/yargs/build/index.cjs:1:4956)
at _.handleValidationAndGetResult (/app/node_modules/yargs/build/index.cjs:1:8962)
at _.applyMiddlewareAndGetResult (/app/node_modules/yargs/build/index.cjs:1:9604)
at _.runCommand (/app/node_modules/yargs/build/index.cjs:1:7231)
at [runYargsParserAndExecuteCommands] (/app/node_modules/yargs/build/index.cjs:1:58539)
npm notice
npm notice New major version of npm available! 9.8.1 -> 10.2.3
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.2.3
npm notice Run npm install -g [email protected] to update!
npm notice
我附上我的package.json以供参考。
{
"name": "testingsanity",
"version": "1.0.0",
"description": "test",
"main": "index.js",
"scripts": {
"test": "npx wdio run wdio.conf.js --spec ./features/sanity-test/test.feature",
"wdio": "wdio run wdio.conf.js --spec ./features/sanity-test/test.feature",
"start":"npx wdio run wdio.conf.js --spec ./features/sanity-test/test.feature"
},
"author": "testing",
"license": "ISC",
"devDependencies": {
"@wdio/local-runner": "^7.25.4",
"@wdio/spec-reporter": "^8.11.2",
"chromedriver": "~117.0.3",
"wdio-chromedriver-service": "^8.1.1"
},
"dependencies": {
"@wdio/cli": "^7.25.4",
"@wdio/cucumber-framework": "^7.25.4",
"cucumber-html-reporter": "^5.5.0",
"fs-extra": "^11.1.1",
"puppeteer": "^21.3.8",
"wdio-cucumberjs-json-reporter": "^4.4.3"
}
}
请求帮忙
您能分享一下您是如何解决这个问题的吗?