@camunda/e2e-test-suite 0.0.1235 → 0.0.1237

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.
@@ -1076,7 +1076,7 @@ class ModelerCreatePage {
1076
1076
  }
1077
1077
  async completePlayConfiguration() {
1078
1078
  const timeout = 30000;
1079
- // New flow (8.10+): "Setup environment" panel with three steps:
1079
+ // New flow (8.10+): "Set up environment" panel with three steps:
1080
1080
  // 1. Connect cluster → "Configure environment" modal → select cluster → Save
1081
1081
  // 2. Deploy process → wait for success banner
1082
1082
  // 3. Configure test case
@@ -1123,15 +1123,20 @@ class ModelerCreatePage {
1123
1123
  // clickStartInstanceButton burned its entire retry budget looking for it.
1124
1124
  // camunda-hub's "Play" -> "Test Studio" rebrand renamed this container's
1125
1125
  // data-test from `play-configuration-overlay` to
1126
- // `test-studio-configuration-overlay` (confirmed in the failing run's trace
1127
- // DOM), so the old gate matched nothing and timed out. Anchor on the new
1128
- // data-test, keep the legacy attribute for older modeler builds, and fall
1129
- // back to the "Setup environment" panel title. This locator means "the
1130
- // setup panel is still on screen".
1126
+ // `test-studio-configuration-overlay`, and a later build dropped both
1127
+ // container data-test attributes entirely (neither is present in the
1128
+ // failing run's trace DOM), so those two gates now match nothing. The
1129
+ // always-present anchor is the panel's heading, which the current build
1130
+ // renders as "Set up environment" (verb, two words) -- the old
1131
+ // `getByText('Setup environment')` (one word) never matched it and the
1132
+ // whole chain timed out. Match the heading with a spelling-tolerant regex
1133
+ // so a future flip between the two forms cannot re-break the gate, and keep
1134
+ // the legacy data-test attributes for older modeler builds. This locator
1135
+ // means "the setup panel is still on screen".
1131
1136
  const configurationOverlay = this.page
1132
1137
  .locator('[data-test="test-studio-configuration-overlay"]')
1133
1138
  .or(this.page.locator('[data-test="play-configuration-overlay"]'))
1134
- .or(this.page.getByText('Setup environment'))
1139
+ .or(this.page.getByText(/set ?up environment/i))
1135
1140
  .first();
1136
1141
  const configureTestPanel = this.page.getByTestId('configure-test-panel');
1137
1142
  await (0, test_1.expect)(configurationOverlay
@@ -1199,7 +1204,7 @@ class ModelerCreatePage {
1199
1204
  }).toPass({ timeout: 90000 });
1200
1205
  }
1201
1206
  // Step 3: reveal the "Configure test case" section. In the current Test
1202
- // Studio the "Setup environment" panel is an inline accordion, not a
1207
+ // Studio the "Set up environment" panel is an inline accordion, not a
1203
1208
  // blocking overlay -- its heading is always present and step 3 auto-opens
1204
1209
  // once deploy completes, rendering ConfigureTestPanel with the Start
1205
1210
  // button. Clicking the "Configure test case" accordion heading while it
@@ -6,6 +6,8 @@ declare class OperateHomePage {
6
6
  readonly informationDialog: Locator;
7
7
  readonly editVariableButton: Locator;
8
8
  readonly variableValueInput: Locator;
9
+ readonly variableValueEditor: Locator;
10
+ readonly variableValueContent: Locator;
9
11
  readonly saveVariableButton: Locator;
10
12
  readonly editVariableSpinner: Locator;
11
13
  constructor(page: Page);
@@ -9,6 +9,8 @@ class OperateHomePage {
9
9
  informationDialog;
10
10
  editVariableButton;
11
11
  variableValueInput;
12
+ variableValueEditor;
13
+ variableValueContent;
12
14
  saveVariableButton;
13
15
  editVariableSpinner;
14
16
  constructor(page) {
@@ -28,6 +30,21 @@ class OperateHomePage {
28
30
  });
29
31
  this.editVariableButton = page.getByTestId('edit-variable-button');
30
32
  this.variableValueInput = page.getByTestId('edit-variable-value');
33
+ // "The row is in write mode." InlineJsonEditor renders a CodeMirror
34
+ // instance carrying this test id only on its editable branch; the
35
+ // read-only branch renders ReadOnlyEditor instead, with no CodeMirror
36
+ // at all. The product's own suite resolves the editor the same way --
37
+ // see camunda/camunda
38
+ // qa/c8-orchestration-cluster-e2e-test-suite/pages/OperateHomePage.ts.
39
+ this.variableValueEditor = page.getByTestId('code-mirror-editor');
40
+ // The editable node *inside* that container. CodeMirror puts its
41
+ // contenteditable on `.cm-content`, so that -- not the container -- is
42
+ // what takes focus and what holds the text. Asserting focus on the
43
+ // container reports `inactive` even when the caret is correctly placed,
44
+ // because clicking the container focuses its contenteditable child.
45
+ this.variableValueContent = this.variableValueEditor
46
+ .locator('.cm-content')
47
+ .first();
31
48
  // Carbon icon-only buttons expose their accessible name via aria-labelledby
32
49
  // (tooltip text "Save") which overrides aria-label for computed accessible name.
33
50
  // Use a CSS attribute selector to match the raw aria-label attribute directly.
@@ -56,8 +73,34 @@ class OperateHomePage {
56
73
  throw new Error(`Failed to click the processes tab after ${maxRetries} attempts.`);
57
74
  }
58
75
  async clickEditVariableButton(variableName) {
59
- const editVariableButton = 'variable-' + variableName;
60
- await this.page.getByTestId(editVariableButton).getByLabel('Edit').click();
76
+ const editVariableButton = this.page
77
+ .getByTestId('variable-' + variableName)
78
+ .getByLabel('Edit');
79
+ await (0, test_1.expect)(editVariableButton).toBeVisible({ timeout: 30000 });
80
+ // The caller reaches this straight out of activeIconAssertion, which
81
+ // reloads the page while it polls for the status icon, so the variables
82
+ // panel is usually still mounting when the click lands. A click during
83
+ // that render resolves without raising and without effect: the row stays
84
+ // read-only, InlineJsonEditor keeps rendering ReadOnlyEditor, and the
85
+ // editor the next step needs is never created. Retry until write mode is
86
+ // actually active rather than asserting on the editor afterwards and
87
+ // reporting the dropped click as a missing element.
88
+ //
89
+ // Only click while the row is still read-only. Entering write mode
90
+ // replaces the Edit control, so once the click has taken, clicking again
91
+ // just waits out its timeout against an element that is gone or still
92
+ // being replaced -- which is what the retry did on the slower macOS and
93
+ // Windows runners, where the editor needs longer to mount than one
94
+ // iteration allowed: it re-clicked, exhausted the budget, and raised the
95
+ // click timeout instead of the state the row was actually in. Probing
96
+ // first keeps the retry for a genuinely dropped click and turns the slow
97
+ // case into what it should be, a wait.
98
+ await (0, test_1.expect)(async () => {
99
+ if (await editVariableButton.isVisible()) {
100
+ await editVariableButton.click({ timeout: 10000 });
101
+ }
102
+ await (0, test_1.expect)(this.variableValueEditor).toBeVisible({ timeout: 15000 });
103
+ }).toPass({ timeout: 90000 });
61
104
  }
62
105
  async clickVariableValueInput() {
63
106
  await this.variableValueInput.click();
@@ -69,15 +112,18 @@ class OperateHomePage {
69
112
  // Operate migrated this editor from Monaco to CodeMirror
70
113
  // (@uiw/react-codemirror; see camunda/camunda#62782) -- the editable
71
114
  // region is now a div.cm-content, not .monaco-editor, and it no longer
72
- // exposes a Monaco-style .cursor element. clickEditVariableButton still
73
- // triggers autoFocus, so wait for the content element to actually have
74
- // focus (:focus) before sending events, same intent as the old cursor
75
- // check. Scoped to the variable row to avoid matching other editors.
76
- const variableRow = this.page.getByTestId('variable-testVariable');
77
- await variableRow
78
- .locator('.cm-content:focus')
79
- .first()
80
- .waitFor({ state: 'visible', timeout: 30000 });
115
+ // exposes a Monaco-style .cursor element.
116
+ //
117
+ // clickEditVariableButton has already established that the editor exists
118
+ // -- it retries the Edit click until it does -- so this only has to put
119
+ // the caret in it. Do not wait on focus arriving by itself: autoFocus
120
+ // fires when the editor mounts, which is before this runs, so a wait for
121
+ // `:focus` can only ever observe focus that has already been placed
122
+ // elsewhere. Click to focus, then confirm. Both act on the
123
+ // contenteditable rather than its container, which cannot hold focus.
124
+ await (0, test_1.expect)(this.variableValueContent).toBeVisible({ timeout: 30000 });
125
+ await this.variableValueContent.click();
126
+ await (0, test_1.expect)(this.variableValueContent).toBeFocused({ timeout: 10000 });
81
127
  // Insert the COMPLETE JSON value, both quotes included. Monaco used to
82
128
  // auto-close a lone opening quote, so the old recipe inserted only
83
129
  // `"value`; CodeMirror's closeBrackets extension ignores insertions
@@ -97,7 +143,9 @@ class OperateHomePage {
97
143
  await this.page.keyboard.press('Backspace');
98
144
  const jsonValue = JSON.stringify(newValue);
99
145
  await this.page.keyboard.insertText(jsonValue);
100
- await (0, test_1.expect)(variableRow.locator('.cm-content').first()).toContainText(jsonValue, { timeout: 10000 });
146
+ await (0, test_1.expect)(this.variableValueContent).toContainText(jsonValue, {
147
+ timeout: 10000,
148
+ });
101
149
  }
102
150
  async clickSaveVariableButton() {
103
151
  await this.saveVariableButton.click({ timeout: 30000 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1235",
3
+ "version": "0.0.1237",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",