@camunda/e2e-test-suite 0.0.1766 → 0.0.1767
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.
|
@@ -121,16 +121,8 @@ class OperateHomePage {
|
|
|
121
121
|
// Replace the whole JSON document in one shot. Typing it per-character
|
|
122
122
|
// raced the editor's re-render: after a couple of keystrokes the caret
|
|
123
123
|
// jumped outside the closing quote, leaving invalid JSON such as
|
|
124
|
-
// `"up"datedValue`.
|
|
125
|
-
//
|
|
126
|
-
// `not.toBeVisible('"testValue"')` assertion times out. insertText emits a
|
|
127
|
-
// single input event, so there is no intermediate state to race.
|
|
128
|
-
//
|
|
129
|
-
// Pass only the OPENING quote: Monaco auto-closes it. Supplying both ends
|
|
130
|
-
// yields `"updatedValue""` -- invalid JSON, and Apply rejects it exactly
|
|
131
|
-
// like the per-character version did. Same recipe as
|
|
132
|
-
// pages/c8Run-8.10/OperateHomePage.ts. Firefox's textarea input does not
|
|
133
|
-
// auto-close, so it gets the closing quote explicitly.
|
|
124
|
+
// `"up"datedValue`. insertText emits a single input event, so there is no
|
|
125
|
+
// intermediate state to race.
|
|
134
126
|
//
|
|
135
127
|
// Select with Home + Shift+End rather than ControlOrMeta+A: headless
|
|
136
128
|
// Chromium on macOS does not apply Meta+A as select-all inside Monaco's
|
|
@@ -139,8 +131,23 @@ class OperateHomePage {
|
|
|
139
131
|
// every platform.
|
|
140
132
|
await this.page.keyboard.press('Home');
|
|
141
133
|
await this.page.keyboard.press('Shift+End');
|
|
142
|
-
|
|
143
|
-
|
|
134
|
+
await this.page.keyboard.insertText(`"${newValue}`);
|
|
135
|
+
// Whether Monaco auto-closes the opening quote under keyboard.insertText
|
|
136
|
+
// varies across Operate builds: when it does not fire the line is left as
|
|
137
|
+
// the unterminated string `"updatedValue`, Apply is silently rejected and
|
|
138
|
+
// the old value stays on screen. Append the closing quote only when it is
|
|
139
|
+
// missing, so the document is valid JSON either way (the branch is only
|
|
140
|
+
// reached in the non-auto-closing state, so this insert does not double it).
|
|
141
|
+
const valueLine = this.page
|
|
142
|
+
.getByLabel('Edit Variable "testVariable"')
|
|
143
|
+
.locator('.view-line')
|
|
144
|
+
.first();
|
|
145
|
+
await (0, test_1.expect)(valueLine).toContainText(newValue);
|
|
146
|
+
const lineText = (await valueLine.textContent()) ?? '';
|
|
147
|
+
if (!lineText.trimEnd().endsWith('"')) {
|
|
148
|
+
await this.page.keyboard.press('End');
|
|
149
|
+
await this.page.keyboard.insertText('"');
|
|
150
|
+
}
|
|
144
151
|
}
|
|
145
152
|
async clickSaveVariableButton() {
|
|
146
153
|
await this.applyButton.click();
|