@centreon/js-config 24.6.2 → 24.6.4
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.
|
@@ -48,7 +48,8 @@ export default ({
|
|
|
48
48
|
reporterOptions: {
|
|
49
49
|
configFile: `${__dirname}/reporter-config.js`
|
|
50
50
|
},
|
|
51
|
-
setupNodeEvents: async (
|
|
51
|
+
setupNodeEvents: async (cypressOn, config) => {
|
|
52
|
+
const on = require('cypress-on-fix')(cypressOn)
|
|
52
53
|
installLogsPrinter(on);
|
|
53
54
|
await esbuildPreprocessor(on, config);
|
|
54
55
|
tasks(on);
|
|
@@ -67,9 +68,11 @@ export default ({
|
|
|
67
68
|
WEB_IMAGE_VERSION: webImageVersion
|
|
68
69
|
},
|
|
69
70
|
execTimeout: 60000,
|
|
70
|
-
experimentalMemoryManagement: true,
|
|
71
71
|
requestTimeout: 20000,
|
|
72
|
-
retries:
|
|
72
|
+
retries: {
|
|
73
|
+
openMode: 0,
|
|
74
|
+
runMode: 2
|
|
75
|
+
},
|
|
73
76
|
screenshotsFolder: `${resultsFolder}/screenshots`,
|
|
74
77
|
video: isDevelopment,
|
|
75
78
|
videoCompression: 0,
|
package/cypress/e2e/plugins.ts
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
4
4
|
/* eslint-disable no-param-reassign */
|
|
5
5
|
|
|
6
|
+
import fs from 'fs';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
|
|
6
9
|
export default (
|
|
7
10
|
on: Cypress.PluginEvents,
|
|
8
11
|
config: Cypress.PluginConfigOptions
|
|
@@ -28,9 +31,43 @@ export default (
|
|
|
28
31
|
|
|
29
32
|
launchOptions.args.push(`--window-size=${width},${height}`);
|
|
30
33
|
}
|
|
34
|
+
launchOptions.args.push(`--window-size=${width},${height}`);
|
|
31
35
|
|
|
32
36
|
return launchOptions;
|
|
33
37
|
});
|
|
34
38
|
|
|
39
|
+
on('after:run', (results) => {
|
|
40
|
+
const testRetries: { [key: string]: boolean } = {};
|
|
41
|
+
if ('runs' in results) {
|
|
42
|
+
results.runs.forEach((run) => {
|
|
43
|
+
run.tests.forEach((test) => {
|
|
44
|
+
if (test.attempts && test.attempts.length > 1) {
|
|
45
|
+
const testTitle = test.title.join(' > '); // Convert the array to a string
|
|
46
|
+
testRetries[testTitle] = true;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
console.log('After run results:', results);
|
|
53
|
+
console.log('Test retries:', testRetries);
|
|
54
|
+
|
|
55
|
+
// Save the testRetries object to a file in the e2e/results directory
|
|
56
|
+
const resultFilePath = path.join(
|
|
57
|
+
__dirname,
|
|
58
|
+
'../../../../tests/e2e/results',
|
|
59
|
+
'hasRetries.json'
|
|
60
|
+
);
|
|
61
|
+
if (results.totalFailed > 0) {
|
|
62
|
+
fs.writeFileSync(resultFilePath, '{}');
|
|
63
|
+
} else if (Object.keys(testRetries).length > 0) {
|
|
64
|
+
// If tests succeeded but there were retries, write the retries to the file
|
|
65
|
+
fs.writeFileSync(resultFilePath, JSON.stringify(testRetries, null, 2));
|
|
66
|
+
} else {
|
|
67
|
+
// If no retries, empty the file
|
|
68
|
+
fs.writeFileSync(resultFilePath, '{}');
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
35
72
|
return config;
|
|
36
73
|
};
|
package/package.json
CHANGED