-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
index.d.ts
61 lines (58 loc) · 1.4 KB
/
index.d.ts
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import type { Page } from 'playwright-core';
import type { Flags, Config, RunnerResult } from 'lighthouse';
export interface playwrightLighthouseConfig {
page?: Page;
url?: string;
port: number;
thresholds?: {
performance?: number;
accessibility?: number;
'best-practices'?: number;
seo?: number;
pwa?: number;
};
opts?: Flags;
config?: Config;
reports?: {
formats?: {
html?: boolean;
json?: boolean;
csv?: boolean;
};
directory?: string;
name?: string;
};
ignoreError?: boolean;
disableLogs?: boolean;
ignoreBrowserName?: boolean;
}
export interface playwrightLighthouseResult extends RunnerResult {
comparison?: string;
comparisonError?: string;
}
/**
* @description
* Performs lighthouse audit based on the testcafe lighthouse configuration
*
* @example
*
* import { playAudit } from 'playwright-lighthouse';
*
* test('user page performance with specific thresholds', async () => {
* await playAudit({
* page:Page,
* thresholds: {
* performance: 50,
* accessibility: 50,
* 'best-practices': 50,
* seo: 50,
* pwa: 50,
* },
* port: 9222
* });
* });
*
*/
export function playAudit(
playwrightLHConfiguration: playwrightLighthouseConfig
): Promise<playwrightLighthouseResult>;