【问题标题】:How to add browserstack capabilities using webdriverIO + Typescript?如何使用 webdriverIO + Typescript 添加浏览器堆栈功能?
【发布时间】:2021-05-24 21:28:06
【问题描述】:

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

这是我的 tsconfig.ts 文件:

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

【问题讨论】:

    标签: typescript webdriver-io browserstack


    【解决方案1】:

    你可以试试这个:

    capabilities: [{
        'bstack:options' : {
            "osVersion" : "10.0",
            "deviceName" : "Samsung Galaxy S20",
            "realMobile" : "true",
            "local" : "false",
            "userName" : "USERNAME",
            "accessKey" : "ACCESS_KEY",
        },
        "browserName" : "Android"
    }]
    

    Browserstack 站点有一个 Capabilities 生成器(选择右侧的 NodeJS)https://www.browserstack.com/automate/capabilities?tag=selenium-4

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-05-24
        • 2021-06-26
        • 1970-01-01
        • 2011-01-15
        相关资源
        最近更新 更多