@centreon/js-config 24.10.19 → 24.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
|
@@ -417,6 +417,16 @@ Cypress.Commands.add(
|
|
|
417
417
|
}
|
|
418
418
|
);
|
|
419
419
|
|
|
420
|
+
// The token is set once in the feature's before(), so it is missing when a
|
|
421
|
+
// test is retried: get it again only in that case.
|
|
422
|
+
Cypress.Commands.add('ensureUserTokenApiV1', (): Cypress.Chainable => {
|
|
423
|
+
if (window.localStorage.getItem('userTokenApiV1')) {
|
|
424
|
+
return cy.wrap(null);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
return cy.setUserTokenApiV1();
|
|
428
|
+
});
|
|
429
|
+
|
|
420
430
|
interface PortBinding {
|
|
421
431
|
destination: number;
|
|
422
432
|
source: number;
|
|
@@ -911,6 +921,7 @@ declare global {
|
|
|
911
921
|
) => Cypress.Chainable;
|
|
912
922
|
copyWebContainerLogs: (props: CopyWebContainerLogsProps) => Cypress.Chainable;
|
|
913
923
|
createDirectory: (directoryPath: string) => Cypress.Chainable;
|
|
924
|
+
ensureUserTokenApiV1: () => Cypress.Chainable;
|
|
914
925
|
execInContainer: (
|
|
915
926
|
props: ExecInContainerProps,
|
|
916
927
|
options?: ExecInContainerOptions
|
package/cypress/e2e/tasks.ts
CHANGED
|
@@ -188,7 +188,9 @@ export default (on: Cypress.PluginEvents): void => {
|
|
|
188
188
|
name,
|
|
189
189
|
portBindings = []
|
|
190
190
|
}: StartContainerProps) => {
|
|
191
|
-
let container = await new GenericContainer(image)
|
|
191
|
+
let container = await new GenericContainer(image)
|
|
192
|
+
.withName(name)
|
|
193
|
+
.withAddedCapabilities('SYS_NICE');
|
|
192
194
|
|
|
193
195
|
portBindings.forEach(({ source, destination }) => {
|
|
194
196
|
container = container.withExposedPorts({
|
package/package.json
CHANGED