@camunda/e2e-test-suite 0.0.1714 → 0.0.1716

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.
@@ -43,8 +43,9 @@ declare class OperateProcessInstancePage {
43
43
  assertProcessVariableHasDocumentCount(variableName: string, count: number, softFail?: boolean): Promise<void>;
44
44
  clickDiagramTask(taskName: string): Promise<void>;
45
45
  openAgentConversation(elementId: string): Promise<void>;
46
- assertReadableReasoning(reasoningHistoryItemKey: string, answerHistoryItemKey: string): Promise<void>;
47
- assertEncryptedReasoningIsHidden(reasoningHistoryItemKey: string, answerHistoryItemKey: string): Promise<void>;
46
+ private get assistantMessages();
47
+ assertReadableReasoning(): Promise<void>;
48
+ assertEncryptedReasoningIsHidden(): Promise<void>;
48
49
  private assertFinalAnswerVisible;
49
50
  assertActiveTokenIsPresent(): Promise<void>;
50
51
  assertDetailsPopoverIsVisible(): Promise<void>;
@@ -193,8 +193,11 @@ class OperateProcessInstancePage {
193
193
  name: "Here's what moved in Operate",
194
194
  });
195
195
  this.gotItButton = page.getByRole('button', { name: 'Got it' });
196
+ // The Operate UI in camunda/camunda's orchestration-cluster-webapp labels
197
+ // the tab nav "Process instance tabs" (i18n key `tabs`); the legacy
198
+ // operate/client BottomPanelTabs used "Process Instance Bottom Panel Tabs".
196
199
  this.detailsTab = page
197
- .getByLabel('Process Instance Bottom Panel Tabs')
200
+ .getByLabel(/^Process instance (bottom panel )?tabs$/i)
198
201
  .getByRole('link', { name: 'Details' });
199
202
  this.agentInstancePanel = page.getByRole('article', {
200
203
  name: 'Agent Instance',
@@ -905,33 +908,41 @@ class OperateProcessInstancePage {
905
908
  await this.conversationHistoryTrigger.click();
906
909
  await (0, test_1.expect)(this.conversationHistoryTrigger).toHaveAttribute('aria-expanded', 'true');
907
910
  }
908
- async assertReadableReasoning(reasoningHistoryItemKey, answerHistoryItemKey) {
909
- const reasoningMessage = this.conversationHistorySection.getByTestId(`conversation-message-${reasoningHistoryItemKey}`);
911
+ // The orchestration-cluster-webapp Operate UI no longer renders the
912
+ // per-item `conversation-message-<historyItemKey>` test id; messages are only
913
+ // exposed via aria-label ("Assistant message" / "User message"). The
914
+ // committed history items are still awaited via the API before this runs
915
+ // (waitForAgentReasoningHistory), so locate the rendered messages by role.
916
+ get assistantMessages() {
917
+ return this.conversationHistorySection.locator('[aria-label="Assistant message"]');
918
+ }
919
+ async assertReadableReasoning() {
920
+ const thinking = this.page.getByRole('region', { name: 'Thinking' });
921
+ const reasoningMessage = this.assistantMessages
922
+ .filter({ has: thinking })
923
+ .first();
910
924
  const thinkingRegion = reasoningMessage.getByRole('region', {
911
925
  name: 'Thinking',
912
926
  });
913
- const answerMessage = this.conversationHistorySection.getByTestId(`conversation-message-${answerHistoryItemKey}`);
914
- await (0, test_1.expect)(reasoningMessage).toHaveAttribute('aria-label', 'Assistant message', { timeout: 60000 });
927
+ await (0, test_1.expect)(reasoningMessage).toBeVisible({ timeout: 60000 });
915
928
  await (0, test_1.expect)(thinkingRegion).toBeVisible();
916
929
  await (0, test_1.expect)(thinkingRegion.locator('p')).toHaveText(/\S/);
917
930
  await (0, test_1.expect)(thinkingRegion.getByRole('button')).toHaveCount(0);
918
- await this.assertFinalAnswerVisible(answerMessage);
931
+ await this.assertFinalAnswerVisible();
919
932
  await (0, test_1.expect)(this.conversationHistorySection).not.toContainText(/camunda\.agenticai\.content\.type|encrypted_content|signature|"payload"/);
920
933
  }
921
- async assertEncryptedReasoningIsHidden(reasoningHistoryItemKey, answerHistoryItemKey) {
922
- const reasoningMessage = this.conversationHistorySection.getByTestId(`conversation-message-${reasoningHistoryItemKey}`);
923
- const answerMessage = this.conversationHistorySection.getByTestId(`conversation-message-${answerHistoryItemKey}`);
924
- await (0, test_1.expect)(reasoningMessage).toHaveAttribute('aria-label', 'Assistant message', { timeout: 60000 });
925
- await (0, test_1.expect)(reasoningMessage).toBeVisible({ timeout: 60000 });
926
- await (0, test_1.expect)(reasoningMessage.getByRole('region', { name: 'Thinking' })).toHaveCount(0);
934
+ async assertEncryptedReasoningIsHidden() {
935
+ await (0, test_1.expect)(this.assistantMessages.first()).toBeVisible({
936
+ timeout: 60000,
937
+ });
938
+ await (0, test_1.expect)(this.conversationHistorySection.getByRole('region', { name: 'Thinking' })).toHaveCount(0);
927
939
  await (0, test_1.expect)(this.conversationHistorySection).not.toContainText(/encrypted_content|camunda\.agenticai\.content\.type|"payload"|signature/);
928
- await this.assertFinalAnswerVisible(answerMessage);
940
+ await this.assertFinalAnswerVisible();
929
941
  }
930
- async assertFinalAnswerVisible(answerMessage) {
931
- await (0, test_1.expect)(answerMessage).toHaveAttribute('aria-label', 'Assistant message', { timeout: 60000 });
942
+ async assertFinalAnswerVisible() {
932
943
  // The Thinking note is a <section> named via aria-labelledby, so match
933
944
  // only answer text that is not nested inside it.
934
- const answerOutsideThinking = answerMessage.locator('xpath=.//*[text()[contains(., "Answer:")]][not(ancestor::section[@aria-labelledby = //*[normalize-space(text())="Thinking"]/@id])]');
945
+ const answerOutsideThinking = this.assistantMessages.locator('xpath=.//*[text()[contains(., "Answer:")]][not(ancestor::section[@aria-labelledby = //*[normalize-space(text())="Thinking"]/@id])]');
935
946
  await (0, test_1.expect)(answerOutsideThinking.first()).toBeVisible({ timeout: 60000 });
936
947
  }
937
948
  async assertActiveTokenIsPresent() {
@@ -36,14 +36,25 @@ class OperateHomePage {
36
36
  // at all. The product's own suite resolves the editor the same way --
37
37
  // see camunda/camunda
38
38
  // qa/c8-orchestration-cluster-e2e-test-suite/pages/OperateHomePage.ts.
39
- this.variableValueEditor = page.getByTestId('code-mirror-editor');
39
+ //
40
+ // c8Run 8.11 serves Operate from the orchestration-cluster webapp, whose
41
+ // InlineJsonEditor (webapp/client/apps/orchestration-cluster-webapp/src/
42
+ // operate/shared/Editors/InlineJsonEditor.tsx) writes through a Monaco
43
+ // RichTextEditor instead -- no code-mirror-editor test id, just a
44
+ // `.monaco-editor` root with role="code". Match either write-mode editor.
45
+ this.variableValueEditor = page
46
+ .getByTestId('code-mirror-editor')
47
+ .or(page.locator('.monaco-editor[role="code"]'))
48
+ .first();
40
49
  // The editable node *inside* that container. CodeMirror puts its
41
50
  // contenteditable on `.cm-content`, so that -- not the container -- is
42
51
  // what takes focus and what holds the text. Asserting focus on the
43
52
  // container reports `inactive` even when the caret is correctly placed,
44
53
  // because clicking the container focuses its contenteditable child.
54
+ // Monaco's equivalent is its role="textbox" edit context, which carries
55
+ // aria-roledescription="editor".
45
56
  this.variableValueContent = this.variableValueEditor
46
- .locator('.cm-content')
57
+ .locator('.cm-content, [role="textbox"][aria-roledescription="editor"]')
47
58
  .first();
48
59
  // Carbon icon-only buttons expose their accessible name via aria-labelledby
49
60
  // (tooltip text "Save") which overrides aria-label for computed accessible name.
@@ -122,7 +133,11 @@ class OperateHomePage {
122
133
  // elsewhere. Click to focus, then confirm. Both act on the
123
134
  // contenteditable rather than its container, which cannot hold focus.
124
135
  await (0, test_1.expect)(this.variableValueContent).toBeVisible({ timeout: 30000 });
125
- await this.variableValueContent.click();
136
+ // Click the editor root, not the editable node: Monaco overlays its
137
+ // rendered text (.view-lines) on top of the edit context, which would
138
+ // intercept a direct click. Clicking either editor's root moves focus
139
+ // into its editable node, which the next line confirms.
140
+ await this.variableValueEditor.click();
126
141
  await (0, test_1.expect)(this.variableValueContent).toBeFocused({ timeout: 10000 });
127
142
  // Insert the COMPLETE JSON value, both quotes included. Monaco used to
128
143
  // auto-close a lone opening quote, so the old recipe inserted only
@@ -143,7 +158,10 @@ class OperateHomePage {
143
158
  await this.page.keyboard.press('Backspace');
144
159
  const jsonValue = JSON.stringify(newValue);
145
160
  await this.page.keyboard.insertText(jsonValue);
146
- await (0, test_1.expect)(this.variableValueContent).toContainText(jsonValue, {
161
+ // Asserted on the editor root: CodeMirror keeps the text inside
162
+ // .cm-content, but Monaco renders it in sibling .view-lines, not in the
163
+ // edit-context element that holds focus.
164
+ await (0, test_1.expect)(this.variableValueEditor).toContainText(jsonValue, {
147
165
  timeout: 10000,
148
166
  });
149
167
  }
@@ -4,11 +4,13 @@ declare class OperateLoginPage {
4
4
  readonly usernameInput: Locator;
5
5
  readonly passwordInput: Locator;
6
6
  readonly loginButton: Locator;
7
+ readonly operateBanner: Locator;
7
8
  constructor(page: Page);
8
9
  fillUsername(username: string): Promise<void>;
9
10
  clickUsername(): Promise<void>;
10
11
  fillPassword(password: string): Promise<void>;
11
12
  clickLoginButton(): Promise<void>;
13
+ isLoggedIn(): Promise<boolean>;
12
14
  login(username: string, password: string): Promise<void>;
13
15
  }
14
16
  export { OperateLoginPage };
@@ -7,11 +7,18 @@ class OperateLoginPage {
7
7
  usernameInput;
8
8
  passwordInput;
9
9
  loginButton;
10
+ operateBanner;
10
11
  constructor(page) {
11
12
  this.page = page;
12
13
  this.usernameInput = page.getByLabel('Username');
13
14
  this.passwordInput = page.getByRole('textbox', { name: 'password' });
14
15
  this.loginButton = page.getByRole('button', { name: 'Login' });
16
+ // Same header link OperateHomePage.operateBanner resolves (legacy shell or
17
+ // Design System AppHeaderV2).
18
+ this.operateBanner = page
19
+ .getByRole('link', { name: 'Camunda logo Operate' })
20
+ .or(page.getByRole('link', { name: 'Camunda Operate', exact: true }))
21
+ .first();
15
22
  }
16
23
  async fillUsername(username) {
17
24
  await this.usernameInput.fill(username);
@@ -25,8 +32,17 @@ class OperateLoginPage {
25
32
  async clickLoginButton() {
26
33
  await this.loginButton.click({ timeout: 60000 });
27
34
  }
35
+ async isLoggedIn() {
36
+ // The orchestration cluster shares one session across Operate and
37
+ // Tasklist, so after a Tasklist login /operate/login redirects straight
38
+ // to /operate and the form never renders.
39
+ await (0, test_1.expect)(this.usernameInput.or(this.operateBanner).first()).toBeVisible({ timeout: 180000 });
40
+ return this.operateBanner.isVisible();
41
+ }
28
42
  async login(username, password) {
29
- await (0, test_1.expect)(this.usernameInput).toBeVisible({ timeout: 180000 });
43
+ if (await this.isLoggedIn()) {
44
+ return;
45
+ }
30
46
  await this.clickUsername();
31
47
  await this.fillUsername(username);
32
48
  await this.fillPassword(password);
@@ -73,7 +73,12 @@ class OperateProcessesPage {
73
73
  const instanceLink = processInstanceKey === undefined
74
74
  ? this.page
75
75
  .getByRole('row')
76
- .filter({ hasText: new RegExp(`^(?:Select row)?${processName}\\d+`) })
76
+ // The row-selection checkbox label is part of the row text: the
77
+ // legacy table renders "Select row", the 8.11 orchestration-cluster
78
+ // table renders "Select instance <key>".
79
+ .filter({
80
+ hasText: new RegExp(`^(?:Select row|Select instance \\d+)?${processName}\\d+`),
81
+ })
77
82
  .first()
78
83
  .getByRole('link')
79
84
  : this.page.getByRole('link', {
@@ -257,7 +257,7 @@ _8_11_1.test.describe('Agentic Orchestation User Flows', () => {
257
257
  await taskDetailsPage.clickAssignToMeButton();
258
258
  await taskDetailsPage.assertAIResponse(/Answer:/);
259
259
  });
260
- const historyKeys = await (0, agentInstanceHistoryHelpers_1.waitForAgentReasoningHistory)(processInstanceKey, authToken, params.reasoningMode);
260
+ await (0, agentInstanceHistoryHelpers_1.waitForAgentReasoningHistory)(processInstanceKey, authToken, params.reasoningMode);
261
261
  await _8_11_1.test.step('Verify the conversation in Operate', async () => {
262
262
  await appsPage.clickCamundaApps();
263
263
  await appsPage.clickOperate(clusterName);
@@ -268,10 +268,10 @@ _8_11_1.test.describe('Agentic Orchestation User Flows', () => {
268
268
  await operateProcessInstancePage.assertActiveTokenIsPresent();
269
269
  await operateProcessInstancePage.openAgentConversation('AI_Agent');
270
270
  if (params.reasoningMode === 'readable') {
271
- await operateProcessInstancePage.assertReadableReasoning(historyKeys.reasoningHistoryItemKey, historyKeys.answerHistoryItemKey);
271
+ await operateProcessInstancePage.assertReadableReasoning();
272
272
  }
273
273
  else {
274
- await operateProcessInstancePage.assertEncryptedReasoningIsHidden(historyKeys.reasoningHistoryItemKey, historyKeys.answerHistoryItemKey);
274
+ await operateProcessInstancePage.assertEncryptedReasoningIsHidden();
275
275
  }
276
276
  });
277
277
  await _8_11_1.test.step('Complete the feedback task and finish the process', async () => {
@@ -76,12 +76,45 @@ _8_11_1.test.describe('Agentic Control Plane Dashboard API Tests @agentic-dashbo
76
76
  const initialReports = await (0, agenticDashboardHelpers_1.reloadUntilDashboardReportsHealthy)(page, initialResponses);
77
77
  (0, test_1.expect)(initialReports.filter((r) => r.status !== 200).map((r) => r.url), 'initial dashboard report evaluations returned non-200').toEqual([]);
78
78
  (0, test_1.expect)(initialReports.length).toBeGreaterThan(0);
79
+ // The Optimize backend intermittently answers report evaluations with a
80
+ // short 5xx burst (nightly 44668811190: two specs in this file got 500s
81
+ // within the same 30s window, then recovered). The target range is chosen
82
+ // once and kept: a retry switches away (uncaptured) and back to the SAME
83
+ // range, so a range that persistently returns 5xx can never be masked by
84
+ // a healthy one. The last attempt's responses are asserted unchanged.
85
+ const maxDateRangeAttempts = 3;
79
86
  let dateRangeChanged = false;
80
- const responses = await (0, agenticDashboardHelpers_1.captureDashboardResponses)(page, async () => {
81
- dateRangeChanged = await (0, agenticDashboardHelpers_1.changeDashboardDateRange)(page);
82
- });
87
+ let targetRange = null;
88
+ let reportResponses = [];
89
+ for (let attempt = 1; attempt <= maxDateRangeAttempts; attempt++) {
90
+ if (targetRange !== null) {
91
+ // Move off the target so re-selecting it triggers fresh evaluations;
92
+ // captured only to wait out its requests, then discarded.
93
+ await (0, agenticDashboardHelpers_1.captureDashboardResponses)(page, async () => {
94
+ await (0, agenticDashboardHelpers_1.selectDashboardDateRange)(page);
95
+ });
96
+ }
97
+ const responses = await (0, agenticDashboardHelpers_1.captureDashboardResponses)(page, async () => {
98
+ const selected = await (0, agenticDashboardHelpers_1.selectDashboardDateRange)(page, targetRange ?? undefined);
99
+ dateRangeChanged = selected !== null;
100
+ targetRange ??= selected;
101
+ }, { includeNonJsonReportEvaluations: true });
102
+ reportResponses = responses.filter(agenticDashboardHelpers_1.isReportEvaluateResponse);
103
+ const failed = reportResponses.filter((r) => r.status !== 200);
104
+ if (!dateRangeChanged || reportResponses.length === 0)
105
+ break;
106
+ if (failed.length === 0)
107
+ break;
108
+ console.warn(`Date-range "${targetRange}" refresh attempt ${attempt}/` +
109
+ `${maxDateRangeAttempts} got non-200 report evaluations: ` +
110
+ failed
111
+ .map((r) => `${r.status} ${r.url} ${r.bodyText.slice(0, 300)}`)
112
+ .join(' | '));
113
+ if (attempt < maxDateRangeAttempts) {
114
+ await page.waitForTimeout(10000 * attempt);
115
+ }
116
+ }
83
117
  (0, test_1.expect)(dateRangeChanged).toBe(true);
84
- const reportResponses = responses.filter(agenticDashboardHelpers_1.isReportEvaluateResponse);
85
118
  (0, test_1.expect)(reportResponses.length).toBeGreaterThan(0);
86
119
  for (const response of reportResponses) {
87
120
  (0, test_1.expect)(response.status, `${response.method} ${response.url}`).toBe(200);
@@ -26,6 +26,13 @@ export declare const LEGACY_TERMINOLOGY = "completed agent runs";
26
26
  export declare function clickFirstVisibleByName(page: Page, role: RoleName, names: string[]): Promise<boolean>;
27
27
  export declare function openAgenticControlPlane(page: Page, appsPage: AppsPage, optimizeHomePage: OptimizeHomePage, clusterName: string): Promise<void>;
28
28
  export declare function changeDashboardDateRange(page: Page): Promise<boolean>;
29
+ /**
30
+ * Selects a date-range option on the agentic dashboard and returns its label,
31
+ * or null when nothing was selected. With `label`, selects exactly that
32
+ * option (null if it is missing or already checked, as re-clicking a checked
33
+ * option does not refresh the reports); without it, the first unchecked one.
34
+ */
35
+ export declare function selectDashboardDateRange(page: Page, label?: string): Promise<string | null>;
29
36
  export declare function isAgenticDashboardDefinitionResponse(response: CapturedResponse): boolean;
30
37
  export declare function isReportEvaluateResponse(response: CapturedResponse): boolean;
31
38
  export declare function isLikelyDashboardApiResponse(response: CapturedResponse): boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.selectSingleProcessIfPossible = exports.dashboardHasComparisonTile = exports.getReportNumericResult = exports.findReportByName = exports.parseJsonResponseBodies = exports.reloadUntilDashboardReportsHealthy = exports.captureDashboardResponses = exports.isLikelyDashboardApiResponse = exports.isReportEvaluateResponse = exports.isAgenticDashboardDefinitionResponse = exports.changeDashboardDateRange = exports.openAgenticControlPlane = exports.clickFirstVisibleByName = exports.LEGACY_TERMINOLOGY = exports.CURRENT_TERMINOLOGY = exports.EXECUTION_REPORT_NAME = exports.REPORT_EVALUATE_PATH_PATTERN = exports.AGENTIC_DASHBOARD_DEFINITION_PATH = void 0;
3
+ exports.selectSingleProcessIfPossible = exports.dashboardHasComparisonTile = exports.getReportNumericResult = exports.findReportByName = exports.parseJsonResponseBodies = exports.reloadUntilDashboardReportsHealthy = exports.captureDashboardResponses = exports.isLikelyDashboardApiResponse = exports.isReportEvaluateResponse = exports.isAgenticDashboardDefinitionResponse = exports.selectDashboardDateRange = exports.changeDashboardDateRange = exports.openAgenticControlPlane = exports.clickFirstVisibleByName = exports.LEGACY_TERMINOLOGY = exports.CURRENT_TERMINOLOGY = exports.EXECUTION_REPORT_NAME = exports.REPORT_EVALUATE_PATH_PATTERN = exports.AGENTIC_DASHBOARD_DEFINITION_PATH = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  exports.AGENTIC_DASHBOARD_DEFINITION_PATH = '/api/dashboard/agentic';
6
6
  exports.REPORT_EVALUATE_PATH_PATTERN = /\/api\/report\/[^/]+\/evaluate/;
@@ -42,6 +42,16 @@ async function openAgenticControlPlane(page, appsPage, optimizeHomePage, cluster
42
42
  }
43
43
  exports.openAgenticControlPlane = openAgenticControlPlane;
44
44
  async function changeDashboardDateRange(page) {
45
+ return (await selectDashboardDateRange(page)) !== null;
46
+ }
47
+ exports.changeDashboardDateRange = changeDashboardDateRange;
48
+ /**
49
+ * Selects a date-range option on the agentic dashboard and returns its label,
50
+ * or null when nothing was selected. With `label`, selects exactly that
51
+ * option (null if it is missing or already checked, as re-clicking a checked
52
+ * option does not refresh the reports); without it, the first unchecked one.
53
+ */
54
+ async function selectDashboardDateRange(page, label) {
45
55
  const dateRange = page.locator('.dateRange').first();
46
56
  const trigger = dateRange.locator('button.cds--list-box__field').first();
47
57
  const triggerReady = await trigger
@@ -49,7 +59,7 @@ async function changeDashboardDateRange(page) {
49
59
  .then(() => true)
50
60
  .catch(() => false);
51
61
  if (!triggerReady) {
52
- return false;
62
+ return null;
53
63
  }
54
64
  await trigger.click({ timeout: 20000 });
55
65
  const menu = page.locator('ul[role="menu"].cds--menu--shown').last();
@@ -58,7 +68,7 @@ async function changeDashboardDateRange(page) {
58
68
  .then(() => true)
59
69
  .catch(() => false);
60
70
  if (!menuReady) {
61
- return false;
71
+ return null;
62
72
  }
63
73
  const options = menu.locator('[role="menuitemcheckbox"]');
64
74
  await test_1.expect
@@ -68,15 +78,22 @@ async function changeDashboardDateRange(page) {
68
78
  for (let index = 0; index < optionCount; index += 1) {
69
79
  const option = options.nth(index);
70
80
  const isChecked = (await option.getAttribute('aria-checked')) === 'true';
81
+ const optionLabel = (await option.innerText()).trim();
82
+ if (label !== undefined && optionLabel !== label) {
83
+ continue;
84
+ }
71
85
  if (!isChecked) {
72
86
  await option.click({ timeout: 15000 });
73
- return true;
87
+ return optionLabel;
88
+ }
89
+ if (label !== undefined) {
90
+ break;
74
91
  }
75
92
  }
76
93
  await page.keyboard.press('Escape').catch(() => false);
77
- return false;
94
+ return null;
78
95
  }
79
- exports.changeDashboardDateRange = changeDashboardDateRange;
96
+ exports.selectDashboardDateRange = selectDashboardDateRange;
80
97
  function isAgenticDashboardDefinitionResponse(response) {
81
98
  return response.url.toLowerCase().includes(exports.AGENTIC_DASHBOARD_DEFINITION_PATH);
82
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1714",
3
+ "version": "0.0.1716",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",