-
Notifications
You must be signed in to change notification settings - Fork 29
/
playwright-test.js
46 lines (45 loc) · 1.72 KB
/
playwright-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Source: https://github.com/playwright-community/eslint-plugin-playwright/blob/v1.5.1/src/index.ts#L101-L129
const recommended = {
'no-empty-pattern': 'off',
'playwright/expect-expect': 'warn',
'playwright/max-nested-describe': 'warn',
'playwright/missing-playwright-await': 'error',
'playwright/no-conditional-expect': 'warn',
'playwright/no-conditional-in-test': 'warn',
'playwright/no-element-handle': 'warn',
'playwright/no-eval': 'warn',
'playwright/no-focused-test': 'error',
'playwright/no-force-option': 'warn',
'playwright/no-nested-step': 'warn',
'playwright/no-networkidle': 'error',
'playwright/no-page-pause': 'warn',
'playwright/no-skipped-test': 'warn',
'playwright/no-standalone-expect': 'error',
'playwright/no-unsafe-references': 'error',
'playwright/no-useless-await': 'warn',
'playwright/no-useless-not': 'warn',
'playwright/no-wait-for-selector': 'warn',
'playwright/no-wait-for-timeout': 'warn',
'playwright/prefer-web-first-assertions': 'error',
'playwright/valid-describe-callback': 'error',
'playwright/valid-expect': 'error',
'playwright/valid-expect-in-promise': 'error',
'playwright/valid-title': 'error',
};
module.exports = {
rules: {
...recommended,
/**
* Require lowercase test names.
*
* 🔧 Fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
*/
'playwright/prefer-lowercase-title': 'warn',
/**
* Require using `toHaveLength` over explicitly checking lengths.
*
* 🔧 Fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
*/
'playwright/prefer-to-have-length': 'warn',
},
};