@centreon/js-config 25.2.2 → 25.3.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/cypress/e2e/plugins.ts +7 -16
- package/package.json +1 -1
package/cypress/e2e/plugins.ts
CHANGED
|
@@ -36,36 +36,27 @@ export default (
|
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
on('after:run', (results) => {
|
|
39
|
-
const testRetries: { [key: string]:
|
|
39
|
+
const testRetries: { [key: string]: Number } = {};
|
|
40
40
|
if ('runs' in results) {
|
|
41
41
|
results.runs.forEach((run) => {
|
|
42
42
|
run.tests.forEach((test) => {
|
|
43
|
-
|
|
43
|
+
console.log(test)
|
|
44
|
+
if (test.attempts && test.attempts.length > 1 && test.state === 'passed') {
|
|
44
45
|
const testTitle = test.title.join(' > '); // Convert the array to a string
|
|
45
|
-
testRetries[testTitle] =
|
|
46
|
+
testRetries[testTitle] = test.attempts.length - 1;
|
|
46
47
|
}
|
|
47
48
|
});
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
console.log('After run results:', results);
|
|
52
|
-
console.log('Test retries:', testRetries);
|
|
53
|
-
|
|
54
52
|
// Save the testRetries object to a file in the e2e/results directory
|
|
55
53
|
const resultFilePath = path.join(
|
|
56
54
|
__dirname,
|
|
57
55
|
'../../../../tests/e2e/results',
|
|
58
|
-
'
|
|
56
|
+
'retries.json'
|
|
59
57
|
);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} else if (Object.keys(testRetries).length > 0) {
|
|
63
|
-
// If tests succeeded but there were retries, write the retries to the file
|
|
64
|
-
fs.writeFileSync(resultFilePath, JSON.stringify(testRetries, null, 2));
|
|
65
|
-
} else {
|
|
66
|
-
// If no retries, empty the file
|
|
67
|
-
fs.writeFileSync(resultFilePath, '{}');
|
|
68
|
-
}
|
|
58
|
+
|
|
59
|
+
fs.writeFileSync(resultFilePath, JSON.stringify(testRetries, null, 2));
|
|
69
60
|
});
|
|
70
61
|
|
|
71
62
|
return config;
|
package/package.json
CHANGED