@camunda/e2e-test-suite 0.0.1242 → 0.0.1243
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/fixtures/api.d.ts +15 -0
- package/dist/fixtures/api.js +27 -0
- package/dist/tests/api/v2/authorization/authorization-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/authorization/authorization-api-tests.spec.js +247 -0
- package/dist/tests/api/v2/authorization/authorization-enforcement-api-tests.spec.d.ts +18 -0
- package/dist/tests/api/v2/authorization/authorization-enforcement-api-tests.spec.js +208 -0
- package/dist/tests/api/v2/batch-operation/batch-operation-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/batch-operation/batch-operation-api-tests.spec.js +264 -0
- package/dist/tests/api/v2/cluster/cluster-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/cluster/cluster-api-tests.spec.js +86 -0
- package/dist/tests/api/v2/decision/decision-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/decision/decision-api-tests.spec.js +233 -0
- package/dist/tests/api/v2/deployment/deployment-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/deployment/deployment-api-tests.spec.js +147 -0
- package/dist/tests/api/v2/document/document-api-tests.spec.d.ts +9 -0
- package/dist/tests/api/v2/document/document-api-tests.spec.js +111 -0
- package/dist/tests/api/v2/element-instance/element-instance-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/element-instance/element-instance-api-tests.spec.js +127 -0
- package/dist/tests/api/v2/flows/end-to-end-flows.spec.d.ts +9 -0
- package/dist/tests/api/v2/flows/end-to-end-flows.spec.js +204 -0
- package/dist/tests/api/v2/form/form-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/form/form-api-tests.spec.js +88 -0
- package/dist/tests/api/v2/identity/group-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/identity/group-api-tests.spec.js +172 -0
- package/dist/tests/api/v2/identity/membership-api-tests.spec.d.ts +10 -0
- package/dist/tests/api/v2/identity/membership-api-tests.spec.js +164 -0
- package/dist/tests/api/v2/identity/role-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/identity/role-api-tests.spec.js +212 -0
- package/dist/tests/api/v2/identity/tenant-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/identity/tenant-api-tests.spec.js +319 -0
- package/dist/tests/api/v2/identity/user-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/identity/user-api-tests.spec.js +148 -0
- package/dist/tests/api/v2/job/job-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/job/job-api-tests.spec.js +260 -0
- package/dist/tests/api/v2/message/message-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/message/message-api-tests.spec.js +219 -0
- package/dist/tests/api/v2/process-definition/process-definition-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/process-definition/process-definition-api-tests.spec.js +118 -0
- package/dist/tests/api/v2/process-instance/process-instance-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/process-instance/process-instance-api-tests.spec.js +335 -0
- package/dist/tests/api/v2/runtime/batch-modification-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/runtime/batch-modification-api-tests.spec.js +123 -0
- package/dist/tests/api/v2/runtime/variable-incident-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/runtime/variable-incident-api-tests.spec.js +174 -0
- package/dist/tests/api/v2/system/clock-api-tests.spec.d.ts +19 -0
- package/dist/tests/api/v2/system/clock-api-tests.spec.js +62 -0
- package/dist/tests/api/v2/system/system-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/system/system-api-tests.spec.js +183 -0
- package/dist/tests/api/v2/user-task/user-task-api-tests.spec.d.ts +1 -0
- package/dist/tests/api/v2/user-task/user-task-api-tests.spec.js +258 -0
- package/dist/utils/api/assertions.d.ts +50 -0
- package/dist/utils/api/assertions.js +142 -0
- package/dist/utils/api/auth.d.ts +27 -0
- package/dist/utils/api/auth.js +137 -0
- package/dist/utils/api/beans.d.ts +46 -0
- package/dist/utils/api/beans.js +87 -0
- package/dist/utils/api/bpmn.d.ts +50 -0
- package/dist/utils/api/bpmn.js +217 -0
- package/dist/utils/api/capabilities.d.ts +90 -0
- package/dist/utils/api/capabilities.js +198 -0
- package/dist/utils/api/cleanup.d.ts +24 -0
- package/dist/utils/api/cleanup.js +120 -0
- package/dist/utils/api/config.d.ts +103 -0
- package/dist/utils/api/config.js +62 -0
- package/dist/utils/api/deployments.d.ts +45 -0
- package/dist/utils/api/deployments.js +120 -0
- package/dist/utils/api/eventually.d.ts +36 -0
- package/dist/utils/api/eventually.js +54 -0
- package/dist/utils/api/http.d.ts +56 -0
- package/dist/utils/api/http.js +244 -0
- package/dist/utils/api/identity.d.ts +29 -0
- package/dist/utils/api/identity.js +43 -0
- package/dist/utils/api/keys.d.ts +37 -0
- package/dist/utils/api/keys.js +40 -0
- package/dist/utils/api/paths.d.ts +25 -0
- package/dist/utils/api/paths.js +167 -0
- package/dist/utils/api/tenancy.d.ts +31 -0
- package/dist/utils/api/tenancy.js +65 -0
- package/package.json +1 -1
- package/playwright.config.ts +14 -2
- package/dist/resources/test-api-v2-complete.sh +0 -12246
- package/resources/test-api-v2-complete.sh +0 -12246
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Multi-tenancy handling for REST v2 requests.
|
|
4
|
+
*
|
|
5
|
+
* On a multi-tenant cluster every tenant-aware endpoint needs the tenant
|
|
6
|
+
* supplied, but the endpoints disagree on where: search endpoints take it
|
|
7
|
+
* inside `filter`, mutations take it at the body root, job activation takes an
|
|
8
|
+
* array under `tenantIds`, and GETs take it as a query parameter. When
|
|
9
|
+
* multi-tenancy is off the cluster rejects the field entirely, so nothing is
|
|
10
|
+
* injected.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.tenantQueryParam = exports.applyTenantToBody = void 0;
|
|
14
|
+
const config_1 = require("./config");
|
|
15
|
+
function isPlainObject(value) {
|
|
16
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Applies the tenant to a request body. `auto` mirrors what the endpoints
|
|
20
|
+
* expect: a body that already filters gets the tenant added to that filter, a
|
|
21
|
+
* body that paginates or sorts without filtering gains one, and anything else
|
|
22
|
+
* is treated as a mutation and takes the tenant at the root.
|
|
23
|
+
*/
|
|
24
|
+
function applyTenantToBody(body, mode, config = config_1.apiConfig) {
|
|
25
|
+
if (!config.multiTenancy || mode === 'none' || body === undefined) {
|
|
26
|
+
return body;
|
|
27
|
+
}
|
|
28
|
+
const tenant = config.tenantId;
|
|
29
|
+
if (!isPlainObject(body))
|
|
30
|
+
return body;
|
|
31
|
+
const next = { ...body };
|
|
32
|
+
switch (mode) {
|
|
33
|
+
case 'tenantIds':
|
|
34
|
+
next.tenantIds = [tenant];
|
|
35
|
+
return next;
|
|
36
|
+
case 'root':
|
|
37
|
+
next.tenantId = tenant;
|
|
38
|
+
return next;
|
|
39
|
+
case 'filter':
|
|
40
|
+
if (isPlainObject(next.filter)) {
|
|
41
|
+
next.filter = { ...next.filter, tenantId: tenant };
|
|
42
|
+
}
|
|
43
|
+
return next;
|
|
44
|
+
case 'auto':
|
|
45
|
+
default:
|
|
46
|
+
if (isPlainObject(next.filter)) {
|
|
47
|
+
next.filter = { ...next.filter, tenantId: tenant };
|
|
48
|
+
}
|
|
49
|
+
else if ('page' in next || 'sort' in next) {
|
|
50
|
+
next.filter = { tenantId: tenant };
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
next.tenantId = tenant;
|
|
54
|
+
}
|
|
55
|
+
return next;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.applyTenantToBody = applyTenantToBody;
|
|
59
|
+
/** The `tenantId` query parameter for tenant-aware GET and DELETE requests. */
|
|
60
|
+
function tenantQueryParam(mode, config = config_1.apiConfig) {
|
|
61
|
+
if (!config.multiTenancy || mode === 'none')
|
|
62
|
+
return {};
|
|
63
|
+
return { tenantId: config.tenantId };
|
|
64
|
+
}
|
|
65
|
+
exports.tenantQueryParam = tenantQueryParam;
|
package/package.json
CHANGED
package/playwright.config.ts
CHANGED
|
@@ -258,6 +258,12 @@ export default defineConfig({
|
|
|
258
258
|
testDir: process.env.MINOR_VERSION
|
|
259
259
|
? `./tests/${process.env.MINOR_VERSION}/`
|
|
260
260
|
: `./tests/`,
|
|
261
|
+
// The REST v2 API suite is version-parameterised rather than version-scoped,
|
|
262
|
+
// so it lives outside tests/<MINOR_VERSION>/ and runs from
|
|
263
|
+
// playwright.api.config.ts. This only matters when MINOR_VERSION is unset
|
|
264
|
+
// (local runs), where testDir widens to ./tests/ and would otherwise pull the
|
|
265
|
+
// API specs into a browser project that has none of their environment.
|
|
266
|
+
testIgnore: /[\\/]tests[\\/]api[\\/]/,
|
|
261
267
|
timeout: timeout(),
|
|
262
268
|
workers: workerCount(),
|
|
263
269
|
retries: 1,
|
|
@@ -269,8 +275,14 @@ export default defineConfig({
|
|
|
269
275
|
// Stage 5: trace on-first-retry. With retries=1, a passing-on-retry
|
|
270
276
|
// test (i.e., a flake) leaves a trace from the first attempt — exactly
|
|
271
277
|
// the cases worth debugging. Green runs pay no trace cost.
|
|
272
|
-
trace:
|
|
273
|
-
|
|
278
|
+
trace:
|
|
279
|
+
(process.env.C8E2E_TRACE as
|
|
280
|
+
| 'on'
|
|
281
|
+
| 'off'
|
|
282
|
+
| 'retain-on-failure'
|
|
283
|
+
| 'on-first-retry') || 'on-first-retry',
|
|
284
|
+
video:
|
|
285
|
+
(process.env.C8E2E_VIDEO as 'on' | 'off' | 'retain-on-failure') || 'off',
|
|
274
286
|
},
|
|
275
287
|
projects: [
|
|
276
288
|
{
|