@camunda/e2e-test-suite 0.0.1510 → 0.0.1512
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.10/IdpCreatePage.js +1 -1
- package/dist/pages/8.10/ModelerCreatePage.js +1 -1
- package/dist/pages/8.11/IdpCreatePage.js +4 -2
- package/dist/pages/8.11/ModelerCreatePage.js +1 -1
- package/dist/pages/8.7/ModelerCreatePage.js +1 -1
- package/dist/pages/8.8/ModelerCreatePage.js +1 -1
- package/dist/pages/8.9/IdpCreatePage.js +3 -1
- package/dist/pages/8.9/ModelerCreatePage.js +1 -1
- package/dist/pages/SM-8.8/IdpCreatePage.d.ts +2 -0
- package/dist/pages/SM-8.8/IdpCreatePage.js +42 -4
- package/dist/pages/c8Run/PhysicalTenantPage.d.ts +10 -0
- package/dist/pages/c8Run/PhysicalTenantPage.js +51 -0
- package/dist/resources/c8run-physical-tenant-connector.bpmn +21 -0
- package/dist/resources/c8run-physical-tenant-isolation.bpmn +8 -0
- package/dist/tests/c8Run-8.10/physical-tenants.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.10/physical-tenants.spec.js +4 -0
- package/dist/utils/c8runPhysicalTenants.d.ts +22 -0
- package/dist/utils/c8runPhysicalTenants.js +192 -0
- package/package.json +1 -1
- package/playwright.config.ts +3 -1
- package/resources/c8run-physical-tenant-connector.bpmn +21 -0
- package/resources/c8run-physical-tenant-isolation.bpmn +8 -0
|
@@ -116,7 +116,7 @@ class IdpCreatePage {
|
|
|
116
116
|
name: 'Publish',
|
|
117
117
|
});
|
|
118
118
|
this.unstructured_publishToProjecOption = page.getByRole('menuitem', {
|
|
119
|
-
name: 'Publish to
|
|
119
|
+
name: 'Publish to workspace',
|
|
120
120
|
});
|
|
121
121
|
this.unstructured_versionFieldName = page.locator('#version-name');
|
|
122
122
|
this.unstructured_versionFieldDescription = page.locator('#version-description');
|
|
@@ -265,7 +265,7 @@ class ModelerCreatePage {
|
|
|
265
265
|
this.createEndEvent = page.getByTitle('Create end event');
|
|
266
266
|
this.canvas = page.locator('.djs-container');
|
|
267
267
|
this.zoomOutButton = page.locator('[data-test="zoom-out"]');
|
|
268
|
-
this.endEventCanvas = page.locator('
|
|
268
|
+
this.endEventCanvas = page.locator('.bjs-container');
|
|
269
269
|
this.connectToOtherElementButton = page.getByRole('button', {
|
|
270
270
|
name: 'Connect to other element',
|
|
271
271
|
});
|
|
@@ -115,8 +115,10 @@ class IdpCreatePage {
|
|
|
115
115
|
this.unstructured_publishButton = page.getByRole('button', {
|
|
116
116
|
name: 'Publish',
|
|
117
117
|
});
|
|
118
|
+
// Hub renames "project" to "workspace" once the org has
|
|
119
|
+
// workspacesEnabled, so the publish menu offers "Publish to workspace".
|
|
118
120
|
this.unstructured_publishToProjecOption = page.getByRole('menuitem', {
|
|
119
|
-
name:
|
|
121
|
+
name: /^Publish to (project|workspace)$/,
|
|
120
122
|
});
|
|
121
123
|
this.unstructured_versionFieldName = page.locator('#version-name');
|
|
122
124
|
this.unstructured_versionFieldDescription = page.locator('#version-description');
|
|
@@ -194,7 +196,7 @@ class IdpCreatePage {
|
|
|
194
196
|
this.classifyingLoader = page.getByText('Classifying...');
|
|
195
197
|
// Hub notifications render either as a Carbon alert or, once the
|
|
196
198
|
// design-system toast is on, as a sonner toast carrying no alert role.
|
|
197
|
-
const publishSuccessText =
|
|
199
|
+
const publishSuccessText = /IDP (project|workspace) published successfully\./;
|
|
198
200
|
this.classificationSuccessfullPublishNotification = page
|
|
199
201
|
.getByRole('alert')
|
|
200
202
|
.filter({ hasText: publishSuccessText })
|
|
@@ -265,7 +265,7 @@ class ModelerCreatePage {
|
|
|
265
265
|
this.createEndEvent = page.getByTitle('Create end event');
|
|
266
266
|
this.canvas = page.locator('.djs-container');
|
|
267
267
|
this.zoomOutButton = page.locator('[data-test="zoom-out"]');
|
|
268
|
-
this.endEventCanvas = page.locator('
|
|
268
|
+
this.endEventCanvas = page.locator('.bjs-container');
|
|
269
269
|
this.connectToOtherElementButton = page.getByRole('button', {
|
|
270
270
|
name: 'Connect to other element',
|
|
271
271
|
});
|
|
@@ -227,7 +227,7 @@ class ModelerCreatePage {
|
|
|
227
227
|
this.createTask = page.getByTitle('Create task');
|
|
228
228
|
this.createEndEvent = page.getByTitle('Create end event');
|
|
229
229
|
this.canvas = page.locator('rect').nth(1);
|
|
230
|
-
this.endEventCanvas = page.locator('
|
|
230
|
+
this.endEventCanvas = page.locator('.bjs-container');
|
|
231
231
|
this.connectToOtherElementButton = page.getByRole('button', {
|
|
232
232
|
name: 'Connect to other element',
|
|
233
233
|
});
|
|
@@ -268,7 +268,7 @@ class ModelerCreatePage {
|
|
|
268
268
|
this.createEndEvent = page.getByTitle('Create end event');
|
|
269
269
|
this.canvas = page.locator('.djs-container');
|
|
270
270
|
this.zoomOutButton = page.locator('[data-test="zoom-out"]');
|
|
271
|
-
this.endEventCanvas = page.locator('
|
|
271
|
+
this.endEventCanvas = page.locator('.bjs-container');
|
|
272
272
|
this.connectToOtherElementButton = page.getByRole('button', {
|
|
273
273
|
name: 'Connect to other element',
|
|
274
274
|
});
|
|
@@ -116,8 +116,10 @@ class IdpCreatePage {
|
|
|
116
116
|
this.unstructured_publishButton = page.getByRole('button', {
|
|
117
117
|
name: 'Publish',
|
|
118
118
|
});
|
|
119
|
+
// Hub renamed the action to "Publish to workspace" (camunda-hub#30780);
|
|
120
|
+
// the legacy renderer still says "Publish to project".
|
|
119
121
|
this.unstructured_publishToProjecOption = page.getByRole('menuitem', {
|
|
120
|
-
name:
|
|
122
|
+
name: /^Publish to (workspace|project)$/,
|
|
121
123
|
});
|
|
122
124
|
this.unstructured_versionFieldName = page.locator('#version-name');
|
|
123
125
|
this.unstructured_versionFieldDescription = page.locator('#version-description');
|
|
@@ -249,7 +249,7 @@ class ModelerCreatePage {
|
|
|
249
249
|
this.createEndEvent = page.getByTitle('Create end event');
|
|
250
250
|
this.canvas = page.locator('.djs-container');
|
|
251
251
|
this.zoomOutButton = page.locator('[data-test="zoom-out"]');
|
|
252
|
-
this.endEventCanvas = page.locator('
|
|
252
|
+
this.endEventCanvas = page.locator('.bjs-container');
|
|
253
253
|
this.connectToOtherElementButton = page.getByRole('button', {
|
|
254
254
|
name: 'Connect to other element',
|
|
255
255
|
});
|
|
@@ -41,6 +41,8 @@ declare class IdpCreatePage {
|
|
|
41
41
|
readonly structured_TestSummaryResult: Locator;
|
|
42
42
|
readonly structured_DetailsResult: Locator;
|
|
43
43
|
readonly structured_ExtractionFailedToast: Locator;
|
|
44
|
+
readonly structured_ExtractionNotCompletedHeading: Locator;
|
|
45
|
+
readonly structured_RerunExtractionButton: Locator;
|
|
44
46
|
readonly structured_PublishTemplateButton: Locator;
|
|
45
47
|
readonly structured_PublishTemplateToProjectButton: Locator;
|
|
46
48
|
readonly structured_SuccessfulPublishNotification: Locator;
|
|
@@ -45,6 +45,8 @@ class IdpCreatePage {
|
|
|
45
45
|
structured_TestSummaryResult;
|
|
46
46
|
structured_DetailsResult;
|
|
47
47
|
structured_ExtractionFailedToast;
|
|
48
|
+
structured_ExtractionNotCompletedHeading;
|
|
49
|
+
structured_RerunExtractionButton;
|
|
48
50
|
structured_PublishTemplateButton;
|
|
49
51
|
structured_PublishTemplateToProjectButton;
|
|
50
52
|
structured_SuccessfulPublishNotification;
|
|
@@ -139,6 +141,12 @@ class IdpCreatePage {
|
|
|
139
141
|
this.structured_ExtractionFailedToast = page
|
|
140
142
|
.getByText('Extraction failed')
|
|
141
143
|
.first();
|
|
144
|
+
this.structured_ExtractionNotCompletedHeading = page.getByRole('heading', {
|
|
145
|
+
name: 'Extraction could not be completed',
|
|
146
|
+
});
|
|
147
|
+
this.structured_RerunExtractionButton = page.getByRole('button', {
|
|
148
|
+
name: 'Rerun extraction',
|
|
149
|
+
});
|
|
142
150
|
this.structured_PublishTemplateButton = page.getByRole('button', {
|
|
143
151
|
name: 'Publish Template',
|
|
144
152
|
});
|
|
@@ -311,10 +319,40 @@ class IdpCreatePage {
|
|
|
311
319
|
});
|
|
312
320
|
}
|
|
313
321
|
async selectAllExtractionFields() {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
322
|
+
const maxRetries = 3;
|
|
323
|
+
const fieldsOrFailure = this.structured_CheckboxSelectAllFields
|
|
324
|
+
.or(this.structured_ExtractionNotCompletedHeading)
|
|
325
|
+
.first();
|
|
326
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
327
|
+
await (0, test_1.expect)(fieldsOrFailure).toBeVisible({ timeout: 120000 });
|
|
328
|
+
if (await this.structured_CheckboxSelectAllFields
|
|
329
|
+
.isVisible()
|
|
330
|
+
.catch(() => false)) {
|
|
331
|
+
await this.structured_CheckboxSelectAllFields.click({ timeout: 60000 });
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
const toasts = await this.page
|
|
335
|
+
.getByRole('alert')
|
|
336
|
+
.allInnerTexts()
|
|
337
|
+
.catch(() => []);
|
|
338
|
+
console.error(`Structured extraction attempt ${attempt + 1} did not complete: ` +
|
|
339
|
+
toasts.map((t) => t.replace(/\s+/g, ' ').trim()).join(' | '));
|
|
340
|
+
if (attempt < maxRetries - 1) {
|
|
341
|
+
for (let i = 0; i < 5; i++) {
|
|
342
|
+
if (!(await this.closeNotificationButton.isVisible()))
|
|
343
|
+
break;
|
|
344
|
+
await this.closeNotificationButton
|
|
345
|
+
.click({ timeout: 5000 })
|
|
346
|
+
.catch(() => { });
|
|
347
|
+
}
|
|
348
|
+
await (0, sleep_1.sleep)(5000);
|
|
349
|
+
await this.structured_RerunExtractionButton.click({ timeout: 60000 });
|
|
350
|
+
await (0, test_1.expect)(this.structured_ExtractionNotCompletedHeading).not.toBeVisible({ timeout: 30000 });
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
throw new Error(`Structured extraction of the uploaded document failed after ` +
|
|
354
|
+
`${maxRetries} attempts ("Extraction could not be completed"). ` +
|
|
355
|
+
`Check the document upload to the cluster / IDP backend.`);
|
|
318
356
|
}
|
|
319
357
|
async clickTablesTab() {
|
|
320
358
|
await (0, test_1.expect)(this.structured_TablesTab).toBeVisible({
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Page } from '@playwright/test';
|
|
2
|
+
export declare class PhysicalTenantPage {
|
|
3
|
+
private readonly page;
|
|
4
|
+
private readonly root;
|
|
5
|
+
constructor(page: Page, root: string);
|
|
6
|
+
login(app: 'operate' | 'tasklist', username: string, password: string): Promise<void>;
|
|
7
|
+
expectLoginRejected(): Promise<void>;
|
|
8
|
+
expectLoggedIn(app: 'operate' | 'tasklist'): Promise<void>;
|
|
9
|
+
expectInstance(processId: string, instanceKey: string, visible: boolean): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PhysicalTenantPage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
class PhysicalTenantPage {
|
|
6
|
+
page;
|
|
7
|
+
root;
|
|
8
|
+
constructor(page, root) {
|
|
9
|
+
this.page = page;
|
|
10
|
+
this.root = root;
|
|
11
|
+
}
|
|
12
|
+
async login(app, username, password) {
|
|
13
|
+
await this.page.goto(`${this.root}/${app}`);
|
|
14
|
+
// The login app still needs to render after navigation on native runners.
|
|
15
|
+
await (0, test_1.expect)(this.page.getByLabel(/^Username/)).toBeVisible({
|
|
16
|
+
timeout: 60000,
|
|
17
|
+
});
|
|
18
|
+
await this.page.getByLabel(/^Username/).fill(username);
|
|
19
|
+
await this.page.getByLabel(/^Password/).fill(password);
|
|
20
|
+
await this.page.getByRole('button', { name: 'Login', exact: true }).click();
|
|
21
|
+
}
|
|
22
|
+
async expectLoginRejected() {
|
|
23
|
+
await (0, test_1.expect)(this.page.getByText('Username and Password do not match')).toBeVisible({ timeout: 30000 });
|
|
24
|
+
await (0, test_1.expect)(this.page.getByRole('button', { name: 'Login', exact: true })).toBeVisible();
|
|
25
|
+
}
|
|
26
|
+
async expectLoggedIn(app) {
|
|
27
|
+
await (0, test_1.expect)(this.page.getByRole('button', { name: 'Login', exact: true })).toBeHidden({ timeout: 60000 });
|
|
28
|
+
const banner = app === 'operate'
|
|
29
|
+
? this.page.getByRole('link', { name: 'Processes', exact: true })
|
|
30
|
+
: this.page.getByRole('link', { name: 'Camunda logo' });
|
|
31
|
+
await (0, test_1.expect)(banner).toBeVisible({ timeout: 60000 });
|
|
32
|
+
}
|
|
33
|
+
async expectInstance(processId, instanceKey, visible) {
|
|
34
|
+
await this.page.goto(`${this.root}/operate/processes?active=true&incidents=true&completed=true&canceled=true&process=${encodeURIComponent(processId)}&processInstanceKey=${instanceKey}`);
|
|
35
|
+
const instance = this.page.getByRole('link', {
|
|
36
|
+
name: `View instance ${instanceKey}`,
|
|
37
|
+
exact: true,
|
|
38
|
+
});
|
|
39
|
+
if (visible) {
|
|
40
|
+
await (0, test_1.expect)(async () => {
|
|
41
|
+
await this.page.reload();
|
|
42
|
+
await (0, test_1.expect)(instance).toBeVisible({ timeout: 5000 });
|
|
43
|
+
}).toPass({ timeout: 60000 });
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
await (0, test_1.expect)(this.page.getByText('There are no Instances matching this filter set')).toBeVisible({ timeout: 60000 });
|
|
47
|
+
await (0, test_1.expect)(instance).toHaveCount(0);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.PhysicalTenantPage = PhysicalTenantPage;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" id="Definitions_pt_connector" targetNamespace="http://bpmn.io/schema/bpmn">
|
|
3
|
+
<bpmn:process id="PHYSICAL_TENANT_PROCESS" isExecutable="true">
|
|
4
|
+
<bpmn:startEvent id="start"/>
|
|
5
|
+
<bpmn:sequenceFlow id="to_task" sourceRef="start" targetRef="task"/>
|
|
6
|
+
<bpmn:serviceTask id="task">
|
|
7
|
+
<bpmn:extensionElements>
|
|
8
|
+
<zeebe:taskDefinition type="io.camunda:http-json:1" retries="1"/>
|
|
9
|
+
<zeebe:ioMapping>
|
|
10
|
+
<zeebe:input source="noAuth" target="authentication.type"/>
|
|
11
|
+
<zeebe:input source="POST" target="method"/>
|
|
12
|
+
<zeebe:input source="=echoUrl" target="url"/>
|
|
13
|
+
<zeebe:input source="=camunda.secrets.C8RUN_E2E_SECRET" target="body"/>
|
|
14
|
+
</zeebe:ioMapping>
|
|
15
|
+
<zeebe:taskHeaders><zeebe:header key="resultVariable" value="connectorResult"/></zeebe:taskHeaders>
|
|
16
|
+
</bpmn:extensionElements>
|
|
17
|
+
</bpmn:serviceTask>
|
|
18
|
+
<bpmn:sequenceFlow id="to_end" sourceRef="task" targetRef="end"/>
|
|
19
|
+
<bpmn:endEvent id="end"/>
|
|
20
|
+
</bpmn:process>
|
|
21
|
+
</bpmn:definitions>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" id="Definitions_pt" targetNamespace="http://bpmn.io/schema/bpmn">
|
|
3
|
+
<bpmn:process id="PHYSICAL_TENANT_PROCESS" isExecutable="true">
|
|
4
|
+
<bpmn:startEvent id="start"/>
|
|
5
|
+
<bpmn:sequenceFlow id="flow" sourceRef="start" targetRef="end"/>
|
|
6
|
+
<bpmn:endEvent id="end"/>
|
|
7
|
+
</bpmn:process>
|
|
8
|
+
</bpmn:definitions>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { APIRequestContext, PlaywrightTestArgs, PlaywrightTestOptions } from '@playwright/test';
|
|
2
|
+
declare class TenantAPI {
|
|
3
|
+
private readonly request;
|
|
4
|
+
readonly root: string;
|
|
5
|
+
private readonly resources;
|
|
6
|
+
constructor(request: APIRequestContext, root: string);
|
|
7
|
+
deploy(connector?: boolean): Promise<{
|
|
8
|
+
id: string;
|
|
9
|
+
key: any;
|
|
10
|
+
}>;
|
|
11
|
+
search(path: string, filter: Record<string, unknown>, root?: string): Promise<any>;
|
|
12
|
+
create(key: string, variables?: {}): Promise<string>;
|
|
13
|
+
completed(key: string): Promise<void>;
|
|
14
|
+
cleanup(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare const test: import("@playwright/test").TestType<PlaywrightTestArgs & PlaywrightTestOptions & {
|
|
17
|
+
tenantAPI: TenantAPI;
|
|
18
|
+
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
|
19
|
+
export declare function physicalTenantTests(register: (title: string, body: (args: PlaywrightTestArgs & PlaywrightTestOptions & {
|
|
20
|
+
tenantAPI: TenantAPI;
|
|
21
|
+
}) => Promise<void>) => void): void;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.physicalTenantTests = exports.test = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const promises_1 = require("node:fs/promises");
|
|
6
|
+
const node_http_1 = require("node:http");
|
|
7
|
+
const _setup_1 = require("../test-setup.js");
|
|
8
|
+
const PhysicalTenantPage_1 = require("../pages/c8Run/PhysicalTenantPage");
|
|
9
|
+
const tenantPath = '/physical-tenants/pt1';
|
|
10
|
+
const password = 'pt1-e2e-password';
|
|
11
|
+
class TenantAPI {
|
|
12
|
+
request;
|
|
13
|
+
root;
|
|
14
|
+
resources = [];
|
|
15
|
+
constructor(request, root) {
|
|
16
|
+
this.request = request;
|
|
17
|
+
this.root = root;
|
|
18
|
+
}
|
|
19
|
+
async deploy(connector = false) {
|
|
20
|
+
const id = `PhysicalTenant_${await (0, _setup_1.generateRandomStringAsync)(16)}`;
|
|
21
|
+
const model = await (0, promises_1.readFile)(`resources/c8run-physical-tenant-${connector ? 'connector' : 'isolation'}.bpmn`, 'utf8');
|
|
22
|
+
const response = await this.request.post(`${this.root}/v2/deployments`, {
|
|
23
|
+
// Native Windows can exceed the inherited 10s action timeout while
|
|
24
|
+
// concurrent suites deploy. Wait for this command; never resend it.
|
|
25
|
+
timeout: 60000,
|
|
26
|
+
multipart: {
|
|
27
|
+
resources: {
|
|
28
|
+
name: `${id}.bpmn`,
|
|
29
|
+
mimeType: 'application/xml',
|
|
30
|
+
buffer: Buffer.from(model.replace('PHYSICAL_TENANT_PROCESS', id)),
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
(0, test_1.expect)(response.status(), await response.text()).toBe(200);
|
|
35
|
+
const body = await response.json();
|
|
36
|
+
const definition = body.deployments[0].processDefinition;
|
|
37
|
+
this.resources.push(definition.resourceKey ?? definition.processDefinitionKey);
|
|
38
|
+
return { id, key: definition.processDefinitionKey };
|
|
39
|
+
}
|
|
40
|
+
async search(path, filter, root = this.root) {
|
|
41
|
+
const response = await this.request.post(`${root}/v2/${path}/search`, {
|
|
42
|
+
data: { filter },
|
|
43
|
+
});
|
|
44
|
+
(0, test_1.expect)(response.status(), await response.text()).toBe(200);
|
|
45
|
+
return (await response.json()).items;
|
|
46
|
+
}
|
|
47
|
+
async create(key, variables = {}) {
|
|
48
|
+
const response = await this.request.post(`${this.root}/v2/process-instances`, {
|
|
49
|
+
data: { processDefinitionKey: key, variables },
|
|
50
|
+
});
|
|
51
|
+
(0, test_1.expect)(response.status(), await response.text()).toBe(200);
|
|
52
|
+
return (await response.json()).processInstanceKey;
|
|
53
|
+
}
|
|
54
|
+
async completed(key) {
|
|
55
|
+
await test_1.expect
|
|
56
|
+
.poll(async () => {
|
|
57
|
+
const items = await this.search('process-instances', {
|
|
58
|
+
processInstanceKey: key,
|
|
59
|
+
});
|
|
60
|
+
return items[0]?.state;
|
|
61
|
+
}, { timeout: 120000 })
|
|
62
|
+
.toBe('COMPLETED');
|
|
63
|
+
}
|
|
64
|
+
async cleanup() {
|
|
65
|
+
for (const key of this.resources) {
|
|
66
|
+
const response = await this.request.post(`${this.root}/v2/resources/${key}/deletion`, {
|
|
67
|
+
data: { deleteHistory: true },
|
|
68
|
+
});
|
|
69
|
+
(0, test_1.expect)(response.status(), await response.text()).toBe(200);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.test = test_1.test.extend({
|
|
74
|
+
tenantAPI: async ({ request, baseURL }, use) => {
|
|
75
|
+
const api = new TenantAPI(request, `${baseURL}${tenantPath}`);
|
|
76
|
+
try {
|
|
77
|
+
await use(api);
|
|
78
|
+
}
|
|
79
|
+
finally {
|
|
80
|
+
await api.cleanup();
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
// Register at the versioned spec's call site so reporters and reproduction workflows retain its path.
|
|
85
|
+
function physicalTenantTests(register) {
|
|
86
|
+
exports.test.describe('c8run physical tenants @tasklistV2', () => {
|
|
87
|
+
exports.test.describe.configure({ mode: 'parallel' });
|
|
88
|
+
exports.test.afterEach(async ({ page }, testInfo) => {
|
|
89
|
+
await (0, _setup_1.captureScreenshot)(page, testInfo);
|
|
90
|
+
await (0, _setup_1.captureFailureVideo)(page, testInfo);
|
|
91
|
+
});
|
|
92
|
+
register('Routes unprotected APIs to the requested physical tenant', async ({ request, baseURL }) => {
|
|
93
|
+
await exports.test.step('Default and pt1 are reachable; an unknown tenant is not', async () => {
|
|
94
|
+
for (const [path, status] of [
|
|
95
|
+
['', 200],
|
|
96
|
+
[tenantPath, 200],
|
|
97
|
+
['/physical-tenants/doesnotexist', 404],
|
|
98
|
+
]) {
|
|
99
|
+
const response = await request.get(`${baseURL}${path}/v2/topology`);
|
|
100
|
+
(0, test_1.expect)(response.status()).toBe(status);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
register('Isolates deployed processes from the default tenant', async ({ tenantAPI, baseURL }) => {
|
|
105
|
+
const process = await tenantAPI.deploy();
|
|
106
|
+
await exports.test.step('Only pt1 can find the deployment', async () => {
|
|
107
|
+
await test_1.expect
|
|
108
|
+
.poll(async () => (await tenantAPI.search('process-definitions', {
|
|
109
|
+
processDefinitionId: process.id,
|
|
110
|
+
})).length, { timeout: 60000 })
|
|
111
|
+
.toBe(1);
|
|
112
|
+
(0, test_1.expect)(await tenantAPI.search('process-definitions', { processDefinitionId: process.id }, baseURL)).toEqual([]);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
register('Resolves the tenant secret through its Connectors runtime', async ({ tenantAPI, baseURL }) => {
|
|
116
|
+
const received = [];
|
|
117
|
+
const server = (0, node_http_1.createServer)(async (request, response) => {
|
|
118
|
+
let body = '';
|
|
119
|
+
for await (const chunk of request)
|
|
120
|
+
body += chunk;
|
|
121
|
+
received.push(body);
|
|
122
|
+
response.writeHead(200, { 'Content-Type': 'application/json' });
|
|
123
|
+
response.end(JSON.stringify({ resolved: body }));
|
|
124
|
+
});
|
|
125
|
+
await new Promise((resolve, reject) => {
|
|
126
|
+
server.once('error', reject);
|
|
127
|
+
server.listen(0, '127.0.0.1', resolve);
|
|
128
|
+
});
|
|
129
|
+
try {
|
|
130
|
+
await exports.test.step('Execute the connector with camunda.secrets as its input', async () => {
|
|
131
|
+
const process = await tenantAPI.deploy(true);
|
|
132
|
+
const echoUrl = `http://127.0.0.1:${server.address().port}/echo`;
|
|
133
|
+
const key = await tenantAPI.create(process.key, { echoUrl });
|
|
134
|
+
await tenantAPI.completed(key);
|
|
135
|
+
(0, test_1.expect)(received).toContain('pt1-only-secret-value');
|
|
136
|
+
await test_1.expect
|
|
137
|
+
.poll(async () => {
|
|
138
|
+
const variables = await tenantAPI.search('variables', {
|
|
139
|
+
processInstanceKey: key,
|
|
140
|
+
name: 'connectorResult',
|
|
141
|
+
});
|
|
142
|
+
return (variables[0] && JSON.parse(variables[0].value).body.resolved);
|
|
143
|
+
}, { timeout: 60000 })
|
|
144
|
+
.toBe('pt1-only-secret-value');
|
|
145
|
+
(0, test_1.expect)(await tenantAPI.search('variables', { processInstanceKey: key, name: 'connectorResult' }, baseURL)).toEqual([]);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
finally {
|
|
149
|
+
await new Promise((resolve, reject) => server.close((error) => (error ? reject(error) : resolve())));
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
register('Shows the tenant instance only in its own Operate', async ({ tenantAPI, page, baseURL }) => {
|
|
153
|
+
const process = await tenantAPI.deploy();
|
|
154
|
+
const key = await tenantAPI.create(process.key);
|
|
155
|
+
await tenantAPI.completed(key);
|
|
156
|
+
await exports.test.step('Alice sees the instance in pt1 Operate', async () => {
|
|
157
|
+
const tenant = new PhysicalTenantPage_1.PhysicalTenantPage(page, `${baseURL}${tenantPath}`);
|
|
158
|
+
await tenant.login('operate', 'alice', password);
|
|
159
|
+
await tenant.expectLoggedIn('operate');
|
|
160
|
+
await tenant.expectInstance(process.id, key, true);
|
|
161
|
+
});
|
|
162
|
+
await exports.test.step('Demo sees no matching instance in default Operate', async () => {
|
|
163
|
+
await page.context().clearCookies();
|
|
164
|
+
const defaultTenant = new PhysicalTenantPage_1.PhysicalTenantPage(page, baseURL);
|
|
165
|
+
await defaultTenant.login('operate', 'demo', 'demo');
|
|
166
|
+
await defaultTenant.expectLoggedIn('operate');
|
|
167
|
+
await defaultTenant.expectInstance(process.id, key, false);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
register('Rejects credentials belonging to another physical tenant', async ({ page, baseURL }) => {
|
|
171
|
+
for (const [path, username, secret] of [
|
|
172
|
+
[tenantPath, 'demo', 'demo'],
|
|
173
|
+
['', 'alice', password],
|
|
174
|
+
]) {
|
|
175
|
+
await exports.test.step(`Reject ${username} on ${path || 'default'}`, async () => {
|
|
176
|
+
await page.context().clearCookies();
|
|
177
|
+
const tenant = new PhysicalTenantPage_1.PhysicalTenantPage(page, `${baseURL}${path}`);
|
|
178
|
+
await tenant.login('operate', username, secret);
|
|
179
|
+
await tenant.expectLoginRejected();
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
register('Logs Alice into the physical tenant Tasklist', async ({ page, baseURL }) => {
|
|
184
|
+
await exports.test.step('Open pt1 Tasklist and log in as Alice', async () => {
|
|
185
|
+
const tenant = new PhysicalTenantPage_1.PhysicalTenantPage(page, `${baseURL}${tenantPath}`);
|
|
186
|
+
await tenant.login('tasklist', 'alice', password);
|
|
187
|
+
await tenant.expectLoggedIn('tasklist');
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
exports.physicalTenantTests = physicalTenantTests;
|
package/package.json
CHANGED
package/playwright.config.ts
CHANGED
|
@@ -376,7 +376,9 @@ const dependencies = (project: string) => {
|
|
|
376
376
|
};
|
|
377
377
|
|
|
378
378
|
const regularTestIgnore =
|
|
379
|
-
|
|
379
|
+
process.env.C8RUN_PHYSICAL_TENANTS === 'unsupported'
|
|
380
|
+
? /(?:test-setup|prod-cluster-cleanup|hub-web-modeler-smoke|topology-orchestration-smoke|physical-tenants)\.spec\.[jt]s$/
|
|
381
|
+
: /(?:test-setup|prod-cluster-cleanup|hub-web-modeler-smoke|topology-orchestration-smoke)\.spec\.[jt]s$/;
|
|
380
382
|
|
|
381
383
|
export default defineConfig({
|
|
382
384
|
testDir: process.env.MINOR_VERSION
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" id="Definitions_pt_connector" targetNamespace="http://bpmn.io/schema/bpmn">
|
|
3
|
+
<bpmn:process id="PHYSICAL_TENANT_PROCESS" isExecutable="true">
|
|
4
|
+
<bpmn:startEvent id="start"/>
|
|
5
|
+
<bpmn:sequenceFlow id="to_task" sourceRef="start" targetRef="task"/>
|
|
6
|
+
<bpmn:serviceTask id="task">
|
|
7
|
+
<bpmn:extensionElements>
|
|
8
|
+
<zeebe:taskDefinition type="io.camunda:http-json:1" retries="1"/>
|
|
9
|
+
<zeebe:ioMapping>
|
|
10
|
+
<zeebe:input source="noAuth" target="authentication.type"/>
|
|
11
|
+
<zeebe:input source="POST" target="method"/>
|
|
12
|
+
<zeebe:input source="=echoUrl" target="url"/>
|
|
13
|
+
<zeebe:input source="=camunda.secrets.C8RUN_E2E_SECRET" target="body"/>
|
|
14
|
+
</zeebe:ioMapping>
|
|
15
|
+
<zeebe:taskHeaders><zeebe:header key="resultVariable" value="connectorResult"/></zeebe:taskHeaders>
|
|
16
|
+
</bpmn:extensionElements>
|
|
17
|
+
</bpmn:serviceTask>
|
|
18
|
+
<bpmn:sequenceFlow id="to_end" sourceRef="task" targetRef="end"/>
|
|
19
|
+
<bpmn:endEvent id="end"/>
|
|
20
|
+
</bpmn:process>
|
|
21
|
+
</bpmn:definitions>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" id="Definitions_pt" targetNamespace="http://bpmn.io/schema/bpmn">
|
|
3
|
+
<bpmn:process id="PHYSICAL_TENANT_PROCESS" isExecutable="true">
|
|
4
|
+
<bpmn:startEvent id="start"/>
|
|
5
|
+
<bpmn:sequenceFlow id="flow" sourceRef="start" targetRef="end"/>
|
|
6
|
+
<bpmn:endEvent id="end"/>
|
|
7
|
+
</bpmn:process>
|
|
8
|
+
</bpmn:definitions>
|