@camunda/e2e-test-suite 0.0.687 → 0.0.689
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.
|
@@ -187,9 +187,10 @@ class ModelerCreatePage {
|
|
|
187
187
|
this.secondPlacedElement = page.locator('g:nth-child(2) > .djs-element > .djs-hit');
|
|
188
188
|
this.payloadInput = page.locator('[class="fjs-input"]');
|
|
189
189
|
this.marketPlaceButton = page.getByTitle('Browse Marketplace for more Connectors');
|
|
190
|
-
this.publicHolidayConnectorOption = page
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
this.publicHolidayConnectorOption = page.getByRole('listitem', {
|
|
191
|
+
name: 'Worldwide Public Holiday',
|
|
192
|
+
exact: true,
|
|
193
|
+
});
|
|
193
194
|
this.publicHolidayYearOption = page.getByLabel('Year');
|
|
194
195
|
this.publicHolidayCountryCodeOption = page.getByLabel('Countrycode');
|
|
195
196
|
this.implementationSection = page.locator('[data-group-id="group-userTaskImplementation"]');
|
|
@@ -6,11 +6,38 @@ const constants_1 = require("../../utils/constants");
|
|
|
6
6
|
const apiHelpers_1 = require("../../utils/apiHelpers");
|
|
7
7
|
const randomName_1 = require("../../utils/randomName");
|
|
8
8
|
_8_9_1.test.describe.configure({ mode: 'parallel' });
|
|
9
|
+
const expectUnauthorizedErrorBody = (body) => {
|
|
10
|
+
if (body === null || body === undefined)
|
|
11
|
+
return;
|
|
12
|
+
if (typeof body === 'string') {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
(0, test_1.expect)(typeof body).toBe('object');
|
|
16
|
+
const errorBody = body;
|
|
17
|
+
const errorMessage = errorBody.message ?? errorBody.error ?? errorBody.title ?? errorBody.detail;
|
|
18
|
+
(0, test_1.expect)(typeof errorMessage).toBe('string');
|
|
19
|
+
(0, test_1.expect)(errorMessage.trim().length).toBeGreaterThan(0);
|
|
20
|
+
};
|
|
21
|
+
const assertUnauthorizedResponseBody = async (response) => {
|
|
22
|
+
(0, test_1.expect)(response.status()).toBe(401);
|
|
23
|
+
const rawBody = await response.text();
|
|
24
|
+
if (rawBody.trim().length === 0)
|
|
25
|
+
return;
|
|
26
|
+
let body = rawBody;
|
|
27
|
+
try {
|
|
28
|
+
body = JSON.parse(rawBody);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
body = rawBody;
|
|
32
|
+
}
|
|
33
|
+
expectUnauthorizedErrorBody(body);
|
|
34
|
+
};
|
|
9
35
|
_8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
10
36
|
let optimizeCookie;
|
|
11
37
|
let optimizeBearerToken;
|
|
12
38
|
let collectionIdValue;
|
|
13
39
|
let dashboardIdValue;
|
|
40
|
+
let dashboardNameValue;
|
|
14
41
|
let reportId;
|
|
15
42
|
let baseUrl;
|
|
16
43
|
_8_9_1.test.beforeAll(async ({ browser, request }) => {
|
|
@@ -34,8 +61,9 @@ _8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
|
34
61
|
},
|
|
35
62
|
],
|
|
36
63
|
});
|
|
64
|
+
dashboardNameValue = await (0, randomName_1.randomNameAgregator)('Test Dashboard');
|
|
37
65
|
dashboardIdValue = await (0, apiHelpers_1.createDashboard)(request, {
|
|
38
|
-
name:
|
|
66
|
+
name: dashboardNameValue,
|
|
39
67
|
optimizeCookie,
|
|
40
68
|
collectionId: collectionIdValue,
|
|
41
69
|
});
|
|
@@ -68,18 +96,20 @@ _8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
|
68
96
|
(0, test_1.expect)(body.length).toBeGreaterThan(0);
|
|
69
97
|
const dashboard = body[0];
|
|
70
98
|
(0, test_1.expect)(dashboard).toHaveProperty('id');
|
|
99
|
+
const ids = body.map((d) => d.id);
|
|
100
|
+
(0, test_1.expect)(ids).toContain(dashboardIdValue);
|
|
71
101
|
});
|
|
72
102
|
});
|
|
73
103
|
(0, _8_9_1.test)('Get dashboards without token returns 401', async ({ request }) => {
|
|
74
104
|
await _8_9_1.test.step('GET /api/public/dashboard without token (401)', async () => {
|
|
75
105
|
const response = await request.get(`${baseUrl}/api/public/dashboard?collectionId=${collectionIdValue}`);
|
|
76
|
-
|
|
106
|
+
await assertUnauthorizedResponseBody(response);
|
|
77
107
|
});
|
|
78
108
|
});
|
|
79
109
|
(0, _8_9_1.test)('Get dashboards with invalid token returns 401', async ({ request }) => {
|
|
80
110
|
await _8_9_1.test.step('GET /api/public/dashboard with invalid token (401)', async () => {
|
|
81
111
|
const response = await request.get(`${baseUrl}/api/public/dashboard?collectionId=${collectionIdValue}`, { headers: { Authorization: 'Bearer invalid_token' } });
|
|
82
|
-
|
|
112
|
+
await assertUnauthorizedResponseBody(response);
|
|
83
113
|
});
|
|
84
114
|
});
|
|
85
115
|
(0, _8_9_1.test)('GET /api/public/dashboard/force-internal-error returns 500', async ({ request, }) => {
|
|
@@ -100,6 +130,15 @@ _8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
|
100
130
|
await (0, apiHelpers_1.assertResponseStatus)(response, 200);
|
|
101
131
|
const body = await response.json();
|
|
102
132
|
(0, test_1.expect)(Array.isArray(body)).toBeTruthy();
|
|
133
|
+
(0, test_1.expect)(body.length).toBeGreaterThan(0);
|
|
134
|
+
(0, test_1.expect)(body[0]).toHaveProperty('id');
|
|
135
|
+
(0, test_1.expect)(body[0].id).toBe(dashboardIdValue);
|
|
136
|
+
(0, test_1.expect)(body[0]).toHaveProperty('exportEntityType');
|
|
137
|
+
(0, test_1.expect)(body[0].exportEntityType).toBeTruthy();
|
|
138
|
+
(0, test_1.expect)(body[0]).toHaveProperty('name');
|
|
139
|
+
(0, test_1.expect)(body[0].name).toBe(dashboardNameValue);
|
|
140
|
+
(0, test_1.expect)(body[0]).toHaveProperty('collectionId');
|
|
141
|
+
(0, test_1.expect)(body[0].collectionId).toBe(collectionIdValue);
|
|
103
142
|
});
|
|
104
143
|
});
|
|
105
144
|
(0, _8_9_1.test)('Export dashboards without token returns 401', async ({ request }) => {
|
|
@@ -108,7 +147,7 @@ _8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
|
108
147
|
headers: { 'Content-Type': 'application/json' },
|
|
109
148
|
data: [dashboardIdValue],
|
|
110
149
|
});
|
|
111
|
-
|
|
150
|
+
await assertUnauthorizedResponseBody(response);
|
|
112
151
|
});
|
|
113
152
|
});
|
|
114
153
|
(0, _8_9_1.test)('Export dashboards with invalid token returns 401', async ({ request, }) => {
|
|
@@ -120,7 +159,7 @@ _8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
|
120
159
|
},
|
|
121
160
|
data: [dashboardIdValue],
|
|
122
161
|
});
|
|
123
|
-
|
|
162
|
+
await assertUnauthorizedResponseBody(response);
|
|
124
163
|
});
|
|
125
164
|
});
|
|
126
165
|
(0, _8_9_1.test)('Export dashboard with invalid body returns 400', async ({ request }) => {
|
|
@@ -168,7 +207,7 @@ _8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
|
168
207
|
(0, _8_9_1.test)('Delete dashboard with invalid token returns 401', async ({ request }) => {
|
|
169
208
|
await _8_9_1.test.step('DELETE /api/public/dashboard with invalid token (401)', async () => {
|
|
170
209
|
const response = await request.delete(`${baseUrl}/api/public/dashboard/${dashboardIdValue}`, { headers: { Authorization: 'Bearer invalid_token' } });
|
|
171
|
-
|
|
210
|
+
await assertUnauthorizedResponseBody(response);
|
|
172
211
|
});
|
|
173
212
|
});
|
|
174
213
|
(0, _8_9_1.test)('Delete non-existent dashboard returns 404', async ({ request }) => {
|
|
@@ -184,12 +223,16 @@ _8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
|
184
223
|
await (0, apiHelpers_1.assertResponseStatus)(response, 200);
|
|
185
224
|
const body = await response.json();
|
|
186
225
|
(0, test_1.expect)(Array.isArray(body)).toBeTruthy();
|
|
226
|
+
(0, test_1.expect)(body.length).toBeGreaterThan(0);
|
|
227
|
+
(0, test_1.expect)(body[0]).toHaveProperty('id');
|
|
228
|
+
const ids = body.map((r) => r.id);
|
|
229
|
+
(0, test_1.expect)(ids).toContain(reportId);
|
|
187
230
|
});
|
|
188
231
|
});
|
|
189
232
|
(0, _8_9_1.test)('Get reports with invalid token returns 401', async ({ request }) => {
|
|
190
233
|
await _8_9_1.test.step('GET /api/public/report with invalid token (401)', async () => {
|
|
191
234
|
const response = await request.get(`${baseUrl}/api/public/report?collectionId=${collectionIdValue}`, { headers: { Authorization: 'Bearer invalid_token' } });
|
|
192
|
-
|
|
235
|
+
await assertUnauthorizedResponseBody(response);
|
|
193
236
|
});
|
|
194
237
|
});
|
|
195
238
|
(0, _8_9_1.test)('Export reports successfully returns 200 with full payload', async ({ request, }) => {
|
|
@@ -206,9 +249,15 @@ _8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
|
206
249
|
(0, test_1.expect)(Array.isArray(body)).toBeTruthy();
|
|
207
250
|
(0, test_1.expect)(body.length).toBeGreaterThan(0);
|
|
208
251
|
(0, test_1.expect)(body[0]).toHaveProperty('id');
|
|
252
|
+
(0, test_1.expect)(body[0].id).toBe(reportId);
|
|
209
253
|
(0, test_1.expect)(body[0]).toHaveProperty('exportEntityType');
|
|
254
|
+
(0, test_1.expect)(body[0].exportEntityType).toBeTruthy();
|
|
210
255
|
(0, test_1.expect)(body[0]).toHaveProperty('name');
|
|
256
|
+
(0, test_1.expect)(body[0].name).toBe('Blank report');
|
|
211
257
|
(0, test_1.expect)(body[0]).toHaveProperty('collectionId');
|
|
258
|
+
(0, test_1.expect)(body[0].collectionId).toBe(collectionIdValue);
|
|
259
|
+
(0, test_1.expect)(body[0]).toHaveProperty('data');
|
|
260
|
+
(0, test_1.expect)(body[0].data).toBeTruthy();
|
|
212
261
|
});
|
|
213
262
|
});
|
|
214
263
|
(0, _8_9_1.test)('Export reports with invalid token returns 401', async ({ request }) => {
|
|
@@ -220,7 +269,7 @@ _8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
|
220
269
|
},
|
|
221
270
|
data: [reportId],
|
|
222
271
|
});
|
|
223
|
-
|
|
272
|
+
await assertUnauthorizedResponseBody(response);
|
|
224
273
|
});
|
|
225
274
|
});
|
|
226
275
|
(0, _8_9_1.test)('Export non-existent report returns 404', async ({ request }) => {
|
|
@@ -278,6 +327,9 @@ _8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
|
278
327
|
data: entitiesToImport,
|
|
279
328
|
});
|
|
280
329
|
await (0, apiHelpers_1.assertResponseStatus)(response, 200);
|
|
330
|
+
const importResult = await response.json();
|
|
331
|
+
(0, test_1.expect)(Array.isArray(importResult)).toBeTruthy();
|
|
332
|
+
(0, test_1.expect)(importResult.length).toBeGreaterThan(0);
|
|
281
333
|
});
|
|
282
334
|
(0, _8_9_1.test)('Import without token or invalid token returns 401', async ({ request, }) => {
|
|
283
335
|
const exportResponse = await request.post(`${baseUrl}/api/public/export/dashboard/definition/json`, {
|
|
@@ -296,7 +348,7 @@ _8_9_1.test.describe('API optimize SaaS Tests', () => {
|
|
|
296
348
|
},
|
|
297
349
|
data: entitiesToImport,
|
|
298
350
|
});
|
|
299
|
-
|
|
351
|
+
await assertUnauthorizedResponseBody(response);
|
|
300
352
|
});
|
|
301
353
|
// Skipped due to bug 40497: https://github.com/camunda/camunda/issues/40497
|
|
302
354
|
_8_9_1.test.skip('Import to non-existent collection (404)', async ({ request }) => {
|
|
@@ -325,6 +377,7 @@ _8_9_1.test.describe('API optimize SaaS Tests - Conditional Events', () => {
|
|
|
325
377
|
let optimizeBearerToken;
|
|
326
378
|
let conditionalEventsCollectionId;
|
|
327
379
|
let conditionalEventsReportId;
|
|
380
|
+
let conditionalEventsReportName;
|
|
328
381
|
let baseUrl;
|
|
329
382
|
const CONDITIONAL_EVENTS_PROCESS_KEY = 'conditional-events-auto-process';
|
|
330
383
|
_8_9_1.test.beforeAll(async ({ browser, request }) => {
|
|
@@ -347,10 +400,11 @@ _8_9_1.test.describe('API optimize SaaS Tests - Conditional Events', () => {
|
|
|
347
400
|
},
|
|
348
401
|
],
|
|
349
402
|
});
|
|
403
|
+
conditionalEventsReportName = await (0, randomName_1.randomNameAgregator)('Conditional Events Report');
|
|
350
404
|
conditionalEventsReportId = await (0, apiHelpers_1.createSingleProcessReport)(request, {
|
|
351
405
|
optimizeCookie,
|
|
352
406
|
collectionId: conditionalEventsCollectionId,
|
|
353
|
-
name:
|
|
407
|
+
name: conditionalEventsReportName,
|
|
354
408
|
definitions: [
|
|
355
409
|
{
|
|
356
410
|
key: CONDITIONAL_EVENTS_PROCESS_KEY,
|
|
@@ -417,9 +471,15 @@ _8_9_1.test.describe('API optimize SaaS Tests - Conditional Events', () => {
|
|
|
417
471
|
(0, test_1.expect)(Array.isArray(body)).toBeTruthy();
|
|
418
472
|
(0, test_1.expect)(body.length).toBeGreaterThan(0);
|
|
419
473
|
(0, test_1.expect)(body[0]).toHaveProperty('id');
|
|
474
|
+
(0, test_1.expect)(body[0].id).toBe(conditionalEventsReportId);
|
|
420
475
|
(0, test_1.expect)(body[0]).toHaveProperty('exportEntityType');
|
|
476
|
+
(0, test_1.expect)(body[0].exportEntityType).toBeTruthy();
|
|
421
477
|
(0, test_1.expect)(body[0]).toHaveProperty('name');
|
|
478
|
+
(0, test_1.expect)(body[0].name).toBe(conditionalEventsReportName);
|
|
422
479
|
(0, test_1.expect)(body[0]).toHaveProperty('collectionId');
|
|
480
|
+
(0, test_1.expect)(body[0].collectionId).toBe(conditionalEventsCollectionId);
|
|
481
|
+
(0, test_1.expect)(body[0]).toHaveProperty('data');
|
|
482
|
+
(0, test_1.expect)(body[0].data).toBeTruthy();
|
|
423
483
|
});
|
|
424
484
|
});
|
|
425
485
|
(0, _8_9_1.test)('CE-OPT-11: Exporting the Conditional Events report without a token returns 401', async ({ request, }) => {
|
|
@@ -428,7 +488,7 @@ _8_9_1.test.describe('API optimize SaaS Tests - Conditional Events', () => {
|
|
|
428
488
|
headers: { 'Content-Type': 'application/json' },
|
|
429
489
|
data: [conditionalEventsReportId],
|
|
430
490
|
});
|
|
431
|
-
|
|
491
|
+
await assertUnauthorizedResponseBody(response);
|
|
432
492
|
});
|
|
433
493
|
});
|
|
434
494
|
(0, _8_9_1.test)('CE-OPT-12: Exporting the Conditional Events report with an invalid token returns 401', async ({ request, }) => {
|
|
@@ -440,7 +500,7 @@ _8_9_1.test.describe('API optimize SaaS Tests - Conditional Events', () => {
|
|
|
440
500
|
},
|
|
441
501
|
data: [conditionalEventsReportId],
|
|
442
502
|
});
|
|
443
|
-
|
|
503
|
+
await assertUnauthorizedResponseBody(response);
|
|
444
504
|
});
|
|
445
505
|
});
|
|
446
506
|
(0, _8_9_1.test)('CE-OPT-13: Deleting the Conditional Events report via API succeeds with HTTP 200', async ({ request, }) => {
|
|
@@ -490,7 +550,7 @@ _8_9_1.test.describe('API optimize SaaS Tests - Conditional Events', () => {
|
|
|
490
550
|
(0, _8_9_1.test)('CE-OPT-15: Attempting to delete the Conditional Events report with an invalid token returns 401', async ({ request, }) => {
|
|
491
551
|
await _8_9_1.test.step('Delete report with invalid token (401)', async () => {
|
|
492
552
|
const response = await request.delete(`${baseUrl}/api/public/report/${conditionalEventsReportId}`, { headers: { Authorization: 'Bearer invalid_token' } });
|
|
493
|
-
|
|
553
|
+
await assertUnauthorizedResponseBody(response);
|
|
494
554
|
});
|
|
495
555
|
});
|
|
496
556
|
});
|
|
@@ -531,13 +591,13 @@ _8_9_1.test.describe('API optimize SaaS Tests - Sharing', () => {
|
|
|
531
591
|
(0, _8_9_1.test)('Enable sharing without token returns 401', async ({ request }) => {
|
|
532
592
|
await _8_9_1.test.step('POST /api/public/share/enable without token (401)', async () => {
|
|
533
593
|
const response = await request.post(`${baseUrl}/api/public/share/enable`);
|
|
534
|
-
|
|
594
|
+
await assertUnauthorizedResponseBody(response);
|
|
535
595
|
});
|
|
536
596
|
});
|
|
537
597
|
(0, _8_9_1.test)('Enable sharing with invalid token returns 401', async ({ request }) => {
|
|
538
598
|
await _8_9_1.test.step('POST /api/public/share/enable with invalid token (401)', async () => {
|
|
539
599
|
const response = await request.post(`${baseUrl}/api/public/share/enable`, { headers: { Authorization: 'Bearer invalid_token' } });
|
|
540
|
-
|
|
600
|
+
await assertUnauthorizedResponseBody(response);
|
|
541
601
|
});
|
|
542
602
|
});
|
|
543
603
|
(0, _8_9_1.test)('Disable sharing with valid token returns 200 or 204', async ({ request, }) => {
|
|
@@ -549,13 +609,13 @@ _8_9_1.test.describe('API optimize SaaS Tests - Sharing', () => {
|
|
|
549
609
|
(0, _8_9_1.test)('Disable sharing without token returns 401', async ({ request }) => {
|
|
550
610
|
await _8_9_1.test.step('POST /api/public/share/disable without token (401)', async () => {
|
|
551
611
|
const response = await request.post(`${baseUrl}/api/public/share/disable`);
|
|
552
|
-
|
|
612
|
+
await assertUnauthorizedResponseBody(response);
|
|
553
613
|
});
|
|
554
614
|
});
|
|
555
615
|
(0, _8_9_1.test)('Disable sharing with invalid token returns 401', async ({ request }) => {
|
|
556
616
|
await _8_9_1.test.step('POST /api/public/share/disable with invalid token (401)', async () => {
|
|
557
617
|
const response = await request.post(`${baseUrl}/api/public/share/disable`, { headers: { Authorization: 'Bearer invalid_token' } });
|
|
558
|
-
|
|
618
|
+
await assertUnauthorizedResponseBody(response);
|
|
559
619
|
});
|
|
560
620
|
});
|
|
561
621
|
(0, _8_9_1.test)('Sharing toggle cycle: enable then disable is idempotent', async ({ request, }) => {
|
|
@@ -602,6 +662,7 @@ _8_9_1.test.describe('API optimize SaaS Tests - Dashboard and Report GET edge ca
|
|
|
602
662
|
await (0, apiHelpers_1.assertResponseStatus)(response, 200);
|
|
603
663
|
const body = await response.json();
|
|
604
664
|
(0, test_1.expect)(Array.isArray(body)).toBeTruthy();
|
|
665
|
+
(0, test_1.expect)(body.every((dashboard) => typeof dashboard.id === 'string' && dashboard.id.length > 0)).toBeTruthy();
|
|
605
666
|
});
|
|
606
667
|
});
|
|
607
668
|
(0, _8_9_1.test)('GET dashboards without collectionId param returns 400 or 500', async ({ request, }) => {
|
|
@@ -618,6 +679,7 @@ _8_9_1.test.describe('API optimize SaaS Tests - Dashboard and Report GET edge ca
|
|
|
618
679
|
await (0, apiHelpers_1.assertResponseStatus)(response, 200);
|
|
619
680
|
const body = await response.json();
|
|
620
681
|
(0, test_1.expect)(Array.isArray(body)).toBeTruthy();
|
|
682
|
+
(0, test_1.expect)(body.length).toBe(0);
|
|
621
683
|
});
|
|
622
684
|
});
|
|
623
685
|
(0, _8_9_1.test)('GET reports without collectionId param returns 400 or 500', async ({ request, }) => {
|
|
@@ -707,6 +769,11 @@ _8_9_1.test.describe('API optimize SaaS Tests - Export edge cases', () => {
|
|
|
707
769
|
const body = await response.json();
|
|
708
770
|
(0, test_1.expect)(Array.isArray(body)).toBeTruthy();
|
|
709
771
|
(0, test_1.expect)(body.length).toBeGreaterThanOrEqual(2);
|
|
772
|
+
(0, test_1.expect)(body[0]).toHaveProperty('id');
|
|
773
|
+
(0, test_1.expect)(body[0]).toHaveProperty('exportEntityType');
|
|
774
|
+
const exportedIds = body.map((d) => d.id);
|
|
775
|
+
(0, test_1.expect)(exportedIds).toContain(dashboardId1);
|
|
776
|
+
(0, test_1.expect)(exportedIds).toContain(dashboardId2);
|
|
710
777
|
});
|
|
711
778
|
});
|
|
712
779
|
(0, _8_9_1.test)('Export multiple reports in a single call returns 200 with all definitions', async ({ request, }) => {
|
|
@@ -722,6 +789,11 @@ _8_9_1.test.describe('API optimize SaaS Tests - Export edge cases', () => {
|
|
|
722
789
|
const body = await response.json();
|
|
723
790
|
(0, test_1.expect)(Array.isArray(body)).toBeTruthy();
|
|
724
791
|
(0, test_1.expect)(body.length).toBeGreaterThanOrEqual(2);
|
|
792
|
+
(0, test_1.expect)(body[0]).toHaveProperty('id');
|
|
793
|
+
(0, test_1.expect)(body[0]).toHaveProperty('exportEntityType');
|
|
794
|
+
const exportedIds = body.map((d) => d.id);
|
|
795
|
+
(0, test_1.expect)(exportedIds).toContain(reportId1);
|
|
796
|
+
(0, test_1.expect)(exportedIds).toContain(reportId2);
|
|
725
797
|
});
|
|
726
798
|
});
|
|
727
799
|
(0, _8_9_1.test)('Export reports with empty array body returns 200 with empty array', async ({ request, }) => {
|
|
@@ -766,20 +838,20 @@ _8_9_1.test.describe('API optimize SaaS Tests - Auth edge cases', () => {
|
|
|
766
838
|
'invalidsignature';
|
|
767
839
|
await _8_9_1.test.step('GET /api/public/dashboard with expired token returns 401', async () => {
|
|
768
840
|
const response = await request.get(`${baseUrl}/api/public/dashboard?collectionId=any`, { headers: { Authorization: expiredToken } });
|
|
769
|
-
|
|
841
|
+
await assertUnauthorizedResponseBody(response);
|
|
770
842
|
});
|
|
771
843
|
});
|
|
772
844
|
(0, _8_9_1.test)('Malformed Bearer value (empty string) returns 401 on dashboard endpoint', async ({ request, }) => {
|
|
773
845
|
await _8_9_1.test.step('GET /api/public/dashboard with empty Bearer value returns 401', async () => {
|
|
774
846
|
const response = await request.get(`${baseUrl}/api/public/dashboard?collectionId=any`, { headers: { Authorization: 'Bearer ' } });
|
|
775
|
-
|
|
847
|
+
await assertUnauthorizedResponseBody(response);
|
|
776
848
|
});
|
|
777
849
|
});
|
|
778
850
|
(0, _8_9_1.test)('Token with wrong audience returns 401 on dashboard endpoint', async ({ request, }) => {
|
|
779
851
|
await _8_9_1.test.step('Use a Zeebe-audience token against Optimize API and expect 401', async () => {
|
|
780
852
|
const wrongAudienceToken = await (0, apiHelpers_1.authSaasAPI)();
|
|
781
853
|
const response = await request.get(`${baseUrl}/api/public/dashboard?collectionId=any`, { headers: { Authorization: wrongAudienceToken } });
|
|
782
|
-
|
|
854
|
+
await assertUnauthorizedResponseBody(response);
|
|
783
855
|
});
|
|
784
856
|
});
|
|
785
857
|
});
|
|
@@ -799,7 +871,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
799
871
|
const response = await request.get(`${apiUrl()}/v2/topology`, {
|
|
800
872
|
headers: { 'Content-Type': 'application/json' },
|
|
801
873
|
});
|
|
802
|
-
|
|
874
|
+
await assertUnauthorizedResponseBody(response);
|
|
803
875
|
});
|
|
804
876
|
(0, _8_9_1.test)('POST /v2/process-definitions/search returns 200 with items array', async ({ request, }) => {
|
|
805
877
|
const response = await request.post(`${apiUrl()}/v2/process-definitions/search`, {
|
|
@@ -821,7 +893,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
821
893
|
headers: { 'Content-Type': 'application/json' },
|
|
822
894
|
data: { filter: {}, size: 10 },
|
|
823
895
|
});
|
|
824
|
-
|
|
896
|
+
await assertUnauthorizedResponseBody(response);
|
|
825
897
|
});
|
|
826
898
|
(0, _8_9_1.test)('POST /v2/process-definitions/search with invalid token returns 401', async ({ request, }) => {
|
|
827
899
|
const response = await request.post(`${apiUrl()}/v2/process-definitions/search`, {
|
|
@@ -831,7 +903,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
831
903
|
},
|
|
832
904
|
data: { filter: {}, size: 10 },
|
|
833
905
|
});
|
|
834
|
-
|
|
906
|
+
await assertUnauthorizedResponseBody(response);
|
|
835
907
|
});
|
|
836
908
|
(0, _8_9_1.test)('POST /v2/process-definitions/search with size 1 returns pagination cursor', async ({ request, }) => {
|
|
837
909
|
const response = await request.post(`${apiUrl()}/v2/process-definitions/search`, {
|
|
@@ -885,7 +957,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
885
957
|
headers: { 'Content-Type': 'application/json' },
|
|
886
958
|
data: { filter: {}, size: 10 },
|
|
887
959
|
});
|
|
888
|
-
|
|
960
|
+
await assertUnauthorizedResponseBody(response);
|
|
889
961
|
});
|
|
890
962
|
(0, _8_9_1.test)('POST /v2/process-instances/search with invalid token returns 401', async ({ request, }) => {
|
|
891
963
|
const response = await request.post(`${apiUrl()}/v2/process-instances/search`, {
|
|
@@ -895,7 +967,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
895
967
|
},
|
|
896
968
|
data: { filter: {}, size: 10 },
|
|
897
969
|
});
|
|
898
|
-
|
|
970
|
+
await assertUnauthorizedResponseBody(response);
|
|
899
971
|
});
|
|
900
972
|
(0, _8_9_1.test)('POST /v2/user-tasks/search returns 200 with items array', async ({ request, }) => {
|
|
901
973
|
const response = await request.post(`${apiUrl()}/v2/user-tasks/search`, {
|
|
@@ -914,7 +986,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
914
986
|
headers: { 'Content-Type': 'application/json' },
|
|
915
987
|
data: { filter: {}, size: 10 },
|
|
916
988
|
});
|
|
917
|
-
|
|
989
|
+
await assertUnauthorizedResponseBody(response);
|
|
918
990
|
});
|
|
919
991
|
(0, _8_9_1.test)('POST /v2/user-tasks/search with invalid token returns 401', async ({ request, }) => {
|
|
920
992
|
const response = await request.post(`${apiUrl()}/v2/user-tasks/search`, {
|
|
@@ -924,7 +996,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
924
996
|
},
|
|
925
997
|
data: { filter: {}, size: 10 },
|
|
926
998
|
});
|
|
927
|
-
|
|
999
|
+
await assertUnauthorizedResponseBody(response);
|
|
928
1000
|
});
|
|
929
1001
|
(0, _8_9_1.test)('POST /v2/variables/search returns 200 with items array', async ({ request, }) => {
|
|
930
1002
|
const response = await request.post(`${apiUrl()}/v2/variables/search`, {
|
|
@@ -943,7 +1015,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
943
1015
|
headers: { 'Content-Type': 'application/json' },
|
|
944
1016
|
data: { filter: {}, size: 10 },
|
|
945
1017
|
});
|
|
946
|
-
|
|
1018
|
+
await assertUnauthorizedResponseBody(response);
|
|
947
1019
|
});
|
|
948
1020
|
(0, _8_9_1.test)('POST /v2/variables/search with invalid token returns 401', async ({ request, }) => {
|
|
949
1021
|
const response = await request.post(`${apiUrl()}/v2/variables/search`, {
|
|
@@ -953,7 +1025,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
953
1025
|
},
|
|
954
1026
|
data: { filter: {}, size: 10 },
|
|
955
1027
|
});
|
|
956
|
-
|
|
1028
|
+
await assertUnauthorizedResponseBody(response);
|
|
957
1029
|
});
|
|
958
1030
|
(0, _8_9_1.test)('POST /v2/incidents/search returns 200 with items array', async ({ request, }) => {
|
|
959
1031
|
const response = await request.post(`${apiUrl()}/v2/incidents/search`, {
|
|
@@ -972,7 +1044,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
972
1044
|
headers: { 'Content-Type': 'application/json' },
|
|
973
1045
|
data: { filter: {}, size: 10 },
|
|
974
1046
|
});
|
|
975
|
-
|
|
1047
|
+
await assertUnauthorizedResponseBody(response);
|
|
976
1048
|
});
|
|
977
1049
|
(0, _8_9_1.test)('POST /v2/incidents/search with invalid token returns 401', async ({ request, }) => {
|
|
978
1050
|
const response = await request.post(`${apiUrl()}/v2/incidents/search`, {
|
|
@@ -982,7 +1054,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
982
1054
|
},
|
|
983
1055
|
data: { filter: {}, size: 10 },
|
|
984
1056
|
});
|
|
985
|
-
|
|
1057
|
+
await assertUnauthorizedResponseBody(response);
|
|
986
1058
|
});
|
|
987
1059
|
(0, _8_9_1.test)('POST /v2/decision-definitions/search returns 200 with items array', async ({ request, }) => {
|
|
988
1060
|
const response = await request.post(`${apiUrl()}/v2/decision-definitions/search`, {
|
|
@@ -1004,7 +1076,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
1004
1076
|
headers: { 'Content-Type': 'application/json' },
|
|
1005
1077
|
data: { filter: {}, size: 10 },
|
|
1006
1078
|
});
|
|
1007
|
-
|
|
1079
|
+
await assertUnauthorizedResponseBody(response);
|
|
1008
1080
|
});
|
|
1009
1081
|
(0, _8_9_1.test)('POST /v2/decision-definitions/search with invalid token returns 401', async ({ request, }) => {
|
|
1010
1082
|
const response = await request.post(`${apiUrl()}/v2/decision-definitions/search`, {
|
|
@@ -1014,7 +1086,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
1014
1086
|
},
|
|
1015
1087
|
data: { filter: {}, size: 10 },
|
|
1016
1088
|
});
|
|
1017
|
-
|
|
1089
|
+
await assertUnauthorizedResponseBody(response);
|
|
1018
1090
|
});
|
|
1019
1091
|
(0, _8_9_1.test)('POST /v2/decision-instances/search returns 200 with items array', async ({ request, }) => {
|
|
1020
1092
|
const response = await request.post(`${apiUrl()}/v2/decision-instances/search`, {
|
|
@@ -1036,7 +1108,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
1036
1108
|
headers: { 'Content-Type': 'application/json' },
|
|
1037
1109
|
data: { filter: {}, size: 10 },
|
|
1038
1110
|
});
|
|
1039
|
-
|
|
1111
|
+
await assertUnauthorizedResponseBody(response);
|
|
1040
1112
|
});
|
|
1041
1113
|
(0, _8_9_1.test)('POST /v2/decision-instances/search with invalid token returns 401', async ({ request, }) => {
|
|
1042
1114
|
const response = await request.post(`${apiUrl()}/v2/decision-instances/search`, {
|
|
@@ -1046,7 +1118,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
1046
1118
|
},
|
|
1047
1119
|
data: { filter: {}, size: 10 },
|
|
1048
1120
|
});
|
|
1049
|
-
|
|
1121
|
+
await assertUnauthorizedResponseBody(response);
|
|
1050
1122
|
});
|
|
1051
1123
|
(0, _8_9_1.test)('POST /v2/flownode-instances/search returns 200 with items array', async ({ request, }) => {
|
|
1052
1124
|
const response = await request.post(`${apiUrl()}/v2/flownode-instances/search`, {
|
|
@@ -1068,7 +1140,7 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
1068
1140
|
headers: { 'Content-Type': 'application/json' },
|
|
1069
1141
|
data: { filter: {}, size: 10 },
|
|
1070
1142
|
});
|
|
1071
|
-
|
|
1143
|
+
await assertUnauthorizedResponseBody(response);
|
|
1072
1144
|
});
|
|
1073
1145
|
(0, _8_9_1.test)('POST /v2/flownode-instances/search with invalid token returns 401', async ({ request, }) => {
|
|
1074
1146
|
const response = await request.post(`${apiUrl()}/v2/flownode-instances/search`, {
|
|
@@ -1078,6 +1150,6 @@ _8_9_1.test.describe('API V2 tests on SaaS cluster', () => {
|
|
|
1078
1150
|
},
|
|
1079
1151
|
data: { filter: {}, size: 10 },
|
|
1080
1152
|
});
|
|
1081
|
-
|
|
1153
|
+
await assertUnauthorizedResponseBody(response);
|
|
1082
1154
|
});
|
|
1083
1155
|
});
|