Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 1.18 KB

no-slowed-test.md

File metadata and controls

56 lines (42 loc) · 1.18 KB

Disallow usage of the .slow annotation (no-slowed-test)

Rule Details

Examples of incorrect code for this rule:

test.slow('slow this test', async ({ page }) => {})

test.describe('slow test inside describe', () => {
  test.slow()
})

test.describe('slow test conditionally', async ({ browserName }) => {
  test.slow(browserName === 'firefox', 'Working on it')
})

Examples of correct code for this rule:

test('this test', async ({ page }) => {})

test.describe('two tests', () => {
  test('one', async ({ page }) => {})
  test('two', async ({ page }) => {})
})

Options

{
  "playwright/no-slowed-test": [
    "error",
    {
      "allowConditional": false
    }
  ]
}

allowConditional

Setting this option to true will allow using test.slow() to conditionally mark a test as slow. This can be helpful if you want to prevent usage of test.slow being added by mistake but still allow slow tests based on browser/environment setup.

Example of correct code for the { "allowConditional": true } option:

test('foo', ({ browserName }) => {
  test.slow(browserName === 'firefox', 'Still working on it')
})