@camunda/e2e-test-suite 0.0.1586 → 0.0.1588

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.
@@ -297,7 +297,26 @@ class ClusterDetailsPage {
297
297
  await this.createButton.click({ timeout: 60000 });
298
298
  }
299
299
  async clickCloseModalButton() {
300
- await this.closeModalButton.click({ timeout: 60000 });
300
+ // The client-credentials modal renders its Close (X) affix in the top-right
301
+ // corner -- the same corner the app's sonner notification toasts occupy. On
302
+ // SaaS INT a background info toast lands on top of that affix and intercepts
303
+ // every click on it for the full timeout, even though the button is visible,
304
+ // enabled and stable (the nightly trace shows
305
+ // `<li data-sonner-toast> ... subtree intercepts pointer events`). Escape
306
+ // dismisses this modal Radix dialog without routing a click through the
307
+ // obstructed corner; fall back to the button if this dialog ever suppresses
308
+ // Escape, then assert the dialog is gone so a close that genuinely failed
309
+ // still surfaces rather than being masked.
310
+ await (0, test_1.expect)(this.clientCredentialsDialog).toBeVisible({ timeout: 60000 });
311
+ await this.page.keyboard.press('Escape');
312
+ const dismissed = await this.clientCredentialsDialog
313
+ .waitFor({ state: 'hidden', timeout: 5000 })
314
+ .then(() => true)
315
+ .catch(() => false);
316
+ if (!dismissed) {
317
+ await this.closeModalButton.click({ timeout: 60000 });
318
+ }
319
+ await (0, test_1.expect)(this.clientCredentialsDialog).toBeHidden({ timeout: 30000 });
301
320
  }
302
321
  async clickSettingsTab() {
303
322
  await this.settingsTab.click({ timeout: 60000 });
@@ -90,20 +90,42 @@ class ConnectorTemplatePage {
90
90
  await (0, test_1.expect)(dialog).toBeHidden({ timeout: 60000 });
91
91
  return null;
92
92
  }
93
- // Replace the whole content of the open template file. Monaco only picks up
94
- // real input events, so the old content is selected and deleted via the
95
- // keyboard and the new JSON is inserted as a single input.
93
+ // Replace the whole content of the open template file. Web Modeler's Monaco
94
+ // editor uses the EditContext API, under which keyboard.insertText of a
95
+ // multi-line string is re-indented line by line (and can end up as invalid
96
+ // JSON, which disables Publish). Pasting is applied verbatim, so the new
97
+ // JSON goes through the clipboard instead.
96
98
  async replaceTemplateJson(json, expectedText) {
97
99
  const editor = this.page.locator('.monaco-editor').first();
98
100
  await (0, test_1.expect)(editor).toBeVisible({ timeout: 90000 });
99
- await editor.locator('.view-lines').click();
101
+ await this.page
102
+ .context()
103
+ .grantPermissions(['clipboard-read', 'clipboard-write']);
104
+ await this.page.evaluate(async (text) => await navigator.clipboard.writeText(text), json);
105
+ // Click inside the visible text area, just right of the line numbers:
106
+ // clicking the centre of `.view-lines` can land far right on a long line
107
+ // and miss the editor, so the shortcuts below would act on the page
108
+ // instead. Monaco marks the editor `focused` once it owns the keyboard.
109
+ await (0, test_1.expect)(async () => {
110
+ const box = await editor.boundingBox();
111
+ if (!box) {
112
+ throw new Error('Template editor has no bounding box');
113
+ }
114
+ await editor.click({
115
+ position: { x: Math.min(120, box.width / 2), y: box.height / 2 },
116
+ timeout: 10000,
117
+ });
118
+ await (0, test_1.expect)(editor).toHaveClass(/\bfocused\b/, { timeout: 5000 });
119
+ }).toPass({ timeout: 60000 });
100
120
  await this.page.keyboard.press('ControlOrMeta+A');
101
- await this.page.keyboard.press('Delete');
102
- await this.page.keyboard.insertText(json);
121
+ await this.page.keyboard.press('ControlOrMeta+V');
103
122
  await this.page.keyboard.press('ControlOrMeta+Home');
104
123
  await (0, test_1.expect)(editor.locator('.view-lines')).toContainText(expectedText, {
105
124
  timeout: 30000,
106
125
  });
126
+ await (0, test_1.expect)(this.page.getByText('Your JSON is invalid')).toBeHidden({
127
+ timeout: 30000,
128
+ });
107
129
  }
108
130
  async publishConnector() {
109
131
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1586",
3
+ "version": "0.0.1588",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",