@camunda/e2e-test-suite 0.0.412 → 0.0.414

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.
@@ -11,8 +11,10 @@ export declare class OCIdentityClusterVariablesPage {
11
11
  readonly variableRow: (variableName: string) => Locator;
12
12
  readonly monacoEditor: Locator;
13
13
  readonly monacoEditorTextArea: Locator;
14
+ readonly monacoSuggestWidget: Locator;
14
15
  readonly successMessage: Locator;
15
16
  readonly editMenuItem: Locator;
17
+ readonly editModalHeading: Locator;
16
18
  constructor(page: Page);
17
19
  editVariable(variableName: string, newValue: string): Promise<void>;
18
20
  assertVariableExists(variableName: string): Promise<void>;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OCIdentityClusterVariablesPage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
+ const sleep_1 = require("../../utils/sleep");
5
6
  class OCIdentityClusterVariablesPage {
6
7
  page;
7
8
  variablesList;
@@ -14,8 +15,10 @@ class OCIdentityClusterVariablesPage {
14
15
  variableRow;
15
16
  monacoEditor;
16
17
  monacoEditorTextArea;
18
+ monacoSuggestWidget;
17
19
  successMessage;
18
20
  editMenuItem;
21
+ editModalHeading;
19
22
  constructor(page) {
20
23
  this.page = page;
21
24
  this.variablesList = page.locator('table.cds--data-table');
@@ -39,7 +42,10 @@ class OCIdentityClusterVariablesPage {
39
42
  });
40
43
  this.monacoEditor = this.editVariableModal.locator('.monaco-editor');
41
44
  this.monacoEditorTextArea = this.monacoEditor.locator('textarea.inputarea');
45
+ this.monacoSuggestWidget = this.monacoEditor.locator('.editor-widget.suggest-widget');
42
46
  this.successMessage = this.page.getByText('Cluster variable updated');
47
+ this.editModalHeading =
48
+ this.editVariableModal.locator('.cds--modal-header');
43
49
  this.editMenuItem = this.page
44
50
  .locator('button[role="menuitem"]')
45
51
  .filter({ hasText: /^Edit$/ });
@@ -50,14 +56,36 @@ class OCIdentityClusterVariablesPage {
50
56
  await this.editMenuItem.click();
51
57
  await (0, test_1.expect)(this.variableValueField).toBeVisible();
52
58
  await (0, test_1.expect)(this.monacoEditor).toBeVisible();
53
- await this.monacoEditor.click();
54
59
  // Monaco editor doesn't respond reliably to clear()/fill() on the
55
60
  // hidden textarea. Use keyboard shortcuts to select-all and replace,
56
61
  // which mirrors real user interaction.
57
- await this.monacoEditorTextArea.press('Control+a');
58
- await this.monacoEditorTextArea.press('Delete');
59
- await this.monacoEditorTextArea.pressSequentially(newValue, { delay: 10 });
60
- await (0, test_1.expect)(this.saveVariableButton).toBeEnabled({ timeout: 10000 });
62
+ // Retry the clear-type-enable cycle because Monaco auto-completion of
63
+ // brackets / quotes can corrupt JSON input on the first attempt.
64
+ const MAX_TYPE_ATTEMPTS = 3;
65
+ for (let attempt = 1; attempt <= MAX_TYPE_ATTEMPTS; attempt++) {
66
+ await this.monacoEditor.click();
67
+ await this.monacoEditorTextArea.press('Control+a');
68
+ await this.monacoEditorTextArea.press('Delete');
69
+ // Let Monaco settle after clearing content
70
+ await (0, sleep_1.sleep)(500);
71
+ await this.monacoEditorTextArea.pressSequentially(newValue, { delay: 20 });
72
+ // Dismiss any auto-complete popup by clicking the modal heading.
73
+ // Do NOT use press('Escape') on the textarea — when no autocomplete
74
+ // is showing, the Escape event propagates to the Carbon modal and
75
+ // closes the entire dialog.
76
+ await this.editModalHeading.click();
77
+ // Let Monaco settle and validate the new content
78
+ await (0, sleep_1.sleep)(500);
79
+ try {
80
+ await (0, test_1.expect)(this.saveVariableButton).toBeEnabled({ timeout: 10000 });
81
+ break;
82
+ }
83
+ catch {
84
+ if (attempt === MAX_TYPE_ATTEMPTS) {
85
+ throw new Error(`Save button did not become enabled after ${MAX_TYPE_ATTEMPTS} typing attempts`);
86
+ }
87
+ }
88
+ }
61
89
  await this.saveVariableButton.click();
62
90
  await (0, test_1.expect)(this.successMessage).toBeVisible();
63
91
  await (0, test_1.expect)(this.editVariableModal).toBeHidden();
@@ -154,6 +154,9 @@ class OperateProcessesPage {
154
154
  else {
155
155
  await this.toggleCompletedCheckbox();
156
156
  }
157
+ // Capture URL after filters are applied so we can navigate back here
158
+ // if a reload redirects away from Operate.
159
+ const operateUrl = this.page.url();
157
160
  while (Date.now() - startTime < TOTAL_TIMEOUT_MS &&
158
161
  attempt < MAX_ATTEMPTS) {
159
162
  attempt++;
@@ -167,6 +170,34 @@ class OperateProcessesPage {
167
170
  lastError = err instanceof Error ? err.message : err;
168
171
  await this.page.reload();
169
172
  await this.page.waitForLoadState('networkidle');
173
+ // After reload, the page may redirect away from Operate (e.g. to
174
+ // Tasklist). Navigate back to the original Operate URL if that
175
+ // happens.
176
+ if (!this.page.url().includes('/operate')) {
177
+ await this.page.goto(operateUrl);
178
+ await this.page.waitForLoadState('networkidle');
179
+ }
180
+ // Re-apply checkbox filter lost after reload
181
+ if (type === 'active') {
182
+ await this.toggleActiveCheckboxOn();
183
+ }
184
+ else {
185
+ await this.toggleCompletedCheckbox();
186
+ }
187
+ // Re-fill Process Instance Key filter if it was previously applied
188
+ // but its value was cleared by the reload.
189
+ try {
190
+ const isFilterVisible = await this.processInstanceKeyTextBox.isVisible();
191
+ if (isFilterVisible) {
192
+ const currentValue = await this.processInstanceKeyTextBox.inputValue();
193
+ if (!currentValue) {
194
+ await this.processInstanceKeyTextBox.fill(processName);
195
+ }
196
+ }
197
+ }
198
+ catch {
199
+ // Filter input not available, skip
200
+ }
170
201
  await (0, sleep_1.sleep)(2000);
171
202
  }
172
203
  }
@@ -25,10 +25,13 @@ class OperateProcessInstancePage {
25
25
  .getByTestId('INCIDENT-icon');
26
26
  }
27
27
  async connectorResultVariableName(name) {
28
- return await this.page.getByTestId(name);
28
+ return this.page.getByTestId('variable-' + name);
29
29
  }
30
30
  async connectorResultVariableValue(variableName) {
31
- return await this.page.getByTestId(variableName).locator('td').last();
31
+ return this.page
32
+ .getByTestId('variable-' + variableName)
33
+ .locator('td')
34
+ .last();
32
35
  }
33
36
  async completedIconAssertion() {
34
37
  let retryCount = 0;
@@ -51,6 +51,7 @@ class OperateProcessesPage {
51
51
  this.gotItButton = page.getByRole('button', { name: 'Got it' });
52
52
  }
53
53
  async checkCheckbox(checkbox) {
54
+ await checkbox.waitFor({ state: 'visible', timeout: constants_1._1_SECOND_IN_MS * 10 });
54
55
  if (!(await checkbox.isChecked())) {
55
56
  await checkbox.click();
56
57
  await (0, test_1.expect)(checkbox).toBeChecked({
@@ -78,6 +79,10 @@ class OperateProcessesPage {
78
79
  async toggleActiveCheckboxOn() {
79
80
  await this.uncheckCompletedCheckbox();
80
81
  await this.clickProcessIncidentsCheckbox();
82
+ await this.processActiveCheckbox.waitFor({
83
+ state: 'visible',
84
+ timeout: constants_1._1_SECOND_IN_MS * 10,
85
+ });
81
86
  if (await this.processActiveCheckbox.isChecked({ timeout: constants_1._1_SECOND_IN_MS })) {
82
87
  await this.uncheckCheckbox(this.processActiveCheckbox);
83
88
  await (0, sleep_1.sleep)(200); // Required to skip the debounce protection on the frontend
@@ -90,6 +95,10 @@ class OperateProcessesPage {
90
95
  async toggleCompletedCheckbox() {
91
96
  await this.uncheckActiveCheckbox();
92
97
  await this.clickProcessIncidentsCheckbox();
98
+ await this.processCompletedCheckbox.waitFor({
99
+ state: 'visible',
100
+ timeout: constants_1._1_SECOND_IN_MS * 10,
101
+ });
93
102
  if (await this.processCompletedCheckbox.isChecked({ timeout: constants_1._1_SECOND_IN_MS })) {
94
103
  await this.uncheckCheckbox(this.processCompletedCheckbox);
95
104
  await (0, sleep_1.sleep)(200); // Required to skip the debounce protection on the frontend
@@ -122,22 +131,42 @@ class OperateProcessesPage {
122
131
  }
123
132
  }
124
133
  async clickProcessActiveCheckbox() {
134
+ await this.processActiveCheckbox.waitFor({
135
+ state: 'visible',
136
+ timeout: constants_1._1_SECOND_IN_MS * 10,
137
+ });
125
138
  if (!(await this.processActiveCheckbox.isChecked({ timeout: 60000 }))) {
126
139
  await this.processActiveCheckbox.click({ timeout: 120000 });
127
140
  }
128
141
  }
129
142
  async clickProcessCompletedCheckbox() {
143
+ await this.processCompletedCheckbox.waitFor({
144
+ state: 'visible',
145
+ timeout: constants_1._1_SECOND_IN_MS * 10,
146
+ });
130
147
  if (!(await this.processCompletedCheckbox.isChecked({ timeout: 60000 }))) {
131
148
  await this.processCompletedCheckbox.click({ timeout: 120000 });
132
149
  }
133
150
  }
134
151
  async clickProcessIncidentsCheckbox() {
152
+ await this.processIncidentsCheckbox.waitFor({
153
+ state: 'visible',
154
+ timeout: constants_1._1_SECOND_IN_MS * 10,
155
+ });
135
156
  await this.processIncidentsCheckbox.click({ timeout: 90000 });
136
157
  }
137
158
  async clickRunningProcessInstancesCheckbox() {
159
+ await this.processRunningInstancesCheckbox.waitFor({
160
+ state: 'visible',
161
+ timeout: constants_1._1_SECOND_IN_MS * 10,
162
+ });
138
163
  await this.processRunningInstancesCheckbox.click({ timeout: 90000 });
139
164
  }
140
165
  async clickFinishedProcessInstancesCheckbox() {
166
+ await this.processFinishedInstancesCheckbox.waitFor({
167
+ state: 'visible',
168
+ timeout: constants_1._1_SECOND_IN_MS * 10,
169
+ });
141
170
  await this.processFinishedInstancesCheckbox.click({ timeout: 90000 });
142
171
  }
143
172
  async clickProcessInstanceLink(processName, type = 'active') {
@@ -169,6 +198,26 @@ class OperateProcessesPage {
169
198
  await this.page.reload();
170
199
  await this.page.waitForLoadState('networkidle');
171
200
  await (0, sleep_1.sleep)(2000);
201
+ // After reload, check if page redirected away from Operate
202
+ if (!this.page.url().includes('/operate')) {
203
+ const operatePath = (process.env.ORCHESTRATION_CONTEXT_PATH ?? '/orchestration') +
204
+ '/operate';
205
+ await this.page.goto(operatePath, { timeout: 30000 });
206
+ await this.page.waitForLoadState('networkidle');
207
+ await (0, sleep_1.sleep)(2000);
208
+ }
209
+ try {
210
+ if (type === 'active') {
211
+ await this.toggleActiveCheckboxOn();
212
+ }
213
+ else {
214
+ await this.toggleCompletedCheckbox();
215
+ }
216
+ }
217
+ catch (toggleErr) {
218
+ // Toggle may fail if page state is unexpected; continue to next retry
219
+ console.log(`Checkbox toggle failed after reload: ${String(toggleErr)}`);
220
+ }
172
221
  }
173
222
  }
174
223
  throw new Error(`Failed to open instance "${processName}" after ${MAX_ATTEMPTS} attempts. Last error: ${String(lastError)}`);
@@ -37,7 +37,7 @@ SM_8_9_1.test.describe('Connectors User Flow Tests @tasklistV2', () => {
37
37
  await (0, test_1.expect)(page.getByTestId('variables-list')).toBeVisible({
38
38
  timeout: 30000,
39
39
  });
40
- (0, test_1.expect)((await operateProcessInstancePage.connectorResultVariableName('status')).isVisible()).toBeTruthy();
40
+ await (0, test_1.expect)(await operateProcessInstancePage.connectorResultVariableName('status')).toBeVisible({ timeout: 30000 });
41
41
  await (0, test_1.expect)(page.getByText('"Awesome!"')).toBeVisible({
42
42
  timeout: 60000,
43
43
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.412",
3
+ "version": "0.0.414",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",