How I can allow browser.pause? WDIO (wdio/no-pause) (plugin:wdio/recommended)

770 Views Asked by At

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

2

There are 2 best solutions below

0
On
  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()

0
On

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.