-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathplaywright.ts
105 lines (102 loc) · 2.15 KB
/
playwright.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
const testsGenerator: Fig.Generator = {
custom: async (tokens, executeShellCommand) => {
// TODO: load the list of test files specified in testDir on playwright.config file
return [] as Fig.Suggestion[];
},
};
const browserSuggestions: Fig.Suggestion[] = [
{
name: "chromium",
displayName: "Chromium",
},
{
name: "chrome",
displayName: "Chrome",
},
{
name: "chrome-beta",
displayName: "Chrome Beta",
},
{
name: "msedge",
displayName: "Microsoft Edge",
},
{
name: "msedge-beta",
displayName: "Microsoft Edge Beta",
},
{
name: "msedge-dev",
displayName: "Microsoft Edge Dev",
},
{
name: "firefox",
displayName: "Firefox",
},
{
name: "webkit",
displayName: "WebKit",
},
];
const helpOption: Fig.Option = {
name: ["--help", "-h"],
description: "Display help for command",
priority: 1,
};
const completionSpec: Fig.Spec = {
name: "playwright",
description: "",
subcommands: [
{
name: "test",
description: "Run tests with Playwright Test",
args: {
name: "tests",
description: "Test files to run",
isOptional: true,
isVariadic: true,
template: ["filepaths", "folders"],
},
options: [
{
name: "-g",
description: "Run the test with the title",
args: {
name: "title",
},
},
{
name: "--headed",
description: "Run tests in headed browsers",
},
helpOption,
],
},
{
name: "install",
description: "Running without arguments will install default browsers",
args: {
name: "browsers",
description: "Browser to install",
isOptional: true,
isVariadic: true,
suggestions: browserSuggestions,
},
options: [
{
name: "--with-deps",
description: "Install system dependencies for browsers",
},
helpOption,
],
},
],
options: [
{
name: ["--version", "-V"],
description: "Output the version number",
},
helpOption,
],
};
export default completionSpec;