@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.
Files changed (82) hide show
  1. package/dist/fixtures/api.d.ts +15 -0
  2. package/dist/fixtures/api.js +27 -0
  3. package/dist/tests/api/v2/authorization/authorization-api-tests.spec.d.ts +1 -0
  4. package/dist/tests/api/v2/authorization/authorization-api-tests.spec.js +247 -0
  5. package/dist/tests/api/v2/authorization/authorization-enforcement-api-tests.spec.d.ts +18 -0
  6. package/dist/tests/api/v2/authorization/authorization-enforcement-api-tests.spec.js +208 -0
  7. package/dist/tests/api/v2/batch-operation/batch-operation-api-tests.spec.d.ts +1 -0
  8. package/dist/tests/api/v2/batch-operation/batch-operation-api-tests.spec.js +264 -0
  9. package/dist/tests/api/v2/cluster/cluster-api-tests.spec.d.ts +1 -0
  10. package/dist/tests/api/v2/cluster/cluster-api-tests.spec.js +86 -0
  11. package/dist/tests/api/v2/decision/decision-api-tests.spec.d.ts +1 -0
  12. package/dist/tests/api/v2/decision/decision-api-tests.spec.js +233 -0
  13. package/dist/tests/api/v2/deployment/deployment-api-tests.spec.d.ts +1 -0
  14. package/dist/tests/api/v2/deployment/deployment-api-tests.spec.js +147 -0
  15. package/dist/tests/api/v2/document/document-api-tests.spec.d.ts +9 -0
  16. package/dist/tests/api/v2/document/document-api-tests.spec.js +111 -0
  17. package/dist/tests/api/v2/element-instance/element-instance-api-tests.spec.d.ts +1 -0
  18. package/dist/tests/api/v2/element-instance/element-instance-api-tests.spec.js +127 -0
  19. package/dist/tests/api/v2/flows/end-to-end-flows.spec.d.ts +9 -0
  20. package/dist/tests/api/v2/flows/end-to-end-flows.spec.js +204 -0
  21. package/dist/tests/api/v2/form/form-api-tests.spec.d.ts +1 -0
  22. package/dist/tests/api/v2/form/form-api-tests.spec.js +88 -0
  23. package/dist/tests/api/v2/identity/group-api-tests.spec.d.ts +1 -0
  24. package/dist/tests/api/v2/identity/group-api-tests.spec.js +172 -0
  25. package/dist/tests/api/v2/identity/membership-api-tests.spec.d.ts +10 -0
  26. package/dist/tests/api/v2/identity/membership-api-tests.spec.js +164 -0
  27. package/dist/tests/api/v2/identity/role-api-tests.spec.d.ts +1 -0
  28. package/dist/tests/api/v2/identity/role-api-tests.spec.js +212 -0
  29. package/dist/tests/api/v2/identity/tenant-api-tests.spec.d.ts +1 -0
  30. package/dist/tests/api/v2/identity/tenant-api-tests.spec.js +319 -0
  31. package/dist/tests/api/v2/identity/user-api-tests.spec.d.ts +1 -0
  32. package/dist/tests/api/v2/identity/user-api-tests.spec.js +148 -0
  33. package/dist/tests/api/v2/job/job-api-tests.spec.d.ts +1 -0
  34. package/dist/tests/api/v2/job/job-api-tests.spec.js +260 -0
  35. package/dist/tests/api/v2/message/message-api-tests.spec.d.ts +1 -0
  36. package/dist/tests/api/v2/message/message-api-tests.spec.js +219 -0
  37. package/dist/tests/api/v2/process-definition/process-definition-api-tests.spec.d.ts +1 -0
  38. package/dist/tests/api/v2/process-definition/process-definition-api-tests.spec.js +118 -0
  39. package/dist/tests/api/v2/process-instance/process-instance-api-tests.spec.d.ts +1 -0
  40. package/dist/tests/api/v2/process-instance/process-instance-api-tests.spec.js +335 -0
  41. package/dist/tests/api/v2/runtime/batch-modification-api-tests.spec.d.ts +1 -0
  42. package/dist/tests/api/v2/runtime/batch-modification-api-tests.spec.js +123 -0
  43. package/dist/tests/api/v2/runtime/variable-incident-api-tests.spec.d.ts +1 -0
  44. package/dist/tests/api/v2/runtime/variable-incident-api-tests.spec.js +174 -0
  45. package/dist/tests/api/v2/system/clock-api-tests.spec.d.ts +19 -0
  46. package/dist/tests/api/v2/system/clock-api-tests.spec.js +62 -0
  47. package/dist/tests/api/v2/system/system-api-tests.spec.d.ts +1 -0
  48. package/dist/tests/api/v2/system/system-api-tests.spec.js +183 -0
  49. package/dist/tests/api/v2/user-task/user-task-api-tests.spec.d.ts +1 -0
  50. package/dist/tests/api/v2/user-task/user-task-api-tests.spec.js +258 -0
  51. package/dist/utils/api/assertions.d.ts +50 -0
  52. package/dist/utils/api/assertions.js +142 -0
  53. package/dist/utils/api/auth.d.ts +27 -0
  54. package/dist/utils/api/auth.js +137 -0
  55. package/dist/utils/api/beans.d.ts +46 -0
  56. package/dist/utils/api/beans.js +87 -0
  57. package/dist/utils/api/bpmn.d.ts +50 -0
  58. package/dist/utils/api/bpmn.js +217 -0
  59. package/dist/utils/api/capabilities.d.ts +90 -0
  60. package/dist/utils/api/capabilities.js +198 -0
  61. package/dist/utils/api/cleanup.d.ts +24 -0
  62. package/dist/utils/api/cleanup.js +120 -0
  63. package/dist/utils/api/config.d.ts +103 -0
  64. package/dist/utils/api/config.js +62 -0
  65. package/dist/utils/api/deployments.d.ts +45 -0
  66. package/dist/utils/api/deployments.js +120 -0
  67. package/dist/utils/api/eventually.d.ts +36 -0
  68. package/dist/utils/api/eventually.js +54 -0
  69. package/dist/utils/api/http.d.ts +56 -0
  70. package/dist/utils/api/http.js +244 -0
  71. package/dist/utils/api/identity.d.ts +29 -0
  72. package/dist/utils/api/identity.js +43 -0
  73. package/dist/utils/api/keys.d.ts +37 -0
  74. package/dist/utils/api/keys.js +40 -0
  75. package/dist/utils/api/paths.d.ts +25 -0
  76. package/dist/utils/api/paths.js +167 -0
  77. package/dist/utils/api/tenancy.d.ts +31 -0
  78. package/dist/utils/api/tenancy.js +65 -0
  79. package/package.json +1 -1
  80. package/playwright.config.ts +14 -2
  81. package/dist/resources/test-api-v2-complete.sh +0 -12246
  82. 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1242",
3
+ "version": "0.0.1243",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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: (process.env.C8E2E_TRACE as 'on' | 'off' | 'retain-on-failure' | 'on-first-retry') || 'on-first-retry',
273
- video: (process.env.C8E2E_VIDEO as 'on' | 'off' | 'retain-on-failure') || 'off',
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
  {