如何使用 webdriverIO + Typescript 添加浏览器堆栈功能?

问题描述

尝试设置 WebdriverIO + Typescript + browserstack,但是当我尝试添加如下所示的功能时,它说这些类型不可分配给类型“WebdriverIO”,不知道该怎么做。

enter image description here

这是我的 tsconfig.ts 文件

{
  "compilerOptions": {
    "target": "es5","module": "commonjs","strict": true,"esModuleInterop": true,"types": [
      "node","node-fetch","jest","webdriverio/async","wdio-wiremock-service"
    ]
  }
}

解决方法

您可以参考 https://github.com/browserstack/browserstack-examples-webdriverio/tree/main/resources/conf 中的示例测试和配置,并使用配置来设置您的测试。