我正在使用 webdirevio 进行一些测试,我想按照此处所述从测试访问配置:
https://webdriver.io/docs/browserobject.html
但是当我在测试中编写 browser.config
时,标题中出现错误。
编辑:
根据评论中的要求,wdio 版本为 5.12.4。
我正在使用 cucumber.js,所以我将 console.log(browser.config)
放在我的步骤中,但即使是 IDE (Webstorm) 也无法识别它
如果我继续运行测试,我会在日志中收到错误
ERROR @wdio/runner: TSError: ⨯ Unable to compile TypeScript:
tests/features/step_definitions/steps.ts(84,25): error TS2339: Property 'config' does not exist on type 'BrowserObject'.
最佳答案
这是 webdriver.io 中的一个问题。
它已在提交中修复 https://github.com/webdriverio/webdriverio/commit/29690864b30efd163c1c82bc28ac124d7948e519
修复将在 v5.15.6 中出现
关于testing - Webdriver.io 中的类型 'config' 上不存在属性 'BrowserObject',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58322997/