@centreon/js-config 23.10.9 → 23.10.11-MON-20047-cace.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/commands.ts
CHANGED
|
@@ -348,6 +348,39 @@ Cypress.Commands.add(
|
|
|
348
348
|
}
|
|
349
349
|
);
|
|
350
350
|
|
|
351
|
+
interface Dashboard {
|
|
352
|
+
description?: string;
|
|
353
|
+
name: string;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
Cypress.Commands.add(
|
|
357
|
+
'insertDashboardList',
|
|
358
|
+
(fixtureFile: string): Cypress.Chainable => {
|
|
359
|
+
return cy.fixture(fixtureFile).then((dashboardList) => {
|
|
360
|
+
cy.wrap(
|
|
361
|
+
Promise.all(
|
|
362
|
+
dashboardList.map((dashboardBody: Dashboard) =>
|
|
363
|
+
cy.insertDashboard({ ...dashboardBody })
|
|
364
|
+
)
|
|
365
|
+
)
|
|
366
|
+
);
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
Cypress.Commands.add(
|
|
372
|
+
'insertDashboard',
|
|
373
|
+
(dashboardBody: Dashboard): Cypress.Chainable => {
|
|
374
|
+
return cy.request({
|
|
375
|
+
body: {
|
|
376
|
+
...dashboardBody
|
|
377
|
+
},
|
|
378
|
+
method: 'POST',
|
|
379
|
+
url: '/centreon/api/latest/configuration/dashboards'
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
|
|
351
384
|
Cypress.Commands.add('getTimeFromHeader', (): Cypress.Chainable => {
|
|
352
385
|
return cy.get('header div[data-cy="clock"]').then(($time) => {
|
|
353
386
|
const localTime = $time.children()[1].textContent;
|
|
@@ -374,6 +407,8 @@ declare global {
|
|
|
374
407
|
getTimeFromHeader: () => Cypress.Chainable;
|
|
375
408
|
getWebVersion: () => Cypress.Chainable;
|
|
376
409
|
hoverRootMenuItem: (rootItemNumber: number) => Cypress.Chainable;
|
|
410
|
+
insertDashboard: (dashboard: Dashboard) => Cypress.Chainable;
|
|
411
|
+
insertDashboardList: (fixtureFile: string) => Cypress.Chainable;
|
|
377
412
|
loginByTypeOfUser: ({
|
|
378
413
|
jsonName = 'admin',
|
|
379
414
|
loginViaApi = false
|
package/package.json
CHANGED