@centreon/js-config 25.10.19 → 25.10.21
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.
|
@@ -22,15 +22,17 @@ Cypress.Commands.add(
|
|
|
22
22
|
bodyContent,
|
|
23
23
|
method = 'POST'
|
|
24
24
|
}: ExecuteActionViaClapiProps): Cypress.Chainable => {
|
|
25
|
-
return cy.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
return cy.ensureUserTokenApiV1().then(() =>
|
|
26
|
+
cy.request({
|
|
27
|
+
body: bodyContent,
|
|
28
|
+
headers: {
|
|
29
|
+
'Content-Type': 'application/json',
|
|
30
|
+
'centreon-auth-token': window.localStorage.getItem('userTokenApiV1')
|
|
31
|
+
},
|
|
32
|
+
method,
|
|
33
|
+
url: `${apiActionV1}?action=action&object=centreon_clapi`
|
|
34
|
+
})
|
|
35
|
+
);
|
|
34
36
|
}
|
|
35
37
|
);
|
|
36
38
|
|
|
@@ -150,17 +150,20 @@ Cypress.Commands.add(
|
|
|
150
150
|
updatetime
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
cy.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
153
|
+
cy.ensureUserTokenApiV1().then(() =>
|
|
154
|
+
cy.request({
|
|
155
|
+
body: {
|
|
156
|
+
results: [result]
|
|
157
|
+
},
|
|
158
|
+
headers: {
|
|
159
|
+
'Content-Type': 'application/json',
|
|
160
|
+
'centreon-auth-token':
|
|
161
|
+
window.localStorage.getItem('userTokenApiV1')
|
|
162
|
+
},
|
|
163
|
+
method: 'POST',
|
|
164
|
+
url: `${apiActionV1}?action=submit&object=centreon_submit_results`
|
|
165
|
+
})
|
|
166
|
+
);
|
|
164
167
|
}
|
|
165
168
|
);
|
|
166
169
|
|
package/cypress/e2e/commands.ts
CHANGED
|
@@ -418,6 +418,16 @@ Cypress.Commands.add(
|
|
|
418
418
|
}
|
|
419
419
|
);
|
|
420
420
|
|
|
421
|
+
// The token is set once in the feature's before(), so it is missing when a
|
|
422
|
+
// test is retried: get it again only in that case.
|
|
423
|
+
Cypress.Commands.add('ensureUserTokenApiV1', (): Cypress.Chainable => {
|
|
424
|
+
if (window.localStorage.getItem('userTokenApiV1')) {
|
|
425
|
+
return cy.wrap(null);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
return cy.setUserTokenApiV1();
|
|
429
|
+
});
|
|
430
|
+
|
|
421
431
|
interface PortBinding {
|
|
422
432
|
destination: number;
|
|
423
433
|
source: number;
|
|
@@ -912,6 +922,7 @@ declare global {
|
|
|
912
922
|
) => Cypress.Chainable;
|
|
913
923
|
copyWebContainerLogs: (props: CopyWebContainerLogsProps) => Cypress.Chainable;
|
|
914
924
|
createDirectory: (directoryPath: string) => Cypress.Chainable;
|
|
925
|
+
ensureUserTokenApiV1: () => Cypress.Chainable;
|
|
915
926
|
execInContainer: (
|
|
916
927
|
props: ExecInContainerProps,
|
|
917
928
|
options?: ExecInContainerOptions
|
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": "25.10.
|
|
4
|
+
"version": "25.10.21",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/centreon/centreon.git"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
53
53
|
"eslint-plugin-typescript-sort-keys": "^2.1.0",
|
|
54
54
|
"mochawesome": "^7.1.3",
|
|
55
|
-
"mysql2": "
|
|
55
|
+
"mysql2": "3.17.0",
|
|
56
56
|
"tar-fs": "^3.0.6",
|
|
57
57
|
"testcontainers": "^10.11.0"
|
|
58
58
|
}
|