@centreon/js-config 23.10.11 → 23.10.13
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/commands.ts +35 -10
- package/package.json +1 -1
package/cypress/e2e/commands.ts
CHANGED
|
@@ -4,6 +4,8 @@ import './commands/configuration';
|
|
|
4
4
|
|
|
5
5
|
const apiLoginV2 = '/centreon/authentication/providers/configurations/local';
|
|
6
6
|
|
|
7
|
+
const artifactIllegalCharactersMatcher = /[,\s/|<>*?:"]/g;
|
|
8
|
+
|
|
7
9
|
Cypress.Commands.add('getWebVersion', (): Cypress.Chainable => {
|
|
8
10
|
return cy
|
|
9
11
|
.exec(
|
|
@@ -258,9 +260,13 @@ Cypress.Commands.add(
|
|
|
258
260
|
({
|
|
259
261
|
name = Cypress.env('dockerName')
|
|
260
262
|
}: StopWebContainerProps = {}): Cypress.Chainable => {
|
|
261
|
-
const logDirectory = `cypress/results/logs/${
|
|
262
|
-
|
|
263
|
-
|
|
263
|
+
const logDirectory = `cypress/results/logs/${Cypress.spec.name.replace(
|
|
264
|
+
artifactIllegalCharactersMatcher,
|
|
265
|
+
'_'
|
|
266
|
+
)}/${Cypress.currentTest.title.replace(
|
|
267
|
+
artifactIllegalCharactersMatcher,
|
|
268
|
+
'_'
|
|
269
|
+
)}`;
|
|
264
270
|
|
|
265
271
|
return cy
|
|
266
272
|
.visitEmptyPage()
|
|
@@ -277,6 +283,19 @@ Cypress.Commands.add(
|
|
|
277
283
|
destination: `${logDirectory}/centreon`,
|
|
278
284
|
source: '/var/log/centreon'
|
|
279
285
|
})
|
|
286
|
+
.then(() => {
|
|
287
|
+
if (Cypress.env('WEB_IMAGE_OS').includes('alma')) {
|
|
288
|
+
return cy.copyFromContainer({
|
|
289
|
+
destination: `${logDirectory}/php`,
|
|
290
|
+
source: '/var/log/php-fpm'
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
return cy.copyFromContainer({
|
|
295
|
+
destination: `${logDirectory}/php/`,
|
|
296
|
+
source: '/var/log/php8.1-fpm-centreon-error.log'
|
|
297
|
+
});
|
|
298
|
+
})
|
|
280
299
|
.stopContainer({ name });
|
|
281
300
|
}
|
|
282
301
|
);
|
|
@@ -290,10 +309,11 @@ Cypress.Commands.add(
|
|
|
290
309
|
({ name }: StopContainerProps): Cypress.Chainable => {
|
|
291
310
|
cy.exec(`docker logs ${name}`).then(({ stdout }) => {
|
|
292
311
|
cy.writeFile(
|
|
293
|
-
`cypress/results/logs/${
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
312
|
+
`cypress/results/logs/${Cypress.spec.name.replace(
|
|
313
|
+
artifactIllegalCharactersMatcher,
|
|
314
|
+
'_'
|
|
315
|
+
)}/${Cypress.currentTest.title.replace(
|
|
316
|
+
artifactIllegalCharactersMatcher,
|
|
297
317
|
'_'
|
|
298
318
|
)}/container-${name}.log`,
|
|
299
319
|
stdout
|
|
@@ -338,10 +358,15 @@ Cypress.Commands.add(
|
|
|
338
358
|
);
|
|
339
359
|
|
|
340
360
|
Cypress.Commands.add('getTimeFromHeader', (): Cypress.Chainable => {
|
|
341
|
-
return cy.
|
|
342
|
-
|
|
361
|
+
return cy.waitUntil(() => {
|
|
362
|
+
return cy.get('header div[data-cy="clock"]').then(($time) => {
|
|
363
|
+
const headerTime = $time.children()[1].textContent;
|
|
364
|
+
if (headerTime?.match(/\d+:\d+/)) {
|
|
365
|
+
return headerTime;
|
|
366
|
+
}
|
|
343
367
|
|
|
344
|
-
|
|
368
|
+
return false;
|
|
369
|
+
});
|
|
345
370
|
});
|
|
346
371
|
});
|
|
347
372
|
|
package/package.json
CHANGED