我如何允许 browser.pause? WDIO(wdio/无暂停)(插件:wdio/推荐)

发布于 2025-01-17 08:49:46 字数 314 浏览 4 评论 0 原文

我需要使用浏览器。如何允许浏览器。还是您知道解决此问题的另一种方法?

错误:不允许browser.pause()不允许(wdio/no pape)

屏幕截图,带有错误:

“在此处输入图像说明”

I need to use browser.pause, but I get error in ESLint. How I can allow browser.pause in eslintrc.json? Or maybe you know another way for resolving this?

Error: Unexpected browser.pause() not allowed (wdio/no-pause)

Screenshot with error:

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小猫一只 2025-01-24 08:49:46
  1. 在项目的根部创建.eslintrc。
  2. 将一些配置添加为:

 {
        "plugins": [
          "wdio"
        ],
        "extends": [
          "plugin:wdio/recommended",
          "eslint:recommended"
        ],
        "parserOptions": {
          "ecmaVersion": "latest",
          "sourceType": "module"
        },
        "env": {
          "es6": true,
          "mocha": true,
          "node": true
        },
        "rules": {
          "no-trailing-whitespace":false
          }
    
      }

对我而言,这修复了browser.pause()的问题

  1. create .eslintrc in the root of your project.
  2. Add some config as:

 {
        "plugins": [
          "wdio"
        ],
        "extends": [
          "plugin:wdio/recommended",
          "eslint:recommended"
        ],
        "parserOptions": {
          "ecmaVersion": "latest",
          "sourceType": "module"
        },
        "env": {
          "es6": true,
          "mocha": true,
          "node": true
        },
        "rules": {
          "no-trailing-whitespace":false
          }
    
      }

for me this fixed the issue with browser.pause()

我不会写诗 2025-01-24 08:49:46

将以下代码添加到名为“.eslintrc.yml”的文件中。如果该文件不存在,则必须创建它。

{
  "rules": {
    "wdio/no-pause":0,
   }
}

它不允许您在使用异步函数时暂停。因此,您需要通过专门指定来添加此规则。

Add below code to the file named ".eslintrc.yml". If this file does not exist, then you must create it.

{
  "rules": {
    "wdio/no-pause":0,
   }
}

It doesn't allow you to pause when using an async function. For this reason, you need to add this rule by specifying it specifically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文