forked from Shelex/cypress-allure-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
191 lines (187 loc) · 5.25 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
import { Category, ExecutorInfo } from 'allure-js-commons';
type LabelName =
| 'AS_ID'
| 'suite'
| 'parentSuite'
| 'subSuite'
| 'epic'
| 'feature'
| 'story'
| 'severity'
| 'tag'
| 'owner'
| 'lead'
| 'host'
| 'thread'
| 'testMethod'
| 'testClass'
| 'package'
| 'framework'
| 'language';
type LinkType = 'issue' | 'tms';
type ContentType =
| 'text/plain'
| 'application/xml'
| 'text/csv'
| 'text/tab-separated-values'
| 'text/css'
| 'text/uri-list'
| 'image/svg+xml'
| 'image/png'
| 'application/json'
| 'video/webm'
| 'video/mp4'
| 'image/jpeg';
type Status = 'failed' | 'broken' | 'passed' | 'skipped';
type Severity = 'blocker' | 'critical' | 'normal' | 'minor' | 'trivial';
declare global {
namespace Cypress {
interface Chainable {
/**
* Parent command to start interaction with Allure API
*/
allure(): Allure;
}
interface Cypress {
/**
* Interface via Cypress global object
*/
Allure: {
reporter: {
getInterface(): Allure;
};
};
}
interface Allure {
/**
* Add Epic name to Allure
* @param {string} epic
*/
epic(epic: string): Allure;
/**
* add feature
* @param {string} feature
*/
feature(feature: string): Allure;
/**
* add Story name
* @param story
*/
story(story: string): Allure;
/**
* add Suite
* @param name
*/
suite(name: string): Allure;
/**
* Add Label
* @param name
* @param value
*/
label(name: LabelName, value: string): Allure;
/**
* Add Parameter
* @param name
* @param value
*/
parameter(name: string, value: string): Allure;
/**
* Add customized link
* @param {string} url
* @param {string} name
* @param type
*/
link(url: string, name?: string, type?: LinkType): Allure;
/**
* Add issue link
* @param name
* @param url
*/
issue(name: string, url: string): Allure;
/**
* Add test management system link
* @param name
* @param url
*/
tms(name: string, url: string): Allure;
/**
* Add test description in markdown format
* @param markdown
*/
description(markdown: string): Allure;
/**
* Add test description in html format
* @param html
*/
descriptionHtml(html: string): Allure;
/**
* Add test owner
* @param owner
*/
owner(owner: string): Allure;
/**
* Add severity level
* @param severity
*/
severity(severity: Severity): Allure;
/**
* Add tag
* @param tag
*/
tag(tag: string): Allure;
/**
* Attach environmental info
* @param info - <key, value> format
*/
writeEnvironmentInfo(info: Record<string, string>): Allure;
/**
* Attach test categories failures definition
* @param categories
*/
writeCategoriesDefinitions(categories: Category[]): Allure;
/**
* Attach executor information
* @param info executor information
*/
writeExecutorInfo(info: ExecutorInfo): Allure;
/**
* Attachment to current executable item (hook, test)
* @param name
* @param content
* @param type
*/
attachment(
name: string,
content: Buffer | string,
type: ContentType
): Allure;
/**
* Add attachment for current test
* (Screenshots are attached automatically)
* @param name
* @param content
* @param type
*/
testAttachment(
name: string,
content: Buffer | string,
type: ContentType
): Allure;
/**
* Log step into Test Execution Body
* @param name - step name
* @param isParent - log all commands into created step until next parent step, true by default
*/
step(name: string, isParent: boolean): Allure;
/**
* Start allure step with specified name
* @param name - name of step to create
*/
startStep(name: string): Allure;
/**
* End last created allure step
*/
endStep(): Allure;
}
}
}