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 }) => {})
})
{
"playwright/no-slowed-test": [
"error",
{
"allowConditional": false
}
]
}
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')
})