@camunda/e2e-test-suite 0.0.812 → 0.0.814
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/dist/pages/8.8/FormJsPage.d.ts +2 -0
- package/dist/pages/8.8/FormJsPage.js +9 -0
- package/dist/tests/8.10/optimize-data-filters-api.spec.d.ts +1 -0
- package/dist/tests/8.10/optimize-data-filters-api.spec.js +185 -0
- package/dist/tests/8.8/web-modeler-user-flows.spec.js +34 -31
- package/dist/utils/apiHelpers.d.ts +18 -0
- package/dist/utils/apiHelpers.js +62 -1
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ declare class FormJsPage {
|
|
|
9
9
|
readonly textField: Locator;
|
|
10
10
|
readonly documentPreview: Locator;
|
|
11
11
|
readonly keyInput: Locator;
|
|
12
|
+
readonly fieldLabelInput: Locator;
|
|
12
13
|
readonly uploadMultipleFilesToggle: Locator;
|
|
13
14
|
readonly documentReferenceInput: Locator;
|
|
14
15
|
readonly generalPanel: Locator;
|
|
@@ -26,6 +27,7 @@ declare class FormJsPage {
|
|
|
26
27
|
clickGenerateFormButton(): Promise<void>;
|
|
27
28
|
dragAndDrop(source: Locator, target: Locator): Promise<void>;
|
|
28
29
|
fillKeyInput(key: string): Promise<void>;
|
|
30
|
+
fillFieldLabel(label: string): Promise<void>;
|
|
29
31
|
enableUploadMultipleFiles(): Promise<void>;
|
|
30
32
|
filldocumentReferenceInput(key: string): Promise<void>;
|
|
31
33
|
clickGeneralPropertiesPanel(): Promise<void>;
|
|
@@ -13,6 +13,7 @@ class FormJsPage {
|
|
|
13
13
|
textField;
|
|
14
14
|
documentPreview;
|
|
15
15
|
keyInput;
|
|
16
|
+
fieldLabelInput;
|
|
16
17
|
uploadMultipleFilesToggle;
|
|
17
18
|
documentReferenceInput;
|
|
18
19
|
generalPanel;
|
|
@@ -33,6 +34,7 @@ class FormJsPage {
|
|
|
33
34
|
this.documentPreview = page.locator('button[data-field-type="documentPreview"]');
|
|
34
35
|
this.filePicker = page.locator('button[data-field-type="filepicker"]');
|
|
35
36
|
this.keyInput = page.getByRole('textbox', { name: 'key' });
|
|
37
|
+
this.fieldLabelInput = page.locator('#bio-properties-panel-label');
|
|
36
38
|
this.uploadMultipleFilesToggle = page.locator('div[data-entry-id="multiple"] .bio-properties-panel-toggle-switch__switcher');
|
|
37
39
|
this.documentReferenceInput = page.getByRole('textbox', {
|
|
38
40
|
name: 'document reference',
|
|
@@ -91,6 +93,13 @@ class FormJsPage {
|
|
|
91
93
|
await (0, test_1.expect)(this.keyInput).toHaveValue(key, { timeout: 20000 });
|
|
92
94
|
await (0, sleep_1.sleep)(1000);
|
|
93
95
|
}
|
|
96
|
+
async fillFieldLabel(label) {
|
|
97
|
+
// "Field label" is a contenteditable (FEEL-capable) editor, not an <input>,
|
|
98
|
+
// so assert its text content rather than a form value.
|
|
99
|
+
await this.fieldLabelInput.fill(label, { timeout: 60000 });
|
|
100
|
+
await (0, test_1.expect)(this.fieldLabelInput).toContainText(label, { timeout: 20000 });
|
|
101
|
+
await (0, sleep_1.sleep)(1000);
|
|
102
|
+
}
|
|
94
103
|
async enableUploadMultipleFiles() {
|
|
95
104
|
await this.uploadMultipleFilesToggle.click({ timeout: 60000 });
|
|
96
105
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const test_1 = require("@playwright/test");
|
|
4
|
+
const _8_10_1 = require("../../fixtures/8.10");
|
|
5
|
+
const apiHelpers_1 = require("../../utils/apiHelpers");
|
|
6
|
+
const sleep_1 = require("../../utils/sleep");
|
|
7
|
+
_8_10_1.test.describe.configure({ mode: 'serial' });
|
|
8
|
+
let managementToken;
|
|
9
|
+
let clusterUuid;
|
|
10
|
+
let originalFilters = null;
|
|
11
|
+
let dataFiltersAvailable = false;
|
|
12
|
+
const readFilters = async () => {
|
|
13
|
+
const response = await (0, apiHelpers_1.getClusterDataFilters)(managementToken, clusterUuid);
|
|
14
|
+
const status = response.status();
|
|
15
|
+
let body = null;
|
|
16
|
+
try {
|
|
17
|
+
body = (await response.json());
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
body = null;
|
|
21
|
+
}
|
|
22
|
+
return { status, body };
|
|
23
|
+
};
|
|
24
|
+
const skipIfUnavailable = () => {
|
|
25
|
+
_8_10_1.test.skip(!dataFiltersAvailable, 'Console Data Filters API not reachable on this cluster (endpoint returned non-2xx or is not yet enabled).');
|
|
26
|
+
};
|
|
27
|
+
_8_10_1.test.beforeAll(async () => {
|
|
28
|
+
try {
|
|
29
|
+
managementToken = await (0, apiHelpers_1.authConsoleManagementAPI)();
|
|
30
|
+
clusterUuid = (0, apiHelpers_1.getTestClusterUuid)();
|
|
31
|
+
const { status, body } = await readFilters();
|
|
32
|
+
dataFiltersAvailable = status >= 200 && status < 300;
|
|
33
|
+
if (dataFiltersAvailable) {
|
|
34
|
+
originalFilters = body;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
dataFiltersAvailable = false;
|
|
39
|
+
console.warn(`Data Filters API precheck failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
_8_10_1.test.afterAll(async () => {
|
|
43
|
+
if (dataFiltersAvailable && originalFilters) {
|
|
44
|
+
try {
|
|
45
|
+
await (0, apiHelpers_1.updateClusterDataFilters)(managementToken, clusterUuid, originalFilters);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.warn(`Failed to restore original data filters: ${error instanceof Error ? error.message : String(error)}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
_8_10_1.test.describe('Optimize Data Filters API @tasklistV2', () => {
|
|
53
|
+
_8_10_1.test.slow();
|
|
54
|
+
(0, _8_10_1.test)('T11728029 business_* variable filter enabled by default', async () => {
|
|
55
|
+
skipIfUnavailable();
|
|
56
|
+
await _8_10_1.test.step('Read cluster data filters config', async () => {
|
|
57
|
+
const { status, body } = await readFilters();
|
|
58
|
+
(0, test_1.expect)(status).toBe(200);
|
|
59
|
+
(0, test_1.expect)(body).not.toBeNull();
|
|
60
|
+
});
|
|
61
|
+
await _8_10_1.test.step('Assert business_* variable include filter is present', async () => {
|
|
62
|
+
const { body } = await readFilters();
|
|
63
|
+
const includeNames = body?.variableFilter?.includeVariableNames ?? [];
|
|
64
|
+
const hasBusinessDefault = includeNames.some((name) => name.startsWith('business_'));
|
|
65
|
+
(0, test_1.expect)(hasBusinessDefault).toBe(true);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
(0, _8_10_1.test)('T11728030 default filter configured before deploying processes', async () => {
|
|
69
|
+
skipIfUnavailable();
|
|
70
|
+
await _8_10_1.test.step('Assert variable filter config exists independent of deployed processes', async () => {
|
|
71
|
+
const { status, body } = await readFilters();
|
|
72
|
+
(0, test_1.expect)(status).toBe(200);
|
|
73
|
+
(0, test_1.expect)(body?.variableFilter).toBeDefined();
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
(0, _8_10_1.test)('T11728020 enable and persist a variable filter pattern', async () => {
|
|
77
|
+
skipIfUnavailable();
|
|
78
|
+
const pattern = 'e2e_business_*';
|
|
79
|
+
await _8_10_1.test.step('Enable and set variable include filter', async () => {
|
|
80
|
+
const response = await (0, apiHelpers_1.updateClusterDataFilters)(managementToken, clusterUuid, {
|
|
81
|
+
variableFilter: {
|
|
82
|
+
enabled: true,
|
|
83
|
+
includeVariableNames: [pattern],
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
(0, test_1.expect)([200, 201, 204]).toContain(response.status());
|
|
87
|
+
});
|
|
88
|
+
await _8_10_1.test.step('Assert the pattern persists on re-read', async () => {
|
|
89
|
+
const { body } = await readFilters();
|
|
90
|
+
const includeNames = body?.variableFilter?.includeVariableNames ?? [];
|
|
91
|
+
(0, test_1.expect)(includeNames).toContain(pattern);
|
|
92
|
+
(0, test_1.expect)(body?.variableFilter?.enabled).toBe(true);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
(0, _8_10_1.test)('T11728034 filter change applies without a manual restart', async () => {
|
|
96
|
+
skipIfUnavailable();
|
|
97
|
+
const pattern = 'e2e_no_restart_*';
|
|
98
|
+
await _8_10_1.test.step('Update the variable filter', async () => {
|
|
99
|
+
const response = await (0, apiHelpers_1.updateClusterDataFilters)(managementToken, clusterUuid, {
|
|
100
|
+
variableFilter: {
|
|
101
|
+
enabled: true,
|
|
102
|
+
includeVariableNames: [pattern],
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
(0, test_1.expect)([200, 201, 204]).toContain(response.status());
|
|
106
|
+
});
|
|
107
|
+
await _8_10_1.test.step('Assert change is reflected without any restart call', async () => {
|
|
108
|
+
let reflected = false;
|
|
109
|
+
for (let attempt = 0; attempt < 5 && !reflected; attempt++) {
|
|
110
|
+
const { body } = await readFilters();
|
|
111
|
+
const includeNames = body?.variableFilter?.includeVariableNames ?? [];
|
|
112
|
+
reflected = includeNames.includes(pattern);
|
|
113
|
+
if (!reflected) {
|
|
114
|
+
await (0, sleep_1.sleep)(3000);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
(0, test_1.expect)(reflected).toBe(true);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
(0, _8_10_1.test)('T11735087 exclude variable names take precedence over include', async () => {
|
|
121
|
+
skipIfUnavailable();
|
|
122
|
+
const shared = 'e2e_precedence_var';
|
|
123
|
+
await _8_10_1.test.step('Set the same variable in include and exclude', async () => {
|
|
124
|
+
const response = await (0, apiHelpers_1.updateClusterDataFilters)(managementToken, clusterUuid, {
|
|
125
|
+
variableFilter: {
|
|
126
|
+
enabled: true,
|
|
127
|
+
includeVariableNames: [shared],
|
|
128
|
+
excludeVariableNames: [shared],
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
(0, test_1.expect)([200, 201, 204]).toContain(response.status());
|
|
132
|
+
});
|
|
133
|
+
await _8_10_1.test.step('Assert exclude wins on read-back', async () => {
|
|
134
|
+
const { body } = await readFilters();
|
|
135
|
+
const excludeNames = body?.variableFilter?.excludeVariableNames ?? [];
|
|
136
|
+
(0, test_1.expect)(excludeNames).toContain(shared);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
(0, _8_10_1.test)('T11735088 set both include and exclude process definitions', async () => {
|
|
140
|
+
skipIfUnavailable();
|
|
141
|
+
const includeKey = 'e2e_include_proc';
|
|
142
|
+
const excludeKey = 'e2e_exclude_proc';
|
|
143
|
+
await _8_10_1.test.step('Set include and exclude process definition lists', async () => {
|
|
144
|
+
const response = await (0, apiHelpers_1.updateClusterDataFilters)(managementToken, clusterUuid, {
|
|
145
|
+
processDefinitionFilter: {
|
|
146
|
+
includeProcessDefinitionKeys: [includeKey],
|
|
147
|
+
excludeProcessDefinitionKeys: [excludeKey],
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
(0, test_1.expect)([200, 201, 204]).toContain(response.status());
|
|
151
|
+
});
|
|
152
|
+
await _8_10_1.test.step('Assert both lists persist', async () => {
|
|
153
|
+
const { body } = await readFilters();
|
|
154
|
+
const include = body?.processDefinitionFilter?.includeProcessDefinitionKeys ?? [];
|
|
155
|
+
const exclude = body?.processDefinitionFilter?.excludeProcessDefinitionKeys ?? [];
|
|
156
|
+
(0, test_1.expect)(include).toContain(includeKey);
|
|
157
|
+
(0, test_1.expect)(exclude).toContain(excludeKey);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
(0, _8_10_1.test)('T11735089 exclude process definitions take precedence over include', async () => {
|
|
161
|
+
skipIfUnavailable();
|
|
162
|
+
const shared = 'e2e_precedence_proc';
|
|
163
|
+
await _8_10_1.test.step('Set the same process definition in include and exclude', async () => {
|
|
164
|
+
const response = await (0, apiHelpers_1.updateClusterDataFilters)(managementToken, clusterUuid, {
|
|
165
|
+
processDefinitionFilter: {
|
|
166
|
+
includeProcessDefinitionKeys: [shared],
|
|
167
|
+
excludeProcessDefinitionKeys: [shared],
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
(0, test_1.expect)([200, 201, 204]).toContain(response.status());
|
|
171
|
+
});
|
|
172
|
+
await _8_10_1.test.step('Assert exclude wins on read-back', async () => {
|
|
173
|
+
const { body } = await readFilters();
|
|
174
|
+
const exclude = body?.processDefinitionFilter?.excludeProcessDefinitionKeys ?? [];
|
|
175
|
+
(0, test_1.expect)(exclude).toContain(shared);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
(0, _8_10_1.test)('T11728019 unauthenticated request cannot read data filters', async () => {
|
|
179
|
+
skipIfUnavailable();
|
|
180
|
+
await _8_10_1.test.step('Send request without a valid token', async () => {
|
|
181
|
+
const response = await (0, apiHelpers_1.getClusterDataFilters)('Bearer invalid-token', clusterUuid);
|
|
182
|
+
(0, test_1.expect)([401, 403]).toContain(response.status());
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
});
|
|
@@ -11,7 +11,6 @@ const UtilitiesPage_1 = require("../../pages/8.8/UtilitiesPage");
|
|
|
11
11
|
const deleteOrg_1 = require("../../utils/deleteOrg");
|
|
12
12
|
const sleep_1 = require("../../utils/sleep");
|
|
13
13
|
const mailSlurpClient_1 = require("../../utils/mailSlurpClient");
|
|
14
|
-
const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
|
|
15
14
|
const users_1 = require("../../utils/users");
|
|
16
15
|
const testUser = (0, users_1.getTestUser)('eleventhUser');
|
|
17
16
|
_8_8_1.test.describe.configure({ mode: 'parallel' });
|
|
@@ -407,10 +406,13 @@ _8_8_1.test.describe('Web Modeler User Flow Tests', () => {
|
|
|
407
406
|
});
|
|
408
407
|
});
|
|
409
408
|
//Skipped due to bug 22577: https://github.com/camunda/camunda-hub/issues/22577
|
|
410
|
-
_8_8_1.test
|
|
409
|
+
(0, _8_8_1.test)('Public Start Form @tasklistV1', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, formJsPage, taskDetailsPage, taskPanelPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, browser, }) => {
|
|
411
410
|
const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
|
|
412
411
|
const processName = 'User_Task_Process_With_Public_Form' + randomString;
|
|
413
412
|
const formName = 'Public form' + randomString;
|
|
413
|
+
// Unique per run so repeated runs in the shared project never collide.
|
|
414
|
+
const publicFormFieldKey = 'Public_Form_Text_Field_' + randomString;
|
|
415
|
+
const publicFormSubmission = 'Public Form Test Value';
|
|
414
416
|
await _8_8_1.test.step('Navigate to Web Modeler', async () => {
|
|
415
417
|
await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
|
|
416
418
|
timeout: 120000,
|
|
@@ -431,7 +433,8 @@ _8_8_1.test.describe('Web Modeler User Flow Tests', () => {
|
|
|
431
433
|
await formJsPage.dragAndDrop(formJsPage.textField, formJsPage.formEditor);
|
|
432
434
|
await (0, test_1.expect)(formJsPage.textFieldInForm).toBeVisible();
|
|
433
435
|
await formJsPage.clickGeneralPropertiesPanel();
|
|
434
|
-
await formJsPage.
|
|
436
|
+
await formJsPage.fillFieldLabel(publicFormFieldKey);
|
|
437
|
+
await formJsPage.fillKeyInput(publicFormFieldKey);
|
|
435
438
|
await formJsPage.deployForm(clusterName);
|
|
436
439
|
});
|
|
437
440
|
await _8_8_1.test.step('Add A BPMN Template To The Project', async () => {
|
|
@@ -451,39 +454,39 @@ _8_8_1.test.describe('Web Modeler User Flow Tests', () => {
|
|
|
451
454
|
publicFormLink = await modelerCreatePage.getPublicationLink();
|
|
452
455
|
await (0, sleep_1.sleep)(1000);
|
|
453
456
|
});
|
|
454
|
-
await _8_8_1.test.step('
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
});
|
|
462
|
-
await _8_8_1.test.step('Access Public Form After Session Reset and Submit the Form', async () => {
|
|
457
|
+
await _8_8_1.test.step('Access public form anonymously and submit', async () => {
|
|
458
|
+
// A public start form must be reachable without authentication, so open
|
|
459
|
+
// it in a fresh context; the main session stays logged in for the task
|
|
460
|
+
// completion step below.
|
|
461
|
+
const anonContext = await browser.newContext();
|
|
462
|
+
const anonPage = await anonContext.newPage();
|
|
463
|
+
const anonTaskDetailsPage = new TaskDetailsPage_1.TaskDetailsPage(anonPage);
|
|
463
464
|
console.log('Navigating to public form:', publicFormLink);
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
await
|
|
473
|
-
|
|
474
|
-
});
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
465
|
+
// Re-navigate until the form renders to absorb brief Tasklist import lag
|
|
466
|
+
// after deploy.
|
|
467
|
+
await (0, test_1.expect)(async () => {
|
|
468
|
+
await anonPage.goto(publicFormLink, { waitUntil: 'domcontentloaded' });
|
|
469
|
+
await (0, test_1.expect)(anonTaskDetailsPage.textInput).toBeVisible({
|
|
470
|
+
timeout: 15000,
|
|
471
|
+
});
|
|
472
|
+
}).toPass({ timeout: 120000, intervals: [5000, 10000, 15000] });
|
|
473
|
+
await anonTaskDetailsPage.fillTextInput(publicFormSubmission);
|
|
474
|
+
await anonTaskDetailsPage.clickSubmitButton();
|
|
475
|
+
await (0, test_1.expect)(anonPage.getByRole('heading', { name: 'Success!' })).toBeVisible({ timeout: 30000 });
|
|
476
|
+
await anonContext.close();
|
|
477
|
+
});
|
|
478
|
+
await _8_8_1.test.step('Complete User Task in Tasklist', async () => {
|
|
479
|
+
// The main session is still authenticated, so go straight to Tasklist.
|
|
478
480
|
await appsPage.clickCamundaApps();
|
|
479
481
|
await appsPage.clickTasklist(clusterName);
|
|
480
|
-
await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(page, taskPanelPage.taskListPageBanner, 'Tasklist banner');
|
|
481
482
|
await taskPanelPage.openTask(processName);
|
|
482
|
-
await (0, test_1.expect)(page
|
|
483
|
-
.getByRole('row')
|
|
484
|
-
.filter({ hasText: 'Public_Form_Text_Field' })
|
|
485
|
-
.getByText('"Public Form Test Value"')).toBeVisible({ timeout: 30000 });
|
|
486
483
|
await taskDetailsPage.clickAssignToMeButton();
|
|
484
|
+
await (0, test_1.expect)(taskDetailsPage.assignedToMeText).toBeVisible({
|
|
485
|
+
timeout: 60000,
|
|
486
|
+
});
|
|
487
|
+
// The value submitted via the public form is carried into the task
|
|
488
|
+
// variable as a JSON string, so it is wrapped in quotes.
|
|
489
|
+
await (0, test_1.expect)(page.getByTitle(`${publicFormFieldKey} Value`)).toHaveValue(`"${publicFormSubmission}"`, { timeout: 30000 });
|
|
487
490
|
await taskDetailsPage.clickCompleteTaskButton();
|
|
488
491
|
});
|
|
489
492
|
await _8_8_1.test.step('Assert Process Instance is Completed in Operate', async () => {
|
|
@@ -58,4 +58,22 @@ export declare function updateCollectionScope(request: APIRequestContext, option
|
|
|
58
58
|
tenants: string[];
|
|
59
59
|
}>;
|
|
60
60
|
}): Promise<unknown>;
|
|
61
|
+
export interface ClusterVariableFilter {
|
|
62
|
+
enabled?: boolean;
|
|
63
|
+
includeVariableNames?: string[];
|
|
64
|
+
excludeVariableNames?: string[];
|
|
65
|
+
}
|
|
66
|
+
export interface ClusterProcessDefinitionFilter {
|
|
67
|
+
includeProcessDefinitionKeys?: string[];
|
|
68
|
+
excludeProcessDefinitionKeys?: string[];
|
|
69
|
+
}
|
|
70
|
+
export interface ClusterDataFilters {
|
|
71
|
+
variableFilter?: ClusterVariableFilter;
|
|
72
|
+
processDefinitionFilter?: ClusterProcessDefinitionFilter;
|
|
73
|
+
[key: string]: unknown;
|
|
74
|
+
}
|
|
75
|
+
export declare function authConsoleManagementAPI(): Promise<string>;
|
|
76
|
+
export declare function getTestClusterUuid(): string;
|
|
77
|
+
export declare function getClusterDataFilters(token: string, clusterUuid: string): Promise<APIResponse>;
|
|
78
|
+
export declare function updateClusterDataFilters(token: string, clusterUuid: string, config: ClusterDataFilters): Promise<APIResponse>;
|
|
61
79
|
export {};
|
package/dist/utils/apiHelpers.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.updateCollectionScope = exports.createSingleProcessReport = exports.createDashboard = exports.createCollection = exports.getOptimizeCookieSm = exports.getOptimizeCoockie = exports.createStringClusterVariable = exports.createJsonClusterVariable = exports.waitForProcessInstanceVisible = exports.createProcessInstance = exports.deployProcess = exports.waitForConnectorsReady = exports.validateMcpServerHealth = exports.authC8runAPI = exports.authSmAPI = exports.authSaasAPI = exports.authAPI = exports.buildZeebeApiUrl = exports.retryOn500 = exports.sendRequestAndAssertResponse = exports.assertResponseStatus = exports.getApiRequestContext = void 0;
|
|
6
|
+
exports.updateClusterDataFilters = exports.getClusterDataFilters = exports.getTestClusterUuid = exports.authConsoleManagementAPI = exports.updateCollectionScope = exports.createSingleProcessReport = exports.createDashboard = exports.createCollection = exports.getOptimizeCookieSm = exports.getOptimizeCoockie = exports.createStringClusterVariable = exports.createJsonClusterVariable = exports.waitForProcessInstanceVisible = exports.createProcessInstance = exports.deployProcess = exports.waitForConnectorsReady = exports.validateMcpServerHealth = exports.authC8runAPI = exports.authSmAPI = exports.authSaasAPI = exports.authAPI = exports.buildZeebeApiUrl = exports.retryOn500 = exports.sendRequestAndAssertResponse = exports.assertResponseStatus = exports.getApiRequestContext = void 0;
|
|
7
7
|
const test_1 = require("@playwright/test");
|
|
8
8
|
const sleep_1 = require("./sleep");
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -749,3 +749,64 @@ async function updateCollectionScope(request, options) {
|
|
|
749
749
|
}, 'updateCollectionScope');
|
|
750
750
|
}
|
|
751
751
|
exports.updateCollectionScope = updateCollectionScope;
|
|
752
|
+
async function authConsoleManagementAPI() {
|
|
753
|
+
apiRequestContext = await getApiRequestContext();
|
|
754
|
+
const authUrl = process.env.CONSOLE_MANAGEMENT_AUTH_URL ??
|
|
755
|
+
'https://weblogin.cloud.ultrawombat.com/oauth/token';
|
|
756
|
+
const audience = process.env.CONSOLE_MANAGEMENT_AUDIENCE ?? 'cloud.ultrawombat.com';
|
|
757
|
+
const response = await apiRequestContext.post(authUrl, {
|
|
758
|
+
headers: {
|
|
759
|
+
'Content-Type': 'application/json',
|
|
760
|
+
},
|
|
761
|
+
data: {
|
|
762
|
+
grant_type: 'client_credentials',
|
|
763
|
+
audience,
|
|
764
|
+
client_id: process.env.EXTERNAL_CONSOLE_API_CLIENT_ID,
|
|
765
|
+
client_secret: process.env.EXTERNAL_CONSOLE_API_CLIENT_SECRET,
|
|
766
|
+
},
|
|
767
|
+
timeout: 60000,
|
|
768
|
+
});
|
|
769
|
+
if (response.status() !== 200) {
|
|
770
|
+
const errorBody = await response.text();
|
|
771
|
+
throw new Error(`Failed to fetch Console management token. Response: ${errorBody}`);
|
|
772
|
+
}
|
|
773
|
+
const json = await response.json();
|
|
774
|
+
return `Bearer ${json.access_token}`;
|
|
775
|
+
}
|
|
776
|
+
exports.authConsoleManagementAPI = authConsoleManagementAPI;
|
|
777
|
+
function getTestClusterUuid() {
|
|
778
|
+
const uuid = process.env.TEST_CLUSTER_UUID ??
|
|
779
|
+
process.env.C8_CLUSTER_UUID ??
|
|
780
|
+
process.env.CLUSTER_UUID;
|
|
781
|
+
if (!uuid) {
|
|
782
|
+
throw new Error('Missing cluster UUID. Set TEST_CLUSTER_UUID (or C8_CLUSTER_UUID / CLUSTER_UUID).');
|
|
783
|
+
}
|
|
784
|
+
return uuid;
|
|
785
|
+
}
|
|
786
|
+
exports.getTestClusterUuid = getTestClusterUuid;
|
|
787
|
+
function buildConsoleDataFiltersUrl(clusterUuid) {
|
|
788
|
+
const base = (process.env.CONSOLE_MANAGEMENT_API_URL ??
|
|
789
|
+
'https://accounts.cloud.ultrawombat.com/external/qa').replace(/\/+$/, '');
|
|
790
|
+
return `${base}/clusters/${clusterUuid}/dataFilters`;
|
|
791
|
+
}
|
|
792
|
+
async function getClusterDataFilters(token, clusterUuid) {
|
|
793
|
+
apiRequestContext = await getApiRequestContext();
|
|
794
|
+
return apiRequestContext.get(buildConsoleDataFiltersUrl(clusterUuid), {
|
|
795
|
+
headers: {
|
|
796
|
+
Authorization: token,
|
|
797
|
+
'Content-Type': 'application/json',
|
|
798
|
+
},
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
exports.getClusterDataFilters = getClusterDataFilters;
|
|
802
|
+
async function updateClusterDataFilters(token, clusterUuid, config) {
|
|
803
|
+
apiRequestContext = await getApiRequestContext();
|
|
804
|
+
return apiRequestContext.put(buildConsoleDataFiltersUrl(clusterUuid), {
|
|
805
|
+
headers: {
|
|
806
|
+
Authorization: token,
|
|
807
|
+
'Content-Type': 'application/json',
|
|
808
|
+
},
|
|
809
|
+
data: config,
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
exports.updateClusterDataFilters = updateClusterDataFilters;
|