@camunda/e2e-test-suite 0.0.413 → 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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
}
|