@elisra-devops/docgen-data-provider 0.4.16 → 0.6.0
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/bin/helpers/helper.js +22 -7
- package/bin/helpers/helper.js.map +1 -1
- package/bin/helpers/tfs.js +62 -77
- package/bin/helpers/tfs.js.map +1 -1
- package/bin/index.d.ts +3 -1
- package/bin/index.js +17 -31
- package/bin/index.js.map +1 -1
- package/bin/models/tfs-data.d.ts +11 -1
- package/bin/models/tfs-data.js +59 -14
- package/bin/models/tfs-data.js.map +1 -1
- package/bin/modules/GitDataProvider.js +213 -259
- package/bin/modules/GitDataProvider.js.map +1 -1
- package/bin/modules/MangementDataProvider.js +26 -43
- package/bin/modules/MangementDataProvider.js.map +1 -1
- package/bin/modules/PipelinesDataProvider.js +57 -82
- package/bin/modules/PipelinesDataProvider.js.map +1 -1
- package/bin/modules/ResultDataProvider.d.ts +89 -0
- package/bin/modules/ResultDataProvider.js +409 -0
- package/bin/modules/ResultDataProvider.js.map +1 -0
- package/bin/modules/TestDataProvider.d.ts +6 -4
- package/bin/modules/TestDataProvider.js +220 -250
- package/bin/modules/TestDataProvider.js.map +1 -1
- package/bin/modules/TicketsDataProvider.js +259 -300
- package/bin/modules/TicketsDataProvider.js.map +1 -1
- package/bin/modules/test/gitDataProvider.test.js +67 -76
- package/bin/modules/test/gitDataProvider.test.js.map +1 -1
- package/bin/modules/test/managmentDataProvider.test.js +16 -25
- package/bin/modules/test/managmentDataProvider.test.js.map +1 -1
- package/bin/modules/test/pipelineDataProvider.test.js +32 -41
- package/bin/modules/test/pipelineDataProvider.test.js.map +1 -1
- package/bin/modules/test/testDataProvider.test.js +67 -75
- package/bin/modules/test/testDataProvider.test.js.map +1 -1
- package/bin/modules/test/ticketsDataProvider.test.js +39 -48
- package/bin/modules/test/ticketsDataProvider.test.js.map +1 -1
- package/package.json +17 -11
- package/src/index.ts +19 -15
- package/src/models/tfs-data.ts +29 -8
- package/src/modules/ResultDataProvider.ts +496 -0
- package/src/modules/TestDataProvider.ts +150 -235
- package/src/modules/test/testDataProvider.test.ts +82 -104
- package/tsconfig.json +2 -2
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tfs_1 = require("../helpers/tfs");
|
|
4
|
+
const tfs_data_1 = require("../models/tfs-data");
|
|
5
|
+
const xml2js = require("xml2js");
|
|
6
|
+
const logger_1 = require("../utils/logger");
|
|
7
|
+
class ResultDataProvider {
|
|
8
|
+
orgUrl = '';
|
|
9
|
+
token = '';
|
|
10
|
+
constructor(orgUrl, token) {
|
|
11
|
+
this.orgUrl = orgUrl;
|
|
12
|
+
this.token = token;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves test suites by test plan ID and processes them into a flat structure with hierarchy names.
|
|
16
|
+
*/
|
|
17
|
+
async fetchTestSuites(testPlanId, projectName, selectedSuiteIds, isHierarchyGroupName = true) {
|
|
18
|
+
try {
|
|
19
|
+
const treeUrl = `${this.orgUrl}${projectName}/_apis/testplan/Plans/${testPlanId}/Suites?asTreeView=true`;
|
|
20
|
+
const { value: treeTestSuites, count: treeCount } = await tfs_1.TFSServices.getItemContent(treeUrl, this.token);
|
|
21
|
+
if (treeCount === 0)
|
|
22
|
+
throw new Error('No test suites found');
|
|
23
|
+
const flatTestSuites = this.flattenSuites(treeTestSuites);
|
|
24
|
+
const filteredSuites = this.filterSuites(flatTestSuites, selectedSuiteIds);
|
|
25
|
+
const suiteMap = this.createSuiteMap(treeTestSuites);
|
|
26
|
+
return filteredSuites.map((testSuite) => ({
|
|
27
|
+
testSuiteId: testSuite.id,
|
|
28
|
+
testGroupName: this.buildTestGroupName(testSuite.id, suiteMap, isHierarchyGroupName),
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
logger_1.default.error(`Error during fetching Test Suites: ${error.message}`);
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Flattens a hierarchical suite structure into a single-level array.
|
|
38
|
+
*/
|
|
39
|
+
flattenSuites(suites) {
|
|
40
|
+
const flatSuites = [];
|
|
41
|
+
const flatten = (suites) => {
|
|
42
|
+
suites.forEach((suite) => {
|
|
43
|
+
flatSuites.push(suite);
|
|
44
|
+
if (suite.children)
|
|
45
|
+
flatten(suite.children);
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
flatten(suites);
|
|
49
|
+
return flatSuites;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Filters test suites based on the selected suite IDs.
|
|
53
|
+
*/
|
|
54
|
+
filterSuites(testSuites, selectedSuiteIds) {
|
|
55
|
+
return selectedSuiteIds
|
|
56
|
+
? testSuites.filter((suite) => selectedSuiteIds.includes(suite.id))
|
|
57
|
+
: testSuites.filter((suite) => suite.parentSuite);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Creates a quick-lookup map of suites by their IDs.
|
|
61
|
+
*/
|
|
62
|
+
createSuiteMap(suites) {
|
|
63
|
+
const suiteMap = new Map();
|
|
64
|
+
const addToMap = (suites) => {
|
|
65
|
+
suites.forEach((suite) => {
|
|
66
|
+
suiteMap.set(suite.id, suite);
|
|
67
|
+
if (suite.children)
|
|
68
|
+
addToMap(suite.children);
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
addToMap(suites);
|
|
72
|
+
return suiteMap;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Constructs the test group name using a hierarchical format.
|
|
76
|
+
*/
|
|
77
|
+
buildTestGroupName(suiteId, suiteMap, isHierarchyGroupName) {
|
|
78
|
+
if (!isHierarchyGroupName)
|
|
79
|
+
return suiteMap.get(suiteId)?.name || '';
|
|
80
|
+
let currentSuite = suiteMap.get(suiteId);
|
|
81
|
+
let path = currentSuite?.name || '';
|
|
82
|
+
while (currentSuite?.parentSuite) {
|
|
83
|
+
const parentSuite = suiteMap.get(currentSuite.parentSuite.id);
|
|
84
|
+
if (!parentSuite)
|
|
85
|
+
break;
|
|
86
|
+
path = `${parentSuite.name}/${path}`;
|
|
87
|
+
currentSuite = parentSuite;
|
|
88
|
+
}
|
|
89
|
+
const parts = path.split('/');
|
|
90
|
+
return parts.length > 3
|
|
91
|
+
? `${parts[1]}/.../${parts[parts.length - 1]}`
|
|
92
|
+
: `${parts[1]}/${parts[parts.length - 1]}`;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Fetches test points by suite ID.
|
|
96
|
+
*/
|
|
97
|
+
async fetchTestPoints(projectName, testPlanId, testSuiteId) {
|
|
98
|
+
try {
|
|
99
|
+
const url = `${this.orgUrl}${projectName}/_apis/testplan/Plans/${testPlanId}/Suites/${testSuiteId}/TestPoint?includePointDetails=true`;
|
|
100
|
+
const { value: testPoints, count } = await tfs_1.TFSServices.getItemContent(url, this.token);
|
|
101
|
+
return count !== 0 ? testPoints.map(this.mapTestPoint) : [];
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
logger_1.default.error(`Error during fetching Test Points: ${error.message}`);
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Maps raw test point data to a simplified object.
|
|
110
|
+
*/
|
|
111
|
+
mapTestPoint(testPoint) {
|
|
112
|
+
return {
|
|
113
|
+
testCaseId: testPoint.testCaseReference.id,
|
|
114
|
+
testCaseName: testPoint.testCaseReference.name,
|
|
115
|
+
configurationName: testPoint.configuration?.name,
|
|
116
|
+
outcome: testPoint.results?.outcome,
|
|
117
|
+
lastRunId: testPoint.results?.lastTestRunId,
|
|
118
|
+
lastResultId: testPoint.results?.lastResultId,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Fetches test cases by suite ID.
|
|
123
|
+
*/
|
|
124
|
+
async fetchTestCasesBySuiteId(projectName, testPlanId, suiteId) {
|
|
125
|
+
const url = `${this.orgUrl}${projectName}/_apis/testplan/Plans/${testPlanId}/Suites/${suiteId}/TestCase?witFields=Microsoft.VSTS.TCM.Steps`;
|
|
126
|
+
const { value: testCases } = await tfs_1.TFSServices.getItemContent(url, this.token);
|
|
127
|
+
return testCases;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Fetches iterations data by run and result IDs.
|
|
131
|
+
*/
|
|
132
|
+
async fetchIterations(projectName, runId, resultId) {
|
|
133
|
+
const url = `${this.orgUrl}${projectName}/_apis/test/runs/${runId}/Results/${resultId}/iterations`;
|
|
134
|
+
const { value: iterations } = await tfs_1.TFSServices.getItemContent(url, this.token);
|
|
135
|
+
return iterations;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Converts run status from API format to a more readable format.
|
|
139
|
+
*/
|
|
140
|
+
convertRunStatus(status) {
|
|
141
|
+
switch (status) {
|
|
142
|
+
case 'passed':
|
|
143
|
+
return 'Passed';
|
|
144
|
+
case 'failed':
|
|
145
|
+
return 'Failed';
|
|
146
|
+
case 'notApplicable':
|
|
147
|
+
return 'Not Applicable';
|
|
148
|
+
default:
|
|
149
|
+
return 'Unspecified';
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Parses test steps from XML format into a structured array.
|
|
154
|
+
*/
|
|
155
|
+
parseTestSteps(xmlSteps) {
|
|
156
|
+
const stepsList = [];
|
|
157
|
+
xml2js.parseString(xmlSteps, { explicitArray: false }, (err, result) => {
|
|
158
|
+
if (err) {
|
|
159
|
+
logger_1.default.warn('Failed to parse XML test steps.');
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const stepsArray = Array.isArray(result.steps?.step) ? result.steps.step : [result.steps?.step];
|
|
163
|
+
stepsArray.forEach((stepObj) => {
|
|
164
|
+
const step = new tfs_data_1.TestSteps();
|
|
165
|
+
step.action = stepObj.parameterizedString?.[0]?._ || '';
|
|
166
|
+
step.expected = stepObj.parameterizedString?.[1]?._ || '';
|
|
167
|
+
stepsList.push(step);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
return stepsList;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Aligns test steps with their corresponding iterations.
|
|
174
|
+
*/
|
|
175
|
+
alignStepsWithIterations(testData, iterations) {
|
|
176
|
+
const detailedResults = [];
|
|
177
|
+
const iterationsMap = this.createIterationsMap(iterations);
|
|
178
|
+
for (const testItem of testData) {
|
|
179
|
+
for (const point of testItem.testPointsItems) {
|
|
180
|
+
const testCase = testItem.testCasesItems.find((tc) => tc.workItem.id === point.testCaseId);
|
|
181
|
+
if (!testCase)
|
|
182
|
+
continue;
|
|
183
|
+
const steps = this.parseTestSteps(testCase.workItem.workItemFields[0]['Microsoft.VSTS.TCM.Steps']);
|
|
184
|
+
const iterationKey = `${point.lastRunId}-${point.lastResultId}`;
|
|
185
|
+
const iteration = iterationsMap[iterationKey]?.iteration;
|
|
186
|
+
if (!iteration)
|
|
187
|
+
continue;
|
|
188
|
+
for (const actionResult of iteration.actionResults) {
|
|
189
|
+
const stepIndex = parseInt(actionResult.stepIdentifier, 10) - 2;
|
|
190
|
+
if (!steps[stepIndex])
|
|
191
|
+
continue;
|
|
192
|
+
// const actionPath = actionResult.actionPath;
|
|
193
|
+
// const testStepAttachments = iteration.attachments.find(
|
|
194
|
+
// (attachment: any) => attachment.actionPath === actionPath
|
|
195
|
+
// );
|
|
196
|
+
detailedResults.push({
|
|
197
|
+
testId: point.testCaseId,
|
|
198
|
+
testName: point.testCaseName,
|
|
199
|
+
stepNo: stepIndex + 1,
|
|
200
|
+
stepAction: steps[stepIndex].action,
|
|
201
|
+
stepExpected: steps[stepIndex].expected,
|
|
202
|
+
stepStatus: actionResult.outcome !== 'Unspecified' ? actionResult.outcome : '',
|
|
203
|
+
stepComments: actionResult.errorMessage || '',
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return detailedResults;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Creates a mapping of iterations by their unique keys.
|
|
212
|
+
*/
|
|
213
|
+
createIterationsMap(iterations) {
|
|
214
|
+
return iterations.reduce((map, iterationItem) => {
|
|
215
|
+
if (iterationItem.iteration) {
|
|
216
|
+
const key = `${iterationItem.lastRunId}-${iterationItem.lastResultId}`;
|
|
217
|
+
map[key] = iterationItem;
|
|
218
|
+
}
|
|
219
|
+
return map;
|
|
220
|
+
}, {});
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Fetches test data for all suites, including test points and test cases.
|
|
224
|
+
*/
|
|
225
|
+
async fetchTestData(suites, projectName, testPlanId) {
|
|
226
|
+
return Promise.all(suites.map((suite) => Promise.all([
|
|
227
|
+
this.fetchTestPoints(projectName, testPlanId, suite.testSuiteId),
|
|
228
|
+
this.fetchTestCasesBySuiteId(projectName, testPlanId, suite.testSuiteId),
|
|
229
|
+
])
|
|
230
|
+
.then(([testPointsItems, testCasesItems]) => ({ ...suite, testPointsItems, testCasesItems }))
|
|
231
|
+
.catch((error) => {
|
|
232
|
+
logger_1.default.error(`Error occurred for suite ${suite.testSuiteId}: ${error.message}`);
|
|
233
|
+
return suite;
|
|
234
|
+
})));
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Fetches iterations for all test points within the given test data.
|
|
238
|
+
*/
|
|
239
|
+
async fetchAllIterations(testData, projectName) {
|
|
240
|
+
const pointsToFetch = testData
|
|
241
|
+
.filter((item) => item.testPointsItems && item.testPointsItems.length > 0)
|
|
242
|
+
.flatMap((item) => {
|
|
243
|
+
const { testSuiteId, testPointsItems } = item;
|
|
244
|
+
const validPoints = testPointsItems.filter((point) => point.lastRunId && point.lastResultId);
|
|
245
|
+
return validPoints.map((point) => this.fetchIterationData(projectName, testSuiteId, point));
|
|
246
|
+
});
|
|
247
|
+
return Promise.all(pointsToFetch);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Fetches iteration data for a specific test point.
|
|
251
|
+
*/
|
|
252
|
+
async fetchIterationData(projectName, testSuiteId, point) {
|
|
253
|
+
const { lastRunId, lastResultId } = point;
|
|
254
|
+
const iterations = await this.fetchIterations(projectName, lastRunId.toString(), lastResultId.toString());
|
|
255
|
+
return {
|
|
256
|
+
testSuiteId,
|
|
257
|
+
lastRunId,
|
|
258
|
+
lastResultId,
|
|
259
|
+
iteration: iterations.length > 0 ? iterations[iterations.length - 1] : undefined,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Combines the results of test group result summary, test results summary, and detailed results summary into a single key-value pair array.
|
|
264
|
+
*/
|
|
265
|
+
async getCombinedResultsSummary(testPlanId, projectName, selectedSuiteIds, addConfiguration = false, isHierarchyGroupName = false) {
|
|
266
|
+
const combinedResults = [];
|
|
267
|
+
try {
|
|
268
|
+
// Fetch test suites
|
|
269
|
+
const suites = await this.fetchTestSuites(testPlanId, projectName, selectedSuiteIds, isHierarchyGroupName);
|
|
270
|
+
// Prepare test data for summaries
|
|
271
|
+
const testPointsPromises = suites.map((suite) => this.fetchTestPoints(projectName, testPlanId, suite.testSuiteId)
|
|
272
|
+
.then((testPointsItems) => ({ ...suite, testPointsItems }))
|
|
273
|
+
.catch((error) => {
|
|
274
|
+
logger_1.default.error(`Error occurred for suite ${suite.testSuiteId}: ${error.message}`);
|
|
275
|
+
return { ...suite, testPointsItems: [] };
|
|
276
|
+
}));
|
|
277
|
+
const testPoints = await Promise.all(testPointsPromises);
|
|
278
|
+
// 1. Calculate Test Group Result Summary
|
|
279
|
+
const summarizedResults = testPoints.map((testPoint) => {
|
|
280
|
+
const groupResultSummary = this.calculateGroupResultSummary(testPoint.testPointsItems || []);
|
|
281
|
+
return { ...testPoint, groupResultSummary };
|
|
282
|
+
});
|
|
283
|
+
const totalSummary = this.calculateTotalSummary(summarizedResults);
|
|
284
|
+
const testGroupArray = summarizedResults.map((item) => ({
|
|
285
|
+
testGroupName: item.testGroupName,
|
|
286
|
+
...item.groupResultSummary,
|
|
287
|
+
}));
|
|
288
|
+
testGroupArray.push({ testGroupName: 'Total', ...totalSummary });
|
|
289
|
+
// Add test group result summary to combined results
|
|
290
|
+
combinedResults.push({
|
|
291
|
+
contentControl: 'test-group-summary-content-control',
|
|
292
|
+
data: testGroupArray,
|
|
293
|
+
skin: 'test-result-test-group-summary-table',
|
|
294
|
+
});
|
|
295
|
+
// 2. Calculate Test Results Summary
|
|
296
|
+
const flattenedTestPoints = this.flattenTestPoints(testPoints);
|
|
297
|
+
const testResultsSummary = flattenedTestPoints.map((testPoint) => this.formatTestResult(testPoint, addConfiguration));
|
|
298
|
+
// Add test results summary to combined results
|
|
299
|
+
combinedResults.push({
|
|
300
|
+
contentControl: 'test-result-summary-content-control',
|
|
301
|
+
data: testResultsSummary,
|
|
302
|
+
skin: 'test-result-table',
|
|
303
|
+
});
|
|
304
|
+
// 3. Calculate Detailed Results Summary
|
|
305
|
+
const testData = await this.fetchTestData(suites, projectName, testPlanId);
|
|
306
|
+
const iterations = await this.fetchAllIterations(testData, projectName);
|
|
307
|
+
const detailedResultsSummary = this.alignStepsWithIterations(testData, iterations);
|
|
308
|
+
// Add detailed results summary to combined results
|
|
309
|
+
combinedResults.push({
|
|
310
|
+
contentControl: 'detailed-test-result-content-control',
|
|
311
|
+
data: detailedResultsSummary,
|
|
312
|
+
skin: 'detailed-test-result-table',
|
|
313
|
+
});
|
|
314
|
+
return combinedResults;
|
|
315
|
+
}
|
|
316
|
+
catch (error) {
|
|
317
|
+
logger_1.default.error(`Error during getCombinedResultsSummary: ${error.message}`);
|
|
318
|
+
return combinedResults; // Return whatever is computed even in case of error
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Calculates a summary of test group results.
|
|
323
|
+
*/
|
|
324
|
+
calculateGroupResultSummary(testPointsItems) {
|
|
325
|
+
const summary = {
|
|
326
|
+
passed: 0,
|
|
327
|
+
failed: 0,
|
|
328
|
+
notApplicable: 0,
|
|
329
|
+
blocked: 0,
|
|
330
|
+
notRun: 0,
|
|
331
|
+
total: testPointsItems.length,
|
|
332
|
+
successPercentage: '0.00%',
|
|
333
|
+
};
|
|
334
|
+
testPointsItems.forEach((item) => {
|
|
335
|
+
switch (item.outcome) {
|
|
336
|
+
case 'passed':
|
|
337
|
+
summary.passed++;
|
|
338
|
+
break;
|
|
339
|
+
case 'failed':
|
|
340
|
+
summary.failed++;
|
|
341
|
+
break;
|
|
342
|
+
case 'notApplicable':
|
|
343
|
+
summary.notApplicable++;
|
|
344
|
+
break;
|
|
345
|
+
case 'blocked':
|
|
346
|
+
summary.blocked++;
|
|
347
|
+
break;
|
|
348
|
+
default:
|
|
349
|
+
summary.notRun++;
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
summary.successPercentage =
|
|
353
|
+
summary.total > 0 ? `${((summary.passed / summary.total) * 100).toFixed(2)}%` : '0.00%';
|
|
354
|
+
return summary;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Calculates the total summary of all test group results.
|
|
358
|
+
*/
|
|
359
|
+
calculateTotalSummary(results) {
|
|
360
|
+
const totalSummary = results.reduce((acc, { groupResultSummary }) => {
|
|
361
|
+
acc.passed += groupResultSummary.passed;
|
|
362
|
+
acc.failed += groupResultSummary.failed;
|
|
363
|
+
acc.notApplicable += groupResultSummary.notApplicable;
|
|
364
|
+
acc.blocked += groupResultSummary.blocked;
|
|
365
|
+
acc.notRun += groupResultSummary.notRun;
|
|
366
|
+
acc.total += groupResultSummary.total;
|
|
367
|
+
return acc;
|
|
368
|
+
}, {
|
|
369
|
+
passed: 0,
|
|
370
|
+
failed: 0,
|
|
371
|
+
notApplicable: 0,
|
|
372
|
+
blocked: 0,
|
|
373
|
+
notRun: 0,
|
|
374
|
+
total: 0,
|
|
375
|
+
successPercentage: '0.00%',
|
|
376
|
+
});
|
|
377
|
+
totalSummary.successPercentage =
|
|
378
|
+
totalSummary.total > 0 ? `${((totalSummary.passed / totalSummary.total) * 100).toFixed(2)}%` : '0.00%';
|
|
379
|
+
return totalSummary;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Flattens the test points for easier access.
|
|
383
|
+
*/
|
|
384
|
+
flattenTestPoints(testPoints) {
|
|
385
|
+
return testPoints
|
|
386
|
+
.filter((point) => point.testPointsItems && point.testPointsItems.length > 0)
|
|
387
|
+
.flatMap((point) => {
|
|
388
|
+
const { testPointsItems, ...restOfPoint } = point;
|
|
389
|
+
return testPointsItems.map((item) => ({ ...restOfPoint, ...item }));
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Formats a test result for display.
|
|
394
|
+
*/
|
|
395
|
+
formatTestResult(testPoint, addConfiguration) {
|
|
396
|
+
const formattedResult = {
|
|
397
|
+
testGroupName: testPoint.testGroupName,
|
|
398
|
+
testId: testPoint.testCaseId,
|
|
399
|
+
testName: testPoint.testCaseName,
|
|
400
|
+
runStatus: this.convertRunStatus(testPoint.outcome),
|
|
401
|
+
};
|
|
402
|
+
if (addConfiguration) {
|
|
403
|
+
formattedResult.configuration = testPoint.configurationName;
|
|
404
|
+
}
|
|
405
|
+
return formattedResult;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
exports.default = ResultDataProvider;
|
|
409
|
+
//# sourceMappingURL=ResultDataProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResultDataProvider.js","sourceRoot":"","sources":["../../src/modules/ResultDataProvider.ts"],"names":[],"mappings":";;AAAA,wCAA6C;AAC7C,iDAA+C;AAC/C,iCAAiC;AACjC,4CAAqC;AAErC,MAAqB,kBAAkB;IACrC,MAAM,GAAW,EAAE,CAAC;IACpB,KAAK,GAAW,EAAE,CAAC;IAEnB,YAAY,MAAc,EAAE,KAAa;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IAC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CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACK,gBAAgB,CAAC,SAAc,EAAE,gBAAyB;QAChE,MAAM,eAAe,GAAQ;YAC3B,aAAa,EAAE,SAAS,CAAC,aAAa;YACtC,MAAM,EAAE,SAAS,CAAC,UAAU;YAC5B,QAAQ,EAAE,SAAS,CAAC,YAAY;YAChC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC;SACpD,CAAC;QAEF,IAAI,gBAAgB,EAAE,CAAC;YACrB,eAAe,CAAC,aAAa,GAAG,SAAS,CAAC,iBAAiB,CAAC;QAC9D,CAAC;QAED,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AA1eD,qCA0eC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { suiteData } from
|
|
2
|
-
import { TestSteps } from
|
|
1
|
+
import { suiteData } from '../helpers/helper';
|
|
2
|
+
import { TestSteps } from '../models/tfs-data';
|
|
3
3
|
export default class TestDataProvider {
|
|
4
4
|
orgUrl: string;
|
|
5
5
|
token: string;
|
|
@@ -10,8 +10,10 @@ export default class TestDataProvider {
|
|
|
10
10
|
GetTestSuitesForPlan(project: string, planid: string): Promise<any>;
|
|
11
11
|
GetTestSuitesByPlan(project: string, planId: string, recursive: boolean): Promise<any>;
|
|
12
12
|
GetTestSuiteById(project: string, planId: string, suiteId: string, recursive: boolean): Promise<any>;
|
|
13
|
-
GetTestCasesBySuites(project: string, planId: string, suiteId: string, recursiv: boolean,
|
|
14
|
-
StructureTestCase(project: string, testCases: any, suite: suiteData,
|
|
13
|
+
GetTestCasesBySuites(project: string, planId: string, suiteId: string, recursiv: boolean, includeRequirements: boolean, CustomerRequirementId: boolean, includeBugs: boolean, includeSeverity: boolean): Promise<Array<any>>;
|
|
14
|
+
StructureTestCase(project: string, testCases: any, suite: suiteData, includeRequirements: boolean, CustomerRequirementId: boolean, includeBugs: boolean, includeSeverity: boolean): Promise<Array<any>>;
|
|
15
|
+
private createBugRelation;
|
|
16
|
+
private createNewRequirement;
|
|
15
17
|
ParseSteps(steps: string): TestSteps[];
|
|
16
18
|
GetTestCases(project: string, planId: string, suiteId: string): Promise<any>;
|
|
17
19
|
GetTestPoint(project: string, planId: string, suiteId: string, testCaseId: string): Promise<any>;
|