@camunda/e2e-test-suite 0.0.1715 → 0.0.1717
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.
- package/dist/pages/8.11/OperateProcessInstancePage.d.ts +3 -2
- package/dist/pages/8.11/OperateProcessInstancePage.js +27 -16
- package/dist/pages/SM-8.11/OperateProcessesPage.js +13 -7
- package/dist/tests/8.11/agentic-ai-user-flows.spec.js +3 -3
- package/dist/tests/8.11/optimize-agentic-control-panel-api.spec.js +37 -4
- package/dist/utils/agenticDashboardHelpers.d.ts +7 -0
- package/dist/utils/agenticDashboardHelpers.js +23 -6
- package/package.json +1 -1
|
@@ -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
|
-
|
|
47
|
-
|
|
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(
|
|
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
|
-
|
|
909
|
-
|
|
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
|
-
|
|
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(
|
|
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(
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
await (0, test_1.expect)(
|
|
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(
|
|
940
|
+
await this.assertFinalAnswerVisible();
|
|
929
941
|
}
|
|
930
|
-
async assertFinalAnswerVisible(
|
|
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 =
|
|
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() {
|
|
@@ -24,16 +24,22 @@ class OperateProcessesPage {
|
|
|
24
24
|
this.page = page;
|
|
25
25
|
this.processResultCount = page.getByTestId('result-count');
|
|
26
26
|
this.processesTabLink = page.getByRole('link', { name: 'Processes' });
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
// Select the state-filter checkboxes by their accessible name rather than a
|
|
28
|
+
// raw element id. The 8.11 Operate UI (orchestration-cluster-webapp) renders
|
|
29
|
+
// these with `id="filter-active"`/`"filter-completed"`/`"filter-incidents"`,
|
|
30
|
+
// while the legacy Operate the nightly still deploys uses `active`/
|
|
31
|
+
// `completed`/`incidents`; the role+name locator matches both, mirroring the
|
|
32
|
+
// product's own Operate e2e suite.
|
|
33
|
+
this.processActiveCheckbox = page.getByRole('checkbox', { name: 'Active' });
|
|
34
|
+
this.processCompletedCheckbox = page.getByRole('checkbox', {
|
|
35
|
+
name: 'Completed',
|
|
36
|
+
});
|
|
33
37
|
this.processRunningInstancesCheckbox = page
|
|
34
38
|
.getByTestId('filter-running-instances')
|
|
35
39
|
.getByRole('checkbox');
|
|
36
|
-
this.processIncidentsCheckbox = page.
|
|
40
|
+
this.processIncidentsCheckbox = page.getByRole('checkbox', {
|
|
41
|
+
name: 'Incidents',
|
|
42
|
+
});
|
|
37
43
|
this.processPageHeading = page
|
|
38
44
|
.getByTestId('expanded-panel')
|
|
39
45
|
.getByRole('heading', { name: 'Process' });
|
|
@@ -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
|
-
|
|
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(
|
|
271
|
+
await operateProcessInstancePage.assertReadableReasoning();
|
|
272
272
|
}
|
|
273
273
|
else {
|
|
274
|
-
await operateProcessInstancePage.assertEncryptedReasoningIsHidden(
|
|
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
|
-
|
|
81
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
94
|
+
return null;
|
|
78
95
|
}
|
|
79
|
-
exports.
|
|
96
|
+
exports.selectDashboardDateRange = selectDashboardDateRange;
|
|
80
97
|
function isAgenticDashboardDefinitionResponse(response) {
|
|
81
98
|
return response.url.toLowerCase().includes(exports.AGENTIC_DASHBOARD_DEFINITION_PATH);
|
|
82
99
|
}
|