@camunda/e2e-test-suite 0.0.1765 → 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`. Apply then rejects it silently, the modal stays open
125
- // and the old value is still on screen, so the caller's
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
- const isFirefox = this.page.context().browser()?.browserType().name() === 'firefox';
143
- await this.page.keyboard.insertText(`"${newValue}${isFirefox ? '"' : ''}`);
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();
@@ -16,6 +16,7 @@ declare class TaskPanelPage {
16
16
  constructor(page: Page);
17
17
  taskLink(processName: string): Locator;
18
18
  openTask(name: string, assignButton?: boolean, fallbackName?: string): Promise<void>;
19
+ private revealTaskInPanel;
19
20
  filterBy(option: 'All open' | 'Unassigned' | 'Assigned to me' | 'Completed'): Promise<void>;
20
21
  private openFilterControls;
21
22
  private static appliedFilterUrl;
@@ -100,6 +100,7 @@ class TaskPanelPage {
100
100
  // Removed waitForLoadState('networkidle') — Tasklist polls
101
101
  // continuously, so networkidle never fires; the click below
102
102
  // already has a 4s timeout that auto-waits for the locator.
103
+ await this.revealTaskInPanel(taskLocator);
103
104
  await taskLocator.nth(0).click({ timeout: constants_1._1_SECOND_IN_MS * 4 });
104
105
  if (assignButton) {
105
106
  await (0, test_1.expect)(this.assignToMeButton).toBeVisible({
@@ -120,6 +121,39 @@ class TaskPanelPage {
120
121
  }
121
122
  }
122
123
  }
124
+ // The task panel renders only a window of cards and loads the next page when
125
+ // the last one is scrolled into view, so a task completed early sits below
126
+ // that window and is absent from the DOM until the panel is scrolled down to
127
+ // it. openTask otherwise reloads to the top every attempt and never descends,
128
+ // leaving a buried task — e.g. the first-completed one in a Completed list
129
+ // crowded by parallel runs — unreachable. Scroll until the task renders or the
130
+ // list stops growing (it is then genuinely absent, and the caller's click
131
+ // surfaces that rather than this masking it).
132
+ async revealTaskInPanel(taskLocator) {
133
+ const cards = this.availableTasks.locator('article');
134
+ // A reload can leave the first window still fetching; wait for the first
135
+ // card, bounded so a genuinely empty list still exits via count === 0.
136
+ await cards
137
+ .first()
138
+ .waitFor({ state: 'attached', timeout: 5000 })
139
+ .catch(() => false);
140
+ let previousCount = 0;
141
+ for (let i = 0; i < 30; i++) {
142
+ if ((await taskLocator.count()) > 0) {
143
+ return;
144
+ }
145
+ const count = await cards.count();
146
+ if (count === 0 || count === previousCount) {
147
+ return;
148
+ }
149
+ previousCount = count;
150
+ await cards.nth(count - 1).scrollIntoViewIfNeeded();
151
+ await cards
152
+ .nth(count)
153
+ .waitFor({ state: 'attached', timeout: 5000 })
154
+ .catch(() => false);
155
+ }
156
+ }
123
157
  async filterBy(option) {
124
158
  // Both shells list the options only once their control is open, so open it
125
159
  // first and then pick from whichever of the two the deployed build renders:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1765",
3
+ "version": "0.0.1767",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",