@camunda/e2e-test-suite 0.0.1587 → 0.0.1589

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.
@@ -90,20 +90,42 @@ class ConnectorTemplatePage {
90
90
  await (0, test_1.expect)(dialog).toBeHidden({ timeout: 60000 });
91
91
  return null;
92
92
  }
93
- // Replace the whole content of the open template file. Monaco only picks up
94
- // real input events, so the old content is selected and deleted via the
95
- // keyboard and the new JSON is inserted as a single input.
93
+ // Replace the whole content of the open template file. Web Modeler's Monaco
94
+ // editor uses the EditContext API, under which keyboard.insertText of a
95
+ // multi-line string is re-indented line by line (and can end up as invalid
96
+ // JSON, which disables Publish). Pasting is applied verbatim, so the new
97
+ // JSON goes through the clipboard instead.
96
98
  async replaceTemplateJson(json, expectedText) {
97
99
  const editor = this.page.locator('.monaco-editor').first();
98
100
  await (0, test_1.expect)(editor).toBeVisible({ timeout: 90000 });
99
- await editor.locator('.view-lines').click();
101
+ await this.page
102
+ .context()
103
+ .grantPermissions(['clipboard-read', 'clipboard-write']);
104
+ await this.page.evaluate(async (text) => await navigator.clipboard.writeText(text), json);
105
+ // Click inside the visible text area, just right of the line numbers:
106
+ // clicking the centre of `.view-lines` can land far right on a long line
107
+ // and miss the editor, so the shortcuts below would act on the page
108
+ // instead. Monaco marks the editor `focused` once it owns the keyboard.
109
+ await (0, test_1.expect)(async () => {
110
+ const box = await editor.boundingBox();
111
+ if (!box) {
112
+ throw new Error('Template editor has no bounding box');
113
+ }
114
+ await editor.click({
115
+ position: { x: Math.min(120, box.width / 2), y: box.height / 2 },
116
+ timeout: 10000,
117
+ });
118
+ await (0, test_1.expect)(editor).toHaveClass(/\bfocused\b/, { timeout: 5000 });
119
+ }).toPass({ timeout: 60000 });
100
120
  await this.page.keyboard.press('ControlOrMeta+A');
101
- await this.page.keyboard.press('Delete');
102
- await this.page.keyboard.insertText(json);
121
+ await this.page.keyboard.press('ControlOrMeta+V');
103
122
  await this.page.keyboard.press('ControlOrMeta+Home');
104
123
  await (0, test_1.expect)(editor.locator('.view-lines')).toContainText(expectedText, {
105
124
  timeout: 30000,
106
125
  });
126
+ await (0, test_1.expect)(this.page.getByText('Your JSON is invalid')).toBeHidden({
127
+ timeout: 30000,
128
+ });
107
129
  }
108
130
  async publishConnector() {
109
131
  try {
@@ -31,7 +31,10 @@ class PhysicalTenantPage {
31
31
  await (0, test_1.expect)(banner).toBeVisible({ timeout: 60000 });
32
32
  }
33
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}`);
34
+ // Each physical tenant has its own key space, so the same instance key can
35
+ // exist in both. Operate only honours `processDefinitionId` (an unknown
36
+ // `process` param is dropped), which scopes the lookup to this process.
37
+ await this.page.goto(`${this.root}/operate/processes?active=true&incidents=true&completed=true&canceled=true&processDefinitionId=${encodeURIComponent(processId)}&processInstanceKey=${instanceKey}`);
35
38
  const instance = this.page.getByRole('link', {
36
39
  name: `View instance ${instanceKey}`,
37
40
  exact: true,
@@ -19,18 +19,24 @@ class TenantAPI {
19
19
  async deploy(connector = false) {
20
20
  const id = `PhysicalTenant_${await (0, _setup_1.generateRandomStringAsync)(16)}`;
21
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)),
22
+ const buffer = Buffer.from(model.replace('PHYSICAL_TENANT_PROCESS', id));
23
+ let response;
24
+ // On slow native runners (macOS Intel) the single broker's actors stall
25
+ // for up to a minute while every suite starts at once, and the gateway
26
+ // answers 504 DEADLINE_EXCEEDED / 503 RESOURCE_EXHAUSTED. Retrying is safe:
27
+ // the same bytes under the same resource name are deduplicated by the
28
+ // engine, so a retry returns the original definition, not a new version.
29
+ await (0, test_1.expect)(async () => {
30
+ response = await this.request.post(`${this.root}/v2/deployments`, {
31
+ // Native Windows can exceed the inherited 10s action timeout while
32
+ // concurrent suites deploy.
33
+ timeout: 60000,
34
+ multipart: {
35
+ resources: { name: `${id}.bpmn`, mimeType: 'application/xml', buffer },
31
36
  },
32
- },
33
- });
37
+ });
38
+ (0, test_1.expect)([503, 504], await response.text()).not.toContain(response.status());
39
+ }).toPass({ timeout: 180000, intervals: [5000, 10000, 15000] });
34
40
  (0, test_1.expect)(response.status(), await response.text()).toBe(200);
35
41
  const body = await response.json();
36
42
  const definition = body.deployments[0].processDefinition;
@@ -46,6 +52,9 @@ class TenantAPI {
46
52
  }
47
53
  async create(key, variables = {}) {
48
54
  const response = await this.request.post(`${this.root}/v2/process-instances`, {
55
+ // Not idempotent, so never resent; wait out a busy broker instead of
56
+ // the inherited 10s action timeout (the gateway itself caps at 15s).
57
+ timeout: 60000,
49
58
  data: { processDefinitionKey: key, variables },
50
59
  });
51
60
  (0, test_1.expect)(response.status(), await response.text()).toBe(200);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1587",
3
+ "version": "0.0.1589",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",