@allurereport/reader 3.0.0-beta.9 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/allure2/index.js +3 -0
- package/dist/allure2/model.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/xcresult/bundle.d.ts +7 -0
- package/dist/xcresult/bundle.js +68 -0
- package/dist/xcresult/index.d.ts +2 -0
- package/dist/xcresult/index.js +91 -0
- package/dist/xcresult/model.d.ts +61 -0
- package/dist/xcresult/model.js +1 -0
- package/dist/xcresult/utils.d.ts +42 -0
- package/dist/xcresult/utils.js +378 -0
- package/dist/xcresult/xcresulttool/cli.d.ts +10 -0
- package/dist/xcresult/xcresulttool/cli.js +42 -0
- package/dist/xcresult/xcresulttool/index.d.ts +7 -0
- package/dist/xcresult/xcresulttool/index.js +311 -0
- package/dist/xcresult/xcresulttool/legacy/index.d.ts +10 -0
- package/dist/xcresult/xcresulttool/legacy/index.js +455 -0
- package/dist/xcresult/xcresulttool/legacy/model.d.ts +74 -0
- package/dist/xcresult/xcresulttool/legacy/model.js +1 -0
- package/dist/xcresult/xcresulttool/legacy/parsing.d.ts +15 -0
- package/dist/xcresult/xcresulttool/legacy/parsing.js +41 -0
- package/dist/xcresult/xcresulttool/legacy/utils.d.ts +7 -0
- package/dist/xcresult/xcresulttool/legacy/utils.js +33 -0
- package/dist/xcresult/xcresulttool/legacy/xcModel.d.ts +357 -0
- package/dist/xcresult/xcresulttool/legacy/xcModel.js +5 -0
- package/dist/xcresult/xcresulttool/model.d.ts +17 -0
- package/dist/xcresult/xcresulttool/model.js +6 -0
- package/dist/xcresult/xcresulttool/utils.d.ts +3 -0
- package/dist/xcresult/xcresulttool/utils.js +74 -0
- package/dist/xcresult/xcresulttool/xcModel.d.ts +96 -0
- package/dist/xcresult/xcresulttool/xcModel.js +18 -0
- package/package.json +10 -8
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
export type XcObject<T extends string> = {
|
|
2
|
+
_type: {
|
|
3
|
+
_name: T;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
export type XcValue<Type extends string> = XcObject<Type> & {
|
|
7
|
+
_value: string;
|
|
8
|
+
};
|
|
9
|
+
export type XcArray<Element> = XcObject<"Array"> & {
|
|
10
|
+
_values: Element[];
|
|
11
|
+
};
|
|
12
|
+
export type XcSortedKeyValueArrayPair = XcObject<"SortedKeyValueArrayPair"> & {
|
|
13
|
+
key: XcString;
|
|
14
|
+
value: XcObject<string>;
|
|
15
|
+
};
|
|
16
|
+
export type XcSortedKeyValueArray = XcObject<"SortedKeyValueArray"> & {
|
|
17
|
+
storage: XcArray<XcSortedKeyValueArrayPair>;
|
|
18
|
+
};
|
|
19
|
+
export type XcBool = XcValue<"Bool">;
|
|
20
|
+
export type XcData = XcValue<"Data">;
|
|
21
|
+
export type XcDate = XcValue<"Date">;
|
|
22
|
+
export type XcDouble = XcValue<"Double">;
|
|
23
|
+
export type XcInt = XcValue<"Int">;
|
|
24
|
+
export type XcInt16 = XcValue<"Int16">;
|
|
25
|
+
export type XcInt32 = XcValue<"Int32">;
|
|
26
|
+
export type XcInt64 = XcValue<"Int64">;
|
|
27
|
+
export type XcInt8 = XcValue<"Int8">;
|
|
28
|
+
export type XcString = XcValue<"String">;
|
|
29
|
+
export type XcUInt16 = XcValue<"UInt16">;
|
|
30
|
+
export type XcUInt32 = XcValue<"UInt32">;
|
|
31
|
+
export type XcUInt64 = XcValue<"UInt64">;
|
|
32
|
+
export type XcUInt8 = XcValue<"UInt8">;
|
|
33
|
+
export type XcURL = XcValue<"URL">;
|
|
34
|
+
export type XcReference = XcObject<"Reference"> & {
|
|
35
|
+
id: XcString;
|
|
36
|
+
targetType?: XcTypeDefinition;
|
|
37
|
+
};
|
|
38
|
+
export type XcActionsInvocationRecord = XcObject<"ActionsInvocationRecord"> & {
|
|
39
|
+
metadataRef?: XcReference;
|
|
40
|
+
metrics: XcResultMetrics;
|
|
41
|
+
issues: XcResultIssueSummaries;
|
|
42
|
+
actions: XcArray<XcActionRecord>;
|
|
43
|
+
archive?: XcArchiveInfo;
|
|
44
|
+
};
|
|
45
|
+
export type XcResultMetrics = XcObject<"ResultMetrics"> & {
|
|
46
|
+
analyzerWarningCount: XcInt;
|
|
47
|
+
errorCount: XcInt;
|
|
48
|
+
testsCount: XcInt;
|
|
49
|
+
testsFailedCount: XcInt;
|
|
50
|
+
testsSkippedCount: XcInt;
|
|
51
|
+
warningCount: XcInt;
|
|
52
|
+
totalCoveragePercentage?: XcDouble;
|
|
53
|
+
};
|
|
54
|
+
export type XcResultIssueSummaries = XcObject<"ResultIssueSummaries"> & {
|
|
55
|
+
analyzerWarningSummaries: XcArray<XcIssueSummary>;
|
|
56
|
+
errorSummaries: XcArray<XcIssueSummary>;
|
|
57
|
+
testFailureSummaries: XcArray<XcTestFailureIssueSummary>;
|
|
58
|
+
warningSummaries: XcArray<XcIssueSummary>;
|
|
59
|
+
testWarningSummaries: XcArray<XcTestIssueSummary>;
|
|
60
|
+
};
|
|
61
|
+
export type XcActionRecord = XcObject<"ActionRecord"> & {
|
|
62
|
+
schemeCommandName: XcString;
|
|
63
|
+
schemeTaskName: XcString;
|
|
64
|
+
title?: XcString;
|
|
65
|
+
startedTime: XcDate;
|
|
66
|
+
endedTime: XcDate;
|
|
67
|
+
runDestination: XcActionRunDestinationRecord;
|
|
68
|
+
buildResult: XcActionResult;
|
|
69
|
+
actionResult: XcActionResult;
|
|
70
|
+
testPlanName?: XcString;
|
|
71
|
+
};
|
|
72
|
+
export type XcArchiveInfo = XcObject<"ArchiveInfo"> & {
|
|
73
|
+
path?: XcString;
|
|
74
|
+
};
|
|
75
|
+
export type XcTypeDefinition = XcObject<"TypeDefinition"> & {
|
|
76
|
+
name: XcString;
|
|
77
|
+
supertype?: XcTypeDefinition;
|
|
78
|
+
};
|
|
79
|
+
export type XcIssueSummary<Type extends string = "IssueSummary"> = XcObject<Type> & {
|
|
80
|
+
issueType: XcString;
|
|
81
|
+
message: XcString;
|
|
82
|
+
producingTarget?: XcString;
|
|
83
|
+
documentLocationInCreatingWorkspace?: XcDocumentLocation;
|
|
84
|
+
};
|
|
85
|
+
export type XcTestFailureIssueSummary = XcIssueSummary<"TestFailureIssueSummary"> & {
|
|
86
|
+
testCaseName: XcString;
|
|
87
|
+
};
|
|
88
|
+
export type XcTestIssueSummary = XcIssueSummary<"TestIssueSummary"> & {
|
|
89
|
+
testCaseName: XcString;
|
|
90
|
+
};
|
|
91
|
+
export type XcActionRunDestinationRecord = XcObject<"ActionRunDestinationRecord"> & {
|
|
92
|
+
displayName: XcString;
|
|
93
|
+
targetArchitecture: XcString;
|
|
94
|
+
targetDeviceRecord: XcActionDeviceRecord;
|
|
95
|
+
localComputerRecord: XcActionDeviceRecord;
|
|
96
|
+
targetSDKRecord: XcActionSDKRecord;
|
|
97
|
+
};
|
|
98
|
+
export type XcActionResult = XcObject<"ActionResult"> & {
|
|
99
|
+
resultName: XcString;
|
|
100
|
+
status: XcString;
|
|
101
|
+
metrics: XcResultMetrics;
|
|
102
|
+
issues: XcResultIssueSummaries;
|
|
103
|
+
coverage: XcCodeCoverageInfo;
|
|
104
|
+
timelineRef?: XcReference;
|
|
105
|
+
logRef?: XcReference;
|
|
106
|
+
testsRef?: XcReference;
|
|
107
|
+
diagnosticsRef?: XcReference;
|
|
108
|
+
consoleLogRef?: XcReference;
|
|
109
|
+
};
|
|
110
|
+
export type XcDocumentLocation = XcObject<"DocumentLocation"> & {
|
|
111
|
+
url: XcString;
|
|
112
|
+
concreteTypeName: XcString;
|
|
113
|
+
};
|
|
114
|
+
export type XcActionDeviceRecord = XcObject<"ActionDeviceRecord"> & {
|
|
115
|
+
name: XcString;
|
|
116
|
+
isConcreteDevice: XcBool;
|
|
117
|
+
operatingSystemVersion: XcString;
|
|
118
|
+
operatingSystemVersionWithBuildNumber: XcString;
|
|
119
|
+
nativeArchitecture: XcString;
|
|
120
|
+
modelName: XcString;
|
|
121
|
+
modelCode: XcString;
|
|
122
|
+
modelUTI: XcString;
|
|
123
|
+
identifier: XcString;
|
|
124
|
+
isWireless: XcBool;
|
|
125
|
+
cpuKind: XcString;
|
|
126
|
+
cpuCount?: XcInt;
|
|
127
|
+
cpuSpeedInMhz?: XcInt;
|
|
128
|
+
busSpeedInMhz?: XcInt;
|
|
129
|
+
ramSizeInMegabytes?: XcInt;
|
|
130
|
+
physicalCPUCoresPerPackage?: XcInt;
|
|
131
|
+
logicalCPUCoresPerPackage?: XcInt;
|
|
132
|
+
platformRecord: XcActionPlatformRecord;
|
|
133
|
+
};
|
|
134
|
+
export type XcActionSDKRecord = XcObject<"ActionSDKRecord"> & {
|
|
135
|
+
name: XcString;
|
|
136
|
+
identifier: XcString;
|
|
137
|
+
operatingSystemVersion: XcString;
|
|
138
|
+
isInternal: XcBool;
|
|
139
|
+
};
|
|
140
|
+
export type XcCodeCoverageInfo = XcObject<"CodeCoverageInfo"> & {
|
|
141
|
+
hasCoverageData: XcBool;
|
|
142
|
+
reportRef?: XcReference;
|
|
143
|
+
archiveRef?: XcReference;
|
|
144
|
+
};
|
|
145
|
+
export type XcActionPlatformRecord = XcObject<"ActionPlatformRecord"> & {
|
|
146
|
+
identifier: XcString;
|
|
147
|
+
userDescription: XcString;
|
|
148
|
+
};
|
|
149
|
+
export type XcActionTestPlanRunSummaries = XcObject<"ActionTestPlanRunSummaries"> & {
|
|
150
|
+
summaries: XcArray<XcActionTestPlanRunSummary>;
|
|
151
|
+
};
|
|
152
|
+
export type XcActionAbstractTestSummary<Type extends string> = XcObject<Type> & {
|
|
153
|
+
name?: XcString;
|
|
154
|
+
};
|
|
155
|
+
export type XcActionTestPlanRunSummary = XcActionAbstractTestSummary<"ActionTestPlanRunSummary"> & {
|
|
156
|
+
testableSummaries: XcArray<XcActionTestableSummary>;
|
|
157
|
+
};
|
|
158
|
+
export type XcActionTestableSummary = XcActionAbstractTestSummary<"ActionTestableSummary"> & {
|
|
159
|
+
identifierURL?: XcString;
|
|
160
|
+
projectRelativePath?: XcString;
|
|
161
|
+
targetName?: XcString;
|
|
162
|
+
testKind?: XcString;
|
|
163
|
+
tests: XcArray<XcActionTestSummaryIdentifiableObject>;
|
|
164
|
+
diagnosticsDirectoryName?: XcString;
|
|
165
|
+
failureSummaries: XcArray<XcActionTestFailureSummary>;
|
|
166
|
+
testLanguage?: XcString;
|
|
167
|
+
testRegion?: XcString;
|
|
168
|
+
};
|
|
169
|
+
export type XcActionTestSummaryIdentifiableObjectBase<Type extends string> = XcActionAbstractTestSummary<Type> & {
|
|
170
|
+
identifier?: XcString;
|
|
171
|
+
identifierURL?: XcString;
|
|
172
|
+
};
|
|
173
|
+
export type XcActionTestMetadata = XcActionTestSummaryIdentifiableObjectBase<"ActionTestMetadata"> & {
|
|
174
|
+
testStatus: XcString;
|
|
175
|
+
duration?: XcDouble;
|
|
176
|
+
summaryRef?: XcReference;
|
|
177
|
+
performanceMetricsCount?: XcInt;
|
|
178
|
+
failureSummariesCount?: XcInt;
|
|
179
|
+
activitySummariesCount?: XcInt;
|
|
180
|
+
};
|
|
181
|
+
export type XcActionTestSummaryGroup = XcActionTestSummaryIdentifiableObjectBase<"ActionTestSummaryGroup"> & {
|
|
182
|
+
duration: XcDouble;
|
|
183
|
+
subtests: XcArray<XcActionTestSummaryIdentifiableObject>;
|
|
184
|
+
skipNoticeSummary?: XcActionTestNoticeSummary;
|
|
185
|
+
summary?: XcString;
|
|
186
|
+
documentation: XcArray<XcTestDocumentation>;
|
|
187
|
+
trackedIssues: XcArray<XcIssueTrackingMetadata>;
|
|
188
|
+
tags: XcArray<XcTestTag>;
|
|
189
|
+
};
|
|
190
|
+
export type XcActionTestSummary = XcActionTestSummaryIdentifiableObjectBase<"ActionTestSummary"> & {
|
|
191
|
+
testStatus: XcString;
|
|
192
|
+
duration: XcDouble;
|
|
193
|
+
performanceMetrics: XcArray<XcActionTestPerformanceMetricSummary>;
|
|
194
|
+
failureSummaries: XcArray<XcActionTestFailureSummary>;
|
|
195
|
+
expectedFailures: XcArray<XcActionTestExpectedFailure>;
|
|
196
|
+
skipNoticeSummary?: XcActionTestNoticeSummary;
|
|
197
|
+
activitySummaries: XcArray<XcActionTestActivitySummary>;
|
|
198
|
+
repetitionPolicySummary?: XcActionTestRepetitionPolicySummary;
|
|
199
|
+
arguments: XcArray<XcTestArgument>;
|
|
200
|
+
configuration?: XcActionTestConfiguration;
|
|
201
|
+
warningSummaries: XcArray<XcActionTestIssueSummary>;
|
|
202
|
+
summary?: XcString;
|
|
203
|
+
documentation: XcArray<XcTestDocumentation>;
|
|
204
|
+
trackedIssues: XcArray<XcIssueTrackingMetadata>;
|
|
205
|
+
tags: XcArray<XcTestTag>;
|
|
206
|
+
};
|
|
207
|
+
export type XcActionTestSummaryIdentifiableObject = XcActionTestMetadata | XcActionTestSummary | XcActionTestSummaryGroup;
|
|
208
|
+
export declare const XcActionTestSummaryIdentifiableObjectTypes: readonly ["ActionTestMetadata", "ActionTestSummary", "ActionTestSummaryGroup"];
|
|
209
|
+
export type XcActionTestFailureSummary = XcObject<"ActionTestFailureSummary"> & {
|
|
210
|
+
message?: XcString;
|
|
211
|
+
fileName: XcString;
|
|
212
|
+
lineNumber: XcInt;
|
|
213
|
+
isPerformanceFailure: XcBool;
|
|
214
|
+
uuid: XcString;
|
|
215
|
+
issueType?: XcString;
|
|
216
|
+
detailedDescription?: XcString;
|
|
217
|
+
attachments: XcArray<XcActionTestAttachment>;
|
|
218
|
+
associatedError?: XcTestAssociatedError;
|
|
219
|
+
sourceCodeContext?: XcSourceCodeContext;
|
|
220
|
+
timestamp?: XcDate;
|
|
221
|
+
isTopLevelFailure: XcBool;
|
|
222
|
+
expression?: XcTestExpression;
|
|
223
|
+
};
|
|
224
|
+
export type XcActionTestAttachment = XcObject<"ActionTestAttachment"> & {
|
|
225
|
+
uniformTypeIdentifier: XcString;
|
|
226
|
+
name?: XcString;
|
|
227
|
+
uuid?: XcString;
|
|
228
|
+
timestamp?: XcDate;
|
|
229
|
+
userInfo?: XcSortedKeyValueArray;
|
|
230
|
+
lifetime: XcString;
|
|
231
|
+
inActivityIdentifier: XcInt;
|
|
232
|
+
filename?: XcString;
|
|
233
|
+
payloadRef?: XcReference;
|
|
234
|
+
payloadSize: XcInt;
|
|
235
|
+
};
|
|
236
|
+
export type XcTestAssociatedError = XcObject<"TestAssociatedError"> & {
|
|
237
|
+
domain?: XcString;
|
|
238
|
+
code?: XcInt;
|
|
239
|
+
userInfo?: XcSortedKeyValueArray;
|
|
240
|
+
};
|
|
241
|
+
export type XcSourceCodeContext = XcObject<"SourceCodeContext"> & {
|
|
242
|
+
location?: XcSourceCodeLocation;
|
|
243
|
+
callStack: XcArray<XcSourceCodeFrame>;
|
|
244
|
+
};
|
|
245
|
+
export type XcTestExpression = XcObject<"TestExpression"> & {
|
|
246
|
+
sourceCode: XcString;
|
|
247
|
+
value?: XcTestValue;
|
|
248
|
+
subexpressions: XcArray<XcTestExpression>;
|
|
249
|
+
};
|
|
250
|
+
export type XcSourceCodeLocation = XcObject<"SourceCodeLocation"> & {
|
|
251
|
+
filePath?: XcString;
|
|
252
|
+
lineNumber?: XcInt;
|
|
253
|
+
};
|
|
254
|
+
export type XcSourceCodeFrame = XcObject<"SourceCodeFrame"> & {
|
|
255
|
+
addressString?: XcString;
|
|
256
|
+
symbolInfo?: XcSourceCodeSymbolInfo;
|
|
257
|
+
};
|
|
258
|
+
export type XcSourceCodeSymbolInfo = XcObject<"SourceCodeSymbolInfo"> & {
|
|
259
|
+
imageName?: XcString;
|
|
260
|
+
symbolName?: XcString;
|
|
261
|
+
location?: XcSourceCodeLocation;
|
|
262
|
+
};
|
|
263
|
+
export type XcActionTestPerformanceMetricSummary = XcObject<"ActionTestPerformanceMetricSummary"> & {
|
|
264
|
+
displayName: XcString;
|
|
265
|
+
unitOfMeasurement: XcString;
|
|
266
|
+
measurements: XcArray<XcDouble>;
|
|
267
|
+
identifier?: XcString;
|
|
268
|
+
baselineName?: XcString;
|
|
269
|
+
baselineAverage?: XcDouble;
|
|
270
|
+
maxPercentRegression?: XcDouble;
|
|
271
|
+
maxPercentRelativeStandardDeviation?: XcDouble;
|
|
272
|
+
maxRegression?: XcDouble;
|
|
273
|
+
maxStandardDeviation?: XcDouble;
|
|
274
|
+
polarity?: XcString;
|
|
275
|
+
};
|
|
276
|
+
export type XcActionTestExpectedFailure = XcObject<"ActionTestExpectedFailure"> & {
|
|
277
|
+
uuid: XcString;
|
|
278
|
+
failureReason?: XcString;
|
|
279
|
+
failureSummary?: XcActionTestFailureSummary;
|
|
280
|
+
isTopLevelFailure: XcBool;
|
|
281
|
+
};
|
|
282
|
+
export type XcActionTestNoticeSummary = XcObject<"ActionTestNoticeSummary"> & {
|
|
283
|
+
message?: XcString;
|
|
284
|
+
fileName: XcString;
|
|
285
|
+
lineNumber: XcInt;
|
|
286
|
+
timestamp?: XcDate;
|
|
287
|
+
};
|
|
288
|
+
export type XcActionTestActivitySummary = XcObject<"ActionTestActivitySummary"> & {
|
|
289
|
+
title: XcString;
|
|
290
|
+
activityType: XcString;
|
|
291
|
+
uuid: XcString;
|
|
292
|
+
start?: XcDate;
|
|
293
|
+
finish?: XcDate;
|
|
294
|
+
attachments: XcArray<XcActionTestAttachment>;
|
|
295
|
+
subactivities: XcArray<XcActionTestActivitySummary>;
|
|
296
|
+
failureSummaryIDs: XcArray<XcString>;
|
|
297
|
+
expectedFailureIDs: XcArray<XcString>;
|
|
298
|
+
warningSummaryIDs: XcArray<XcString>;
|
|
299
|
+
};
|
|
300
|
+
export type XcActionTestRepetitionPolicySummary = XcObject<"ActionTestRepetitionPolicySummary"> & {
|
|
301
|
+
iteration?: XcInt;
|
|
302
|
+
totalIterations?: XcInt;
|
|
303
|
+
repetitionMode?: XcString;
|
|
304
|
+
};
|
|
305
|
+
export type XcTestArgument = XcObject<"TestArgument"> & {
|
|
306
|
+
parameter?: XcTestParameter;
|
|
307
|
+
identifier?: XcString;
|
|
308
|
+
description: XcString;
|
|
309
|
+
debugDescription?: XcString;
|
|
310
|
+
typeName?: XcString;
|
|
311
|
+
value: XcTestValue;
|
|
312
|
+
};
|
|
313
|
+
export type XcActionTestConfiguration = XcObject<"ActionTestConfiguration"> & {
|
|
314
|
+
values: XcSortedKeyValueArray;
|
|
315
|
+
};
|
|
316
|
+
export type XcActionTestIssueSummary = XcObject<"ActionTestIssueSummary"> & {
|
|
317
|
+
message?: XcString;
|
|
318
|
+
fileName: XcString;
|
|
319
|
+
lineNumber: XcInt;
|
|
320
|
+
uuid: XcString;
|
|
321
|
+
issueType?: XcString;
|
|
322
|
+
detailedDescription?: XcString;
|
|
323
|
+
attachments: XcArray<XcActionTestAttachment>;
|
|
324
|
+
associatedError?: XcTestAssociatedError;
|
|
325
|
+
sourceCodeContext?: XcSourceCodeContext;
|
|
326
|
+
timestamp?: XcDate;
|
|
327
|
+
};
|
|
328
|
+
export type XcTestDocumentation = XcObject<"TestDocumentation"> & {
|
|
329
|
+
content: XcString;
|
|
330
|
+
format: XcString;
|
|
331
|
+
};
|
|
332
|
+
export type XcIssueTrackingMetadata = XcObject<"IssueTrackingMetadata"> & {
|
|
333
|
+
identifier: XcString;
|
|
334
|
+
url?: XcURL;
|
|
335
|
+
comment?: XcString;
|
|
336
|
+
summary: XcString;
|
|
337
|
+
};
|
|
338
|
+
export type XcTestTag = XcObject<"TestTag"> & {
|
|
339
|
+
identifier: XcString;
|
|
340
|
+
name: XcString;
|
|
341
|
+
anchors: XcArray<XcString>;
|
|
342
|
+
};
|
|
343
|
+
export type XcTestParameter = XcObject<"TestParameter"> & {
|
|
344
|
+
label: XcString;
|
|
345
|
+
name?: XcString;
|
|
346
|
+
typeName?: XcString;
|
|
347
|
+
fullyQualifiedTypeName?: XcString;
|
|
348
|
+
};
|
|
349
|
+
export type XcTestValue = XcObject<"TestValue"> & {
|
|
350
|
+
description: XcString;
|
|
351
|
+
debugDescription?: XcString;
|
|
352
|
+
typeName?: XcString;
|
|
353
|
+
fullyQualifiedTypeName?: XcString;
|
|
354
|
+
label?: XcString;
|
|
355
|
+
isCollection: XcBool;
|
|
356
|
+
children: XcArray<XcTestValue>;
|
|
357
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ResultFile } from "@allurereport/plugin-api";
|
|
2
|
+
import type { RawTestResult } from "@allurereport/reader-api";
|
|
3
|
+
export declare abstract class XcresultParser {
|
|
4
|
+
protected readonly xcResultPath: string;
|
|
5
|
+
protected readonly createAttachmentFile: AttachmentFileFactory | undefined;
|
|
6
|
+
constructor(options: ParsingOptions);
|
|
7
|
+
abstract parse(): AsyncGenerator<ResultFile | RawTestResult, void, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export type ParsingState = {
|
|
10
|
+
suites: readonly string[];
|
|
11
|
+
bundle?: string;
|
|
12
|
+
};
|
|
13
|
+
export type ParsingOptions = {
|
|
14
|
+
xcResultPath: string;
|
|
15
|
+
createAttachmentFile?: AttachmentFileFactory;
|
|
16
|
+
};
|
|
17
|
+
export type AttachmentFileFactory = (attachmentUuid: string, uniqueFileName: string) => Promise<ResultFile | undefined>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AttachmentFileFactory } from "./model.js";
|
|
2
|
+
export declare const parseWithExportedAttachments: (xcResultPath: string, fn: (createAttachmentFile: AttachmentFileFactory) => Promise<void>) => Promise<void>;
|
|
3
|
+
export declare const mapWellKnownAttachmentName: (name: string | undefined, timestamp: number | undefined) => string | undefined;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { BufferResultFile } from "@allurereport/reader-api";
|
|
2
|
+
import console from "node:console";
|
|
3
|
+
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { exportAttachments } from "./cli.js";
|
|
7
|
+
const AUTO_VIDEO_CAPTURE_NAME = "kXCTAttachmentScreenRecording";
|
|
8
|
+
const AUTO_SCREENSHOT_CAPTURE_NAME = "kXCTAttachmentLegacyScreenImageData";
|
|
9
|
+
export const parseWithExportedAttachments = async (xcResultPath, fn) => {
|
|
10
|
+
let attachmentsDir;
|
|
11
|
+
try {
|
|
12
|
+
attachmentsDir = await mkdtemp(path.join(tmpdir(), "allure-reader-xcresult-"));
|
|
13
|
+
await exportAttachments(xcResultPath, attachmentsDir);
|
|
14
|
+
await fn(createAttachmentFileFactoryFn(attachmentsDir));
|
|
15
|
+
}
|
|
16
|
+
finally {
|
|
17
|
+
if (attachmentsDir) {
|
|
18
|
+
try {
|
|
19
|
+
await rm(attachmentsDir, { recursive: true, force: true });
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
console.error("when parsing", xcResultPath, "- can't remove the tmp dir", attachmentsDir, ":", e);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export const mapWellKnownAttachmentName = (name, timestamp) => {
|
|
28
|
+
switch (name) {
|
|
29
|
+
case AUTO_VIDEO_CAPTURE_NAME:
|
|
30
|
+
return "Screen Recording";
|
|
31
|
+
case AUTO_SCREENSHOT_CAPTURE_NAME:
|
|
32
|
+
return timestamp ? `Screenshot at ${timestampToString(timestamp)}` : "Screenshot";
|
|
33
|
+
default:
|
|
34
|
+
return name;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const timestampToString = (timestamp) => {
|
|
38
|
+
const date = new Date(timestamp);
|
|
39
|
+
return date.toLocaleString(undefined, {
|
|
40
|
+
year: "numeric",
|
|
41
|
+
month: "numeric",
|
|
42
|
+
day: "numeric",
|
|
43
|
+
hour: "numeric",
|
|
44
|
+
minute: "numeric",
|
|
45
|
+
second: "numeric",
|
|
46
|
+
fractionalSecondDigits: 3,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const createAttachmentFileFactoryFn = (attachmentsDir) => async (attachmentUuid, uniqueFileName) => {
|
|
50
|
+
const fileExtension = path.extname(uniqueFileName);
|
|
51
|
+
const attachmentFilePath = path.join(attachmentsDir, attachmentUuid);
|
|
52
|
+
const [firstAttemptOk, firstAttemptResult] = await tryReadFile(attachmentFilePath, uniqueFileName);
|
|
53
|
+
if (firstAttemptOk) {
|
|
54
|
+
return firstAttemptResult;
|
|
55
|
+
}
|
|
56
|
+
const errors = [firstAttemptResult];
|
|
57
|
+
if (firstAttemptResult?.code === "ENOENT" && fileExtension) {
|
|
58
|
+
const attachmentPathWithExt = `${attachmentFilePath}${fileExtension}`;
|
|
59
|
+
const [secondAttemptOk, secondAttemptResult] = await tryReadFile(attachmentPathWithExt, uniqueFileName);
|
|
60
|
+
if (secondAttemptOk) {
|
|
61
|
+
return secondAttemptResult;
|
|
62
|
+
}
|
|
63
|
+
errors.push(secondAttemptResult);
|
|
64
|
+
}
|
|
65
|
+
console.error("Can't read attachment", attachmentUuid, "in", attachmentsDir, ":", ...errors);
|
|
66
|
+
};
|
|
67
|
+
const tryReadFile = async (attachmentPath, attachmentName) => {
|
|
68
|
+
try {
|
|
69
|
+
return [true, new BufferResultFile(await readFile(attachmentPath), attachmentName)];
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
return [false, e];
|
|
73
|
+
}
|
|
74
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export type XcTests = {
|
|
2
|
+
testPlanConfigurations: XcConfiguration[];
|
|
3
|
+
devices: XcDevice[];
|
|
4
|
+
testNodes: XcTestNode[];
|
|
5
|
+
};
|
|
6
|
+
export type XcConfiguration = {
|
|
7
|
+
configurationId: string;
|
|
8
|
+
configurationName: string;
|
|
9
|
+
};
|
|
10
|
+
export type XcDevice = {
|
|
11
|
+
deviceId?: string;
|
|
12
|
+
deviceName: string;
|
|
13
|
+
architecture: string;
|
|
14
|
+
modelName: string;
|
|
15
|
+
platform?: string;
|
|
16
|
+
osVersion: string;
|
|
17
|
+
};
|
|
18
|
+
export type XcTestNode = {
|
|
19
|
+
nodeIdentifier?: string;
|
|
20
|
+
nodeType: XcTestNodeType;
|
|
21
|
+
name: string;
|
|
22
|
+
details?: string;
|
|
23
|
+
duration?: string;
|
|
24
|
+
result?: XcTestResult;
|
|
25
|
+
tags?: string[];
|
|
26
|
+
children?: XcTestNode[];
|
|
27
|
+
};
|
|
28
|
+
export declare const XcTestNodeTypeValues: readonly ["Test Plan", "Unit test bundle", "UI test bundle", "Test Suite", "Test Case", "Device", "Test Plan Configuration", "Arguments", "Repetition", "Test Case Run", "Failure Message", "Source Code Reference", "Attachment", "Expression", "Test Value"];
|
|
29
|
+
export type XcTestNodeType = (typeof XcTestNodeTypeValues)[number];
|
|
30
|
+
export declare const XcTestResultValues: readonly ["Passed", "Failed", "Skipped", "Expected Failure", "unknown"];
|
|
31
|
+
export type XcTestResult = (typeof XcTestResultValues)[number];
|
|
32
|
+
export type XcTestDetails = {
|
|
33
|
+
testIdentifier: string;
|
|
34
|
+
testName: string;
|
|
35
|
+
testDescription: string;
|
|
36
|
+
duration: string;
|
|
37
|
+
startTime?: number;
|
|
38
|
+
testPlanConfiguration: XcConfiguration[];
|
|
39
|
+
devices: XcDevice[];
|
|
40
|
+
arguments?: XcTestResultArgument[];
|
|
41
|
+
testRuns: XcTestNode[];
|
|
42
|
+
testResult: XcTestResult;
|
|
43
|
+
hasPerformanceMetrics: boolean;
|
|
44
|
+
hasMediaAttachments: boolean;
|
|
45
|
+
tags?: string[];
|
|
46
|
+
bugs?: XcBug[];
|
|
47
|
+
functionName?: string;
|
|
48
|
+
};
|
|
49
|
+
export type XcTestResultArgument = {
|
|
50
|
+
value: string;
|
|
51
|
+
};
|
|
52
|
+
export type XcBug = {
|
|
53
|
+
url?: string;
|
|
54
|
+
identifier?: string;
|
|
55
|
+
title?: string;
|
|
56
|
+
};
|
|
57
|
+
export type XcActivities = {
|
|
58
|
+
testIdentifier: string;
|
|
59
|
+
testName: string;
|
|
60
|
+
testRuns: XcTestRunActivity[];
|
|
61
|
+
};
|
|
62
|
+
export type XcTestRunActivity = {
|
|
63
|
+
device: XcDevice;
|
|
64
|
+
testPlanConfiguration: XcConfiguration;
|
|
65
|
+
arguments?: XcTestRunArgument[];
|
|
66
|
+
activities: XcActivityNode[];
|
|
67
|
+
};
|
|
68
|
+
export type XcTestRunArgument = {
|
|
69
|
+
value: string;
|
|
70
|
+
};
|
|
71
|
+
export type XcActivityNode = {
|
|
72
|
+
title: string;
|
|
73
|
+
startTime?: number;
|
|
74
|
+
attachments?: XcAttachment[];
|
|
75
|
+
childActivities?: XcActivityNode[];
|
|
76
|
+
};
|
|
77
|
+
export type XcAttachment = {
|
|
78
|
+
name: string;
|
|
79
|
+
payloadId?: string;
|
|
80
|
+
uuid: string;
|
|
81
|
+
timestamp: number;
|
|
82
|
+
lifetime?: string;
|
|
83
|
+
};
|
|
84
|
+
export type XcTestAttachmentDetails = {
|
|
85
|
+
attachments: XcTestAttachment[];
|
|
86
|
+
testIdentifier: string;
|
|
87
|
+
};
|
|
88
|
+
export type XcTestAttachment = {
|
|
89
|
+
configurationName: string;
|
|
90
|
+
deviceId: string;
|
|
91
|
+
deviceName: string;
|
|
92
|
+
exportedFileName: string;
|
|
93
|
+
isAssociatedWithFailure: boolean;
|
|
94
|
+
suggestedHumanReadableName: string;
|
|
95
|
+
timestamp: number;
|
|
96
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const XcTestNodeTypeValues = [
|
|
2
|
+
"Test Plan",
|
|
3
|
+
"Unit test bundle",
|
|
4
|
+
"UI test bundle",
|
|
5
|
+
"Test Suite",
|
|
6
|
+
"Test Case",
|
|
7
|
+
"Device",
|
|
8
|
+
"Test Plan Configuration",
|
|
9
|
+
"Arguments",
|
|
10
|
+
"Repetition",
|
|
11
|
+
"Test Case Run",
|
|
12
|
+
"Failure Message",
|
|
13
|
+
"Source Code Reference",
|
|
14
|
+
"Attachment",
|
|
15
|
+
"Expression",
|
|
16
|
+
"Test Value",
|
|
17
|
+
];
|
|
18
|
+
export const XcTestResultValues = ["Passed", "Failed", "Skipped", "Expected Failure", "unknown"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/reader",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Collection of utilities which helps to process different kind of test results as Allure Results",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -26,20 +26,22 @@
|
|
|
26
26
|
"test": "vitest run"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@allurereport/core-api": "3.0.
|
|
30
|
-
"@allurereport/plugin-api": "3.0.
|
|
31
|
-
"@allurereport/reader-api": "3.0.
|
|
29
|
+
"@allurereport/core-api": "3.0.1",
|
|
30
|
+
"@allurereport/plugin-api": "3.0.1",
|
|
31
|
+
"@allurereport/reader-api": "3.0.1",
|
|
32
32
|
"fast-xml-parser": "^4.5.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@stylistic/eslint-plugin": "^2.6.1",
|
|
36
|
+
"@types/archiver": "^6.0.3",
|
|
36
37
|
"@types/eslint": "^8.56.11",
|
|
37
38
|
"@types/node": "^20.17.9",
|
|
38
39
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
39
40
|
"@typescript-eslint/parser": "^8.0.0",
|
|
40
|
-
"@vitest/runner": "^2.1.
|
|
41
|
-
"allure-js-commons": "^3.
|
|
42
|
-
"allure-vitest": "^3.
|
|
41
|
+
"@vitest/runner": "^2.1.9",
|
|
42
|
+
"allure-js-commons": "^3.3.3",
|
|
43
|
+
"allure-vitest": "^3.3.3",
|
|
44
|
+
"archiver": "^7.0.1",
|
|
43
45
|
"eslint": "^8.57.0",
|
|
44
46
|
"eslint-config-prettier": "^9.1.0",
|
|
45
47
|
"eslint-plugin-import": "^2.29.1",
|
|
@@ -49,6 +51,6 @@
|
|
|
49
51
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
50
52
|
"rimraf": "^6.0.1",
|
|
51
53
|
"typescript": "^5.6.3",
|
|
52
|
-
"vitest": "^2.1.
|
|
54
|
+
"vitest": "^2.1.9"
|
|
53
55
|
}
|
|
54
56
|
}
|