@centreon/js-config 23.10.11-timezone-test-stabilization.3 → 23.10.11-timezone-test-stabilization.5

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.
@@ -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(
@@ -259,9 +261,12 @@ Cypress.Commands.add(
259
261
  name = Cypress.env('dockerName')
260
262
  }: StopWebContainerProps = {}): Cypress.Chainable => {
261
263
  const logDirectory = `cypress/results/logs/${Cypress.spec.name.replace(
262
- /[,\s/|<>*?:"]/g,
264
+ artifactIllegalCharactersMatcher,
265
+ '_'
266
+ )}/${Cypress.currentTest.title.replace(
267
+ artifactIllegalCharactersMatcher,
263
268
  '_'
264
- )}/${Cypress.currentTest.title.replace(/[,\s/|<>*?:"]/g, '_')}`;
269
+ )}`;
265
270
 
266
271
  return cy
267
272
  .visitEmptyPage()
@@ -304,10 +309,11 @@ Cypress.Commands.add(
304
309
  ({ name }: StopContainerProps): Cypress.Chainable => {
305
310
  cy.exec(`docker logs ${name}`).then(({ stdout }) => {
306
311
  cy.writeFile(
307
- `cypress/results/logs/${
308
- Cypress.spec.name
309
- }/${Cypress.currentTest.title.replace(
310
- /,|\s|\//g,
312
+ `cypress/results/logs/${Cypress.spec.name.replace(
313
+ artifactIllegalCharactersMatcher,
314
+ '_'
315
+ )}/${Cypress.currentTest.title.replace(
316
+ artifactIllegalCharactersMatcher,
311
317
  '_'
312
318
  )}/container-${name}.log`,
313
319
  stdout
@@ -357,7 +363,7 @@ Cypress.Commands.add('getTimeFromHeader', (): Cypress.Chainable => {
357
363
 
358
364
  cy.log(`Time in header is ${localTime}`);
359
365
 
360
- return localTime;
366
+ return cy.wrap(localTime);
361
367
  });
362
368
  });
363
369
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@centreon/js-config",
3
3
  "description": "Centreon Frontend shared build configuration",
4
- "version": "23.10.11-timezone-test-stabilization.3",
4
+ "version": "23.10.11-timezone-test-stabilization.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/centreon/centreon-frontend.git"