@camunda/e2e-test-suite 0.0.1542 → 0.0.1544
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.
|
@@ -4,6 +4,7 @@ import { ClientCredentialsDetailsPage } from './ClientCredentialsDetailsPage';
|
|
|
4
4
|
declare class ClusterDetailsPage {
|
|
5
5
|
private page;
|
|
6
6
|
private pendingClientScopeCheck;
|
|
7
|
+
private clusterDetailsUrl;
|
|
7
8
|
readonly apiTab: Locator;
|
|
8
9
|
readonly createFirstClientButton: Locator;
|
|
9
10
|
readonly clientNameTextbox: Locator;
|
|
@@ -24,7 +25,13 @@ declare class ClusterDetailsPage {
|
|
|
24
25
|
readonly clientCredentialsDialog: Locator;
|
|
25
26
|
readonly clustersLink: Locator;
|
|
26
27
|
readonly alertsTab: Locator;
|
|
28
|
+
readonly alertsTabPanel: Locator;
|
|
27
29
|
readonly alertsList: Locator;
|
|
30
|
+
readonly alertExpandRowButtons: Locator;
|
|
31
|
+
readonly alertRowActionsButtons: Locator;
|
|
32
|
+
readonly deleteAlertMenuItem: Locator;
|
|
33
|
+
readonly deleteAlertConfirmButton: Locator;
|
|
34
|
+
readonly alertsPanel: Locator;
|
|
28
35
|
readonly createFirstAlertButton: Locator;
|
|
29
36
|
readonly createNewAlertButton: Locator;
|
|
30
37
|
readonly emailRadioButton: Locator;
|
|
@@ -74,6 +81,7 @@ declare class ClusterDetailsPage {
|
|
|
74
81
|
searchAndClickClientCredentialsLink(name: string): Promise<ClientCredentialsDetailsPage>;
|
|
75
82
|
deleteAPIClientsIfExist(name?: string): Promise<void>;
|
|
76
83
|
clickAlertsTab(): Promise<void>;
|
|
84
|
+
reopenAlertsTab(): Promise<void>;
|
|
77
85
|
clickExpandButton(): Promise<void>;
|
|
78
86
|
clickCreateFirstAlertButton(): Promise<void>;
|
|
79
87
|
clickCreateNewAlertButton(): Promise<void>;
|
|
@@ -81,6 +89,7 @@ declare class ClusterDetailsPage {
|
|
|
81
89
|
selectEmailRadioButton(): Promise<void>;
|
|
82
90
|
clickCreateAlertButton(): Promise<void>;
|
|
83
91
|
deleteAlerts(): Promise<void>;
|
|
92
|
+
expandAlerts(): Promise<void>;
|
|
84
93
|
private doDelete;
|
|
85
94
|
assertComponentsHealth(components?: string[], recoverSession?: () => Promise<void>): Promise<void>;
|
|
86
95
|
private isSessionLost;
|
|
@@ -6,11 +6,17 @@ const sleep_1 = require("../../utils/sleep");
|
|
|
6
6
|
const clickLocatorWithRetry_1 = require("../../utils/assertionHelpers/clickLocatorWithRetry");
|
|
7
7
|
const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
|
|
8
8
|
const ClientCredentialsDetailsPage_1 = require("./ClientCredentialsDetailsPage");
|
|
9
|
+
const sessionRecovery_1 = require("../../utils/sessionRecovery");
|
|
10
|
+
// Hub's own /login and /login-callback routes, which render only a spinner
|
|
11
|
+
// while the Auth0 hand-off of a full page load is in flight.
|
|
12
|
+
const HUB_LOGIN_ROUTE = /^\/login(-callback)?\/?$/;
|
|
9
13
|
class ClusterDetailsPage {
|
|
10
14
|
page;
|
|
11
15
|
// Name of a client whose scopes still have to be checked against the
|
|
12
16
|
// clients list — see createAPIClient() / clickCloseModalButton().
|
|
13
17
|
pendingClientScopeCheck = null;
|
|
18
|
+
// The cluster page reopenAlertsTab() goes back to -- see there.
|
|
19
|
+
clusterDetailsUrl;
|
|
14
20
|
apiTab;
|
|
15
21
|
createFirstClientButton;
|
|
16
22
|
clientNameTextbox;
|
|
@@ -31,7 +37,13 @@ class ClusterDetailsPage {
|
|
|
31
37
|
clientCredentialsDialog;
|
|
32
38
|
clustersLink;
|
|
33
39
|
alertsTab;
|
|
40
|
+
alertsTabPanel;
|
|
34
41
|
alertsList;
|
|
42
|
+
alertExpandRowButtons;
|
|
43
|
+
alertRowActionsButtons;
|
|
44
|
+
deleteAlertMenuItem;
|
|
45
|
+
deleteAlertConfirmButton;
|
|
46
|
+
alertsPanel;
|
|
35
47
|
createFirstAlertButton;
|
|
36
48
|
createNewAlertButton;
|
|
37
49
|
emailRadioButton;
|
|
@@ -115,15 +127,43 @@ class ClusterDetailsPage {
|
|
|
115
127
|
.getByRole('banner')
|
|
116
128
|
.getByRole('link', { name: 'Clusters' });
|
|
117
129
|
this.alertsTab = page.getByRole('tab', { name: 'Alerts' });
|
|
118
|
-
|
|
130
|
+
// Only the selected tab's panel is exposed (the design-system tabs unmount
|
|
131
|
+
// the others, Carbon marks them hidden), and it is named after its tab.
|
|
132
|
+
// Page-wide, getByRole('row') read the Overview "Cluster Details" rows
|
|
133
|
+
// whenever Overview was showing -- the nightly's `Received string:
|
|
134
|
+
// "NameAlert Flow Cluster"` where the Email alert row was expected.
|
|
135
|
+
this.alertsTabPanel = page.getByRole('tabpanel', { name: 'Alerts' });
|
|
136
|
+
this.alertsList = this.alertsTabPanel
|
|
119
137
|
.getByRole('row')
|
|
120
138
|
.filter({ hasNotText: 'Delivery method' }); //Filter out header row
|
|
139
|
+
// Hub's Alerts tab is a design-system data table: one summary row per
|
|
140
|
+
// alert (Delivery method / Created at / Created by), with the detail
|
|
141
|
+
// fields in a sibling expansion row that only exists once the row's
|
|
142
|
+
// "Expand row" toggle is clicked, and Delete behind the row's "Row
|
|
143
|
+
// actions" kebab -> "Delete" -> "Delete alert" dialog (camunda-hub e2e
|
|
144
|
+
// ConsoleClusterDetailsPage). Scoped to the visible tab panel.
|
|
145
|
+
this.alertExpandRowButtons = page
|
|
146
|
+
.getByRole('tabpanel')
|
|
147
|
+
.getByRole('button', { name: 'Expand row', exact: true });
|
|
148
|
+
this.alertRowActionsButtons = page
|
|
149
|
+
.getByRole('tabpanel')
|
|
150
|
+
.getByRole('button', { name: 'Row actions', exact: true });
|
|
151
|
+
this.deleteAlertMenuItem = page.getByRole('menuitem', {
|
|
152
|
+
name: 'Delete',
|
|
153
|
+
exact: true,
|
|
154
|
+
});
|
|
155
|
+
this.deleteAlertConfirmButton = page
|
|
156
|
+
.getByRole('dialog', { name: 'Delete alert' })
|
|
157
|
+
.getByRole('button', { name: 'Delete', exact: true });
|
|
121
158
|
this.createFirstAlertButton = page.getByRole('button', {
|
|
122
159
|
name: 'Create an alert',
|
|
123
160
|
});
|
|
124
161
|
this.createNewAlertButton = page.getByRole('button', {
|
|
125
162
|
name: 'Create new alert',
|
|
126
163
|
});
|
|
164
|
+
// The Alerts panel offers "Create an alert" while empty and "Create new
|
|
165
|
+
// alert" once it holds one, so either proves the panel itself mounted.
|
|
166
|
+
this.alertsPanel = this.createFirstAlertButton.or(this.createNewAlertButton);
|
|
127
167
|
this.emailRadioButton = page.getByRole('radio', {
|
|
128
168
|
name: 'Email',
|
|
129
169
|
});
|
|
@@ -488,6 +528,45 @@ class ClusterDetailsPage {
|
|
|
488
528
|
async clickAlertsTab() {
|
|
489
529
|
await (0, test_1.expect)(this.alertsTab).toBeVisible({ timeout: 40000 });
|
|
490
530
|
await this.alertsTab.click();
|
|
531
|
+
// The tab bar remounts while the cluster payload is still arriving, which
|
|
532
|
+
// discards the click and leaves Overview selected -- and the tab is a
|
|
533
|
+
// button, not a route, so nothing later re-selects it. Callers would then
|
|
534
|
+
// find no Alerts panel for alertsList to read. Confirm the panel mounted,
|
|
535
|
+
// re-selecting the tab after a reload between attempts.
|
|
536
|
+
await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.alertsPanel, {
|
|
537
|
+
visibilityTimeout: 60000,
|
|
538
|
+
totalTimeout: 240000,
|
|
539
|
+
maxRetries: 4,
|
|
540
|
+
postAction: async () => {
|
|
541
|
+
await this.page.reload({ waitUntil: 'domcontentloaded' });
|
|
542
|
+
await this.alertsTab.waitFor({ state: 'visible', timeout: 60000 });
|
|
543
|
+
await this.alertsTab.click({ timeout: 60000 });
|
|
544
|
+
},
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
// Re-enters the cluster page and re-opens the Alerts tab, for callers that
|
|
548
|
+
// poll the alerts table for a server-side change. Hub keeps the selected
|
|
549
|
+
// tab out of the URL (ClusterDetails.saas.tsx drops c4's tabChange), so any
|
|
550
|
+
// full load comes back on Overview and the tab has to be clicked again.
|
|
551
|
+
// A goto to the remembered cluster page rather than a reload: a full load
|
|
552
|
+
// re-runs Hub's Auth0 hand-off, and a reload issued while the page is still
|
|
553
|
+
// parked on /login-callback?code=... replays that single-use code.
|
|
554
|
+
async reopenAlertsTab() {
|
|
555
|
+
if ((0, sessionRecovery_1.isAtIdentityProvider)(this.page)) {
|
|
556
|
+
await (0, sessionRecovery_1.restoreSessionIfLoggedOut)(this.page);
|
|
557
|
+
}
|
|
558
|
+
const current = new URL(this.page.url());
|
|
559
|
+
if (!(0, sessionRecovery_1.isAtIdentityProvider)(this.page) &&
|
|
560
|
+
!HUB_LOGIN_ROUTE.test(current.pathname)) {
|
|
561
|
+
this.clusterDetailsUrl = current.href;
|
|
562
|
+
}
|
|
563
|
+
const target = this.clusterDetailsUrl ?? current.href;
|
|
564
|
+
const host = new URL(target).host;
|
|
565
|
+
await this.page.goto(target, { waitUntil: 'domcontentloaded' });
|
|
566
|
+
// goto() resolves on the first document; the hand-off then bounces
|
|
567
|
+
// through /login and /login-callback (~45s on CI) before it lands back.
|
|
568
|
+
await this.page.waitForURL((url) => url.host === host && !HUB_LOGIN_ROUTE.test(url.pathname), { timeout: 120000 });
|
|
569
|
+
await this.clickAlertsTab();
|
|
491
570
|
}
|
|
492
571
|
async clickExpandButton() {
|
|
493
572
|
await this.expandButton.click({ timeout: 60000 });
|
|
@@ -526,7 +605,47 @@ class ClusterDetailsPage {
|
|
|
526
605
|
});
|
|
527
606
|
}
|
|
528
607
|
async deleteAlerts() {
|
|
529
|
-
await this.
|
|
608
|
+
const hasRowActions = await this.alertRowActionsButtons
|
|
609
|
+
.first()
|
|
610
|
+
.waitFor({ state: 'visible', timeout: 10000 })
|
|
611
|
+
.then(() => true)
|
|
612
|
+
.catch(() => false);
|
|
613
|
+
if (!hasRowActions) {
|
|
614
|
+
await this.doDelete(this.dialog, 'Alerts');
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
let remaining = await this.alertRowActionsButtons.count();
|
|
618
|
+
while (remaining > 0) {
|
|
619
|
+
// A re-render can detach the menu between opening it and the click, so
|
|
620
|
+
// open-menu-and-choose-Delete is retried as one unit.
|
|
621
|
+
await (0, test_1.expect)(async () => {
|
|
622
|
+
await this.alertRowActionsButtons.first().click({ timeout: 10000 });
|
|
623
|
+
await this.deleteAlertMenuItem.click({ timeout: 10000 });
|
|
624
|
+
await (0, test_1.expect)(this.deleteAlertConfirmButton).toBeVisible({
|
|
625
|
+
timeout: 10000,
|
|
626
|
+
});
|
|
627
|
+
}).toPass({ timeout: 60000 });
|
|
628
|
+
await this.deleteAlertConfirmButton.click({ timeout: 30000 });
|
|
629
|
+
await (0, test_1.expect)(this.alertRowActionsButtons).toHaveCount(remaining - 1, {
|
|
630
|
+
timeout: 60000,
|
|
631
|
+
});
|
|
632
|
+
remaining = await this.alertRowActionsButtons.count();
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
// Reveals each alert's detail row. A no-op on the legacy table, whose
|
|
636
|
+
// detail rows are always rendered.
|
|
637
|
+
async expandAlerts() {
|
|
638
|
+
for (let i = 0; i < 10; i++) {
|
|
639
|
+
const toggle = this.alertExpandRowButtons.first();
|
|
640
|
+
if (!(await toggle.isVisible().catch(() => false))) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
const before = await this.alertExpandRowButtons.count();
|
|
644
|
+
await toggle.click({ timeout: 10000 });
|
|
645
|
+
await (0, test_1.expect)(this.alertExpandRowButtons).toHaveCount(before - 1, {
|
|
646
|
+
timeout: 10000,
|
|
647
|
+
});
|
|
648
|
+
}
|
|
530
649
|
}
|
|
531
650
|
async doDelete(dialog, text) {
|
|
532
651
|
try {
|
|
@@ -782,14 +901,15 @@ class ClusterDetailsPage {
|
|
|
782
901
|
async assertAlertText(text, timeout = 60000, maxRetries = 10) {
|
|
783
902
|
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
784
903
|
try {
|
|
904
|
+
await (0, test_1.expect)(this.alertsList.first()).toBeVisible({ timeout });
|
|
905
|
+
await this.expandAlerts();
|
|
785
906
|
await (0, test_1.expect)(this.alertsList.nth(1)).toContainText(text, { timeout });
|
|
786
907
|
return;
|
|
787
908
|
}
|
|
788
909
|
catch (error) {
|
|
789
910
|
if (attempt < maxRetries - 1) {
|
|
790
911
|
console.warn(`Attempt ${attempt + 1} failed for asserting ${text}. Retrying...`);
|
|
791
|
-
await this.
|
|
792
|
-
await (0, sleep_1.sleep)(20000);
|
|
912
|
+
await this.reopenAlertsTab();
|
|
793
913
|
}
|
|
794
914
|
else {
|
|
795
915
|
throw new Error(`Assertion failed after ${maxRetries} attempts`);
|
|
@@ -85,8 +85,8 @@ class IdpCreatePage {
|
|
|
85
85
|
name: 'Create template',
|
|
86
86
|
exact: true,
|
|
87
87
|
});
|
|
88
|
-
this.unstructured_UploadFilesButton = page.getByRole('
|
|
89
|
-
name:
|
|
88
|
+
this.unstructured_UploadFilesButton = page.getByRole('region', {
|
|
89
|
+
name: /Drag and drop.*PDF.*upload/i,
|
|
90
90
|
});
|
|
91
91
|
this.extractButton = page.getByRole('button', {
|
|
92
92
|
name: 'Extract',
|
|
@@ -95,7 +95,7 @@ class IdpCreatePage {
|
|
|
95
95
|
this.unstructured_extractFieldName = page.locator('#new-extraction-field-name');
|
|
96
96
|
this.unstructured_extractFieldPrompt = page.locator('#new-extraction-field-prompt');
|
|
97
97
|
this.unstructured_addExtractionFieldButton = page.getByRole('button', {
|
|
98
|
-
name: 'Add',
|
|
98
|
+
name: 'Add field',
|
|
99
99
|
exact: true,
|
|
100
100
|
});
|
|
101
101
|
this.unstructured_extractionModelDropdown =
|
|
@@ -109,8 +109,13 @@ class IdpCreatePage {
|
|
|
109
109
|
this.unstructured_validateExtractionTab = page.getByRole('tab', {
|
|
110
110
|
name: 'Validate extraction',
|
|
111
111
|
});
|
|
112
|
-
this.unstructured_testCaseSavedNotification = page.getByText('
|
|
113
|
-
this.unstructured_expandAllRowsButton = page
|
|
112
|
+
this.unstructured_testCaseSavedNotification = page.getByText('Test case successfully saved');
|
|
113
|
+
this.unstructured_expandAllRowsButton = page
|
|
114
|
+
.getByRole('row')
|
|
115
|
+
.filter({ hasText: 'bank_account_number' })
|
|
116
|
+
.getByRole('button')
|
|
117
|
+
.first()
|
|
118
|
+
.or(page.getByLabel('Expand all rows'));
|
|
114
119
|
this.unstructured_passTestCaseResultsRows = page.locator('[data-test="pass-test-case-results"]');
|
|
115
120
|
this.unstructured_publishButton = page.getByRole('button', {
|
|
116
121
|
name: 'Publish',
|
|
@@ -125,18 +130,29 @@ class IdpCreatePage {
|
|
|
125
130
|
this.unstructured_publishButtonModal = page
|
|
126
131
|
.getByLabel('Publish Extraction Project')
|
|
127
132
|
.getByRole('button', { name: 'Publish' });
|
|
128
|
-
this.unstructured_idpSuccessfullPublishNotification = page.getByText('
|
|
129
|
-
this.unstructured_toastNotificationCloseButton =
|
|
130
|
-
|
|
133
|
+
this.unstructured_idpSuccessfullPublishNotification = page.getByText('IDP project published successfully.');
|
|
134
|
+
this.unstructured_toastNotificationCloseButton = page
|
|
135
|
+
.locator('[data-sonner-toast]')
|
|
136
|
+
.getByRole('button', { name: 'Dismiss' })
|
|
137
|
+
.or(page.getByLabel('Close notification'))
|
|
138
|
+
.first();
|
|
131
139
|
this.selectUnstructuredDataExtraction = page.locator('#idp-project-extraction-method-unstructured');
|
|
132
|
-
|
|
133
|
-
|
|
140
|
+
// The design-system radio tile exposes a `radio` named after its title and
|
|
141
|
+
// description and renders no `label[for]`, so match on the role and keep the
|
|
142
|
+
// id/label lookups for the Carbon variant.
|
|
143
|
+
this.selectStructuredDataExtraction = page
|
|
144
|
+
.getByRole('radio', { name: /^Structured form extraction/ })
|
|
145
|
+
.or(page.locator('#idp-project-extraction-method-structured'))
|
|
146
|
+
.first();
|
|
147
|
+
this.selectStructuredDataExtractionLabel = page
|
|
148
|
+
.getByRole('radiogroup')
|
|
149
|
+
.getByText('Structured form extraction')
|
|
150
|
+
.or(page.locator('label[for="idp-project-extraction-method-structured"]'))
|
|
151
|
+
.first();
|
|
134
152
|
this.extractionInProgressNotification = page.getByText('Extracting document...');
|
|
135
153
|
this.extractionInProgressNotificationForMultipleFiles = page.getByText('Extracting documents...');
|
|
136
154
|
this.structured_uploadFilesButton = page
|
|
137
|
-
.getByRole('
|
|
138
|
-
name: /Drag and drop.*PDF.*upload/i,
|
|
139
|
-
})
|
|
155
|
+
.getByRole('region', { name: /Drag and drop.*PDF.*upload/i })
|
|
140
156
|
.first();
|
|
141
157
|
this.structured_FieldsTab = page.getByRole('tab', {
|
|
142
158
|
name: 'Fields',
|
|
@@ -147,12 +163,19 @@ class IdpCreatePage {
|
|
|
147
163
|
this.structured_TestTemplateTab = page.getByRole('tab', {
|
|
148
164
|
name: 'Test template',
|
|
149
165
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
166
|
+
// The design-system table puts `aria-label="Activate all rows"` on the
|
|
167
|
+
// header checkbox itself, so the column header no longer carries that name.
|
|
168
|
+
this.structured_CheckboxSelectAllFields = page
|
|
169
|
+
.getByRole('checkbox', { name: 'Activate all rows' })
|
|
170
|
+
.or(page
|
|
171
|
+
.getByRole('table', { name: 'Extracted fields' })
|
|
172
|
+
.getByRole('columnheader')
|
|
173
|
+
.getByRole('checkbox'))
|
|
174
|
+
.first();
|
|
175
|
+
this.structured_CheckboxSelectAllTables = page
|
|
176
|
+
.getByText('Select all tables')
|
|
177
|
+
.first();
|
|
178
|
+
this.structured_SelectedFieldsTablesMessage = page.getByText(/^\s*\d+\s+fields?\s*(?:&\s*\d+\s+tables?\s*)?selected$/);
|
|
156
179
|
this.structured_TestExtractionTemplateButton = page.getByRole('button', {
|
|
157
180
|
name: 'Test extraction template',
|
|
158
181
|
});
|
|
@@ -213,11 +236,22 @@ class IdpCreatePage {
|
|
|
213
236
|
.locator('span:has-text("Accuracy") + span');
|
|
214
237
|
}
|
|
215
238
|
async clickCreateIdpTemplateButton() {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
239
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
240
|
+
if (!(await this.createExtractionTemplateOption.isVisible())) {
|
|
241
|
+
await this.createNewDropdownButton.click({ timeout: 60000 });
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
await (0, test_1.expect)(this.createExtractionTemplateOption).toBeVisible({
|
|
245
|
+
timeout: 10000,
|
|
246
|
+
});
|
|
247
|
+
await this.createExtractionTemplateOption.click({ timeout: 10000 });
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
// menu did not open, or item detached before the click; retry
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
throw new Error('Failed to click create extraction template option after 3 attempts');
|
|
221
255
|
}
|
|
222
256
|
async fillIdpExtractionTemplateName(name) {
|
|
223
257
|
await this.idpExtractionTemplateName.fill(name);
|
|
@@ -249,8 +283,9 @@ class IdpCreatePage {
|
|
|
249
283
|
});
|
|
250
284
|
}
|
|
251
285
|
async clickUnstructuredUploadFilesButton() {
|
|
252
|
-
await this.unstructured_UploadFilesButton.
|
|
253
|
-
|
|
286
|
+
await (0, test_1.expect)(this.unstructured_UploadFilesButton).toBeVisible({
|
|
287
|
+
timeout: 60000,
|
|
288
|
+
});
|
|
254
289
|
}
|
|
255
290
|
async clickExtractButton() {
|
|
256
291
|
await (0, test_1.expect)(this.extractButton).toBeEnabled({
|
|
@@ -270,15 +305,21 @@ class IdpCreatePage {
|
|
|
270
305
|
}
|
|
271
306
|
async selectExtractionModelOption(option) {
|
|
272
307
|
const comboboxOption = this.page.getByRole('option', { name: option });
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
308
|
+
for (let attempt = 0; attempt < 4; attempt++) {
|
|
309
|
+
if (!(await comboboxOption.isVisible())) {
|
|
310
|
+
await this.unstructured_extractionModelDropdown.click({
|
|
311
|
+
timeout: 60000,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
try {
|
|
315
|
+
await comboboxOption.click({ timeout: 10000 });
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
catch {
|
|
319
|
+
// list re-rendered and detached the option mid-click; reopen and retry
|
|
320
|
+
}
|
|
281
321
|
}
|
|
322
|
+
throw new Error(`Failed to select extraction model ${option} after 4 attempts`);
|
|
282
323
|
}
|
|
283
324
|
async clickExtractDocumentButton() {
|
|
284
325
|
await (0, test_1.expect)(this.unstructured_extractDocumentButton).toBeVisible({
|
|
@@ -374,8 +415,6 @@ class IdpCreatePage {
|
|
|
374
415
|
await (0, test_1.expect)(this.structured_uploadFilesButton).toBeVisible({
|
|
375
416
|
timeout: 60000,
|
|
376
417
|
});
|
|
377
|
-
await this.structured_uploadFilesButton.click({ timeout: 60000 });
|
|
378
|
-
await (0, sleep_1.sleep)(6000);
|
|
379
418
|
}
|
|
380
419
|
async selectAllExtractionFields() {
|
|
381
420
|
await (0, test_1.expect)(this.extractionInProgressNotification).not.toBeVisible({
|
|
@@ -9,16 +9,21 @@ const UtilitiesPage_1 = require("../../pages/8.11/UtilitiesPage");
|
|
|
9
9
|
const sleep_1 = require("../../utils/sleep");
|
|
10
10
|
const users_1 = require("../../utils/users");
|
|
11
11
|
const mailSlurpClient_1 = require("../../utils/mailSlurpClient");
|
|
12
|
+
const constants_1 = require("../../utils/constants");
|
|
12
13
|
const testUser = (0, users_1.getTestUser)('eighteenthUser');
|
|
13
14
|
_8_11_1.test.describe.configure({ mode: 'parallel' });
|
|
14
15
|
_8_11_1.test.describe('Console User Flow Tests @tasklistV2', () => {
|
|
15
16
|
const clusterName = 'Test Cluster';
|
|
17
|
+
let inbox = '';
|
|
16
18
|
_8_11_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
|
|
17
19
|
await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
|
|
18
20
|
});
|
|
19
21
|
_8_11_1.test.afterEach(async ({ page }, testInfo) => {
|
|
20
22
|
await (0, _setup_1.captureScreenshot)(page, testInfo);
|
|
21
23
|
await (0, _setup_1.captureFailureVideo)(page, testInfo);
|
|
24
|
+
if (inbox.length > 0) {
|
|
25
|
+
await (0, mailSlurpClient_1.deleteInbox)(inbox);
|
|
26
|
+
}
|
|
22
27
|
});
|
|
23
28
|
(0, _8_11_1.test)('Console Most Common Flow', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, clusterPage, clusterDetailsPage, }) => {
|
|
24
29
|
const clientName = await (0, _setup_1.generateRandomStringAsync)(6);
|
|
@@ -77,14 +82,14 @@ _8_11_1.test.describe('Console User Flow Tests @tasklistV2', () => {
|
|
|
77
82
|
await clusterPage.assertClusterHealthyStatusWithRetry(newClusterName, 300000, 1500000);
|
|
78
83
|
});
|
|
79
84
|
});
|
|
80
|
-
|
|
81
|
-
_8_11_1.test.skip('Alert Trigger Flow - Email Notification', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, clusterPage, clusterDetailsPage, connectorSettingsPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, }) => {
|
|
85
|
+
(0, _8_11_1.test)('Alert Trigger Flow - Email Notification', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, clusterPage, clusterDetailsPage, connectorSettingsPage, operateHomePage, operateProcessesPage, operateProcessInstancePage, }) => {
|
|
82
86
|
_8_11_1.test.slow();
|
|
83
87
|
const processName = 'Email_Alert_Process' + (await (0, _setup_1.generateRandomStringAsync)(3));
|
|
84
88
|
const invalidURl = 'https://invalid';
|
|
85
89
|
let lastTriggerTime = 0;
|
|
86
|
-
const alertFlowClusterName = 'Alert Flow Cluster';
|
|
87
90
|
const { id } = await (0, mailSlurpClient_1.createInbox)(testUser.username);
|
|
91
|
+
inbox = id;
|
|
92
|
+
const alertFlowClusterName = 'Alert Flow Cluster';
|
|
88
93
|
await _8_11_1.test.step('Create Cluster', async () => {
|
|
89
94
|
await homePage.clickClusters();
|
|
90
95
|
await clusterPage.createClusterIfNotExists(alertFlowClusterName);
|
|
@@ -94,15 +99,20 @@ _8_11_1.test.describe('Console User Flow Tests @tasklistV2', () => {
|
|
|
94
99
|
await clusterPage.clickClusterLink(alertFlowClusterName);
|
|
95
100
|
await clusterDetailsPage.clickAlertsTab();
|
|
96
101
|
await clusterDetailsPage.deleteAlerts();
|
|
97
|
-
(0, test_1.expect)(
|
|
102
|
+
await (0, test_1.expect)(clusterDetailsPage.alertsList).toHaveCount(0, {
|
|
103
|
+
timeout: 15000,
|
|
104
|
+
});
|
|
98
105
|
});
|
|
99
106
|
await _8_11_1.test.step('Create First Email Alert', async () => {
|
|
100
107
|
await clusterDetailsPage.createAlert(true);
|
|
101
|
-
(0, test_1.expect)(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
await (0, test_1.expect)(async () => {
|
|
109
|
+
await clusterDetailsPage.expandAlerts();
|
|
110
|
+
(0, test_1.expect)(await clusterDetailsPage.alertsList.count()).toBeGreaterThan(1);
|
|
111
|
+
await (0, test_1.expect)(clusterDetailsPage.alertsList.nth(0)).toContainText(`Email`);
|
|
112
|
+
await (0, test_1.expect)(clusterDetailsPage.alertsList.nth(1)).toContainText(testUser.username);
|
|
113
|
+
await (0, test_1.expect)(clusterDetailsPage.alertsList.nth(1)).toContainText((0, formatDate_1.formatDate)());
|
|
114
|
+
await (0, test_1.expect)(clusterDetailsPage.alertsList.nth(1)).toContainText('Amount triggered0');
|
|
115
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
106
116
|
});
|
|
107
117
|
await _8_11_1.test.step('Navigate to Web Modeler', async () => {
|
|
108
118
|
await appsPage.clickCamundaApps();
|
|
@@ -144,14 +154,15 @@ _8_11_1.test.describe('Console User Flow Tests @tasklistV2', () => {
|
|
|
144
154
|
await _8_11_1.test.step('Verify Alert Count Increases to 1 After Trigger', async () => {
|
|
145
155
|
await clusterDetailsPage.clickAlertsTab();
|
|
146
156
|
await (0, test_1.expect)(async () => {
|
|
147
|
-
await
|
|
157
|
+
await clusterDetailsPage.reopenAlertsTab();
|
|
148
158
|
await (0, test_1.expect)(clusterDetailsPage.alertsList.first()).toBeVisible({
|
|
149
159
|
timeout: 20000,
|
|
150
160
|
});
|
|
161
|
+
await clusterDetailsPage.expandAlerts();
|
|
151
162
|
(0, test_1.expect)(await clusterDetailsPage.alertsList.count()).toBeGreaterThan(1);
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
163
|
+
await (0, test_1.expect)(clusterDetailsPage.alertsList.nth(0)).toContainText(`Email`);
|
|
164
|
+
await clusterDetailsPage.assertAlertText('Amount triggered1');
|
|
165
|
+
}).toPass({ timeout: 240000 });
|
|
155
166
|
});
|
|
156
167
|
await _8_11_1.test.step('Verify Alerts Received via Email for Incident', async () => {
|
|
157
168
|
await (0, sleep_1.sleep)(60000);
|
|
@@ -170,7 +181,26 @@ _8_11_1.test.describe('Console User Flow Tests @tasklistV2', () => {
|
|
|
170
181
|
await modelerHomePage.clickCrossComponentProjectFolder();
|
|
171
182
|
await modelerHomePage.clickProcessDiagram(processName);
|
|
172
183
|
await modelerCreatePage.runProcessInstance(alertFlowClusterName);
|
|
173
|
-
|
|
184
|
+
// Straight into the next run, no wait. The email assertion below expects
|
|
185
|
+
// ONE mail reporting "New Incidents: 2", which only happens when both
|
|
186
|
+
// incidents fall inside the same alert evaluation cycle; the 10s sleep
|
|
187
|
+
// that used to be here pushed them into separate cycles and Console sent
|
|
188
|
+
// a "New Incidents: 1" mail for each (nightly: "3 email(s) present",
|
|
189
|
+
// none matching). Ported from 8.8 (647375e5d).
|
|
190
|
+
//
|
|
191
|
+
// Close the first run's toast before clicking again: camunda-hub 6813a7e
|
|
192
|
+
// made the "Instance started!" toast persistent whenever it carries the
|
|
193
|
+
// Operate action, so its action button covers "Deploy & run" and would
|
|
194
|
+
// swallow the second click.
|
|
195
|
+
const instanceStartedToast = page
|
|
196
|
+
.locator('[data-sonner-toast]')
|
|
197
|
+
.filter({ has: modelerCreatePage.viewProcessInstanceLink });
|
|
198
|
+
await instanceStartedToast
|
|
199
|
+
.locator('[data-close-button="true"]')
|
|
200
|
+
.click({ timeout: 30000 });
|
|
201
|
+
await (0, test_1.expect)(modelerCreatePage.viewProcessInstanceLink).toBeHidden({
|
|
202
|
+
timeout: 30000,
|
|
203
|
+
});
|
|
174
204
|
await modelerCreatePage.runProcessInstance(alertFlowClusterName);
|
|
175
205
|
});
|
|
176
206
|
await _8_11_1.test.step('Navigate to Cluster Details', async () => {
|
|
@@ -183,12 +213,13 @@ _8_11_1.test.describe('Console User Flow Tests @tasklistV2', () => {
|
|
|
183
213
|
await _8_11_1.test.step('Verify Alert Count Increases to 3 After Trigger', async () => {
|
|
184
214
|
await clusterDetailsPage.clickAlertsTab();
|
|
185
215
|
await (0, test_1.expect)(async () => {
|
|
186
|
-
await
|
|
216
|
+
await clusterDetailsPage.reopenAlertsTab();
|
|
187
217
|
await (0, test_1.expect)(clusterDetailsPage.alertsList.first()).toBeVisible({
|
|
188
218
|
timeout: 20000,
|
|
189
219
|
});
|
|
220
|
+
await clusterDetailsPage.expandAlerts();
|
|
190
221
|
(0, test_1.expect)(await clusterDetailsPage.alertsList.count()).toBeGreaterThan(1);
|
|
191
|
-
}).toPass({ timeout:
|
|
222
|
+
}).toPass({ timeout: 240000 });
|
|
192
223
|
await clusterDetailsPage.assertAlertText('Amount triggered3');
|
|
193
224
|
});
|
|
194
225
|
await _8_11_1.test.step('Verify Alerts Received via Email for Incident', async () => {
|
|
@@ -14,7 +14,7 @@ let idpDocumentExtractionTemplateName;
|
|
|
14
14
|
const unstructuredTestCases = [
|
|
15
15
|
{
|
|
16
16
|
provider: 'AWS',
|
|
17
|
-
model: 'Claude Sonnet
|
|
17
|
+
model: 'Claude Sonnet 5.5',
|
|
18
18
|
uploadFiles: ['idp/idp_sample_bank_statement.pdf'],
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -39,16 +39,17 @@ const structuredTestCases = [
|
|
|
39
39
|
'idp/structured_invoice_3.pdf',
|
|
40
40
|
],
|
|
41
41
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
// Skipped due to bug #9956: https://github.com/camunda/connectors/issues/9956
|
|
43
|
+
// {
|
|
44
|
+
// provider: 'GCP',
|
|
45
|
+
// model: '',
|
|
46
|
+
// uploadFiles: ['idp/structured_invoice_test.pdf'],
|
|
47
|
+
// extractionFiles: [
|
|
48
|
+
// 'idp/structured_invoice_1.pdf',
|
|
49
|
+
// 'idp/structured_invoice_2.pdf',
|
|
50
|
+
// 'idp/structured_invoice_3.pdf',
|
|
51
|
+
// ],
|
|
52
|
+
// },
|
|
52
53
|
]; /* For structured documents, the model is empty since is not necessary */
|
|
53
54
|
const classificationTestCases = [
|
|
54
55
|
{
|
|
@@ -69,13 +70,7 @@ _8_11_1.test.describe('IDP User Flow Tests', () => {
|
|
|
69
70
|
});
|
|
70
71
|
_8_11_1.test.describe('Unstructured Extraction', () => {
|
|
71
72
|
for (const params of unstructuredTestCases) {
|
|
72
|
-
|
|
73
|
-
// about outbound REST connectors + {{secrets.*}} masking, unrelated to
|
|
74
|
-
// this symptom: "Save as test case" never becomes enabled after
|
|
75
|
-
// extraction is triggered (120s timeout, both attempt and retry, same
|
|
76
|
-
// for AWS and GCP -- see PR #3348 run 34109991740). Mis-attributed to
|
|
77
|
-
// #8500 originally; needs its own bug filed before unskipping again.
|
|
78
|
-
_8_11_1.test.skip(`${params.provider} unstructured (${params.model}) - User creates an idp application with a document extraction template`, async ({ page, idpCreatePage, modelerHomePage, homePage, appsPage, clusterPage, clusterSecretsPage, }) => {
|
|
73
|
+
(0, _8_11_1.test)(`${params.provider} unstructured (${params.model}) - User creates an idp application with a document extraction template`, async ({ page, idpCreatePage, modelerHomePage, homePage, appsPage, clusterPage, clusterSecretsPage, }) => {
|
|
79
74
|
_8_11_1.test.slow();
|
|
80
75
|
idpApplicationName = await (0, randomName_1.randomNameAgregator)(`${params.provider} unstructured` + ' - IDP_Application_Name');
|
|
81
76
|
idpDocumentExtractionTemplateName = await (0, randomName_1.randomNameAgregator)(`${params.provider} unstructured` + ' - IDP_Extraction_Template_Name');
|
|
@@ -150,9 +145,7 @@ _8_11_1.test.describe('IDP User Flow Tests', () => {
|
|
|
150
145
|
});
|
|
151
146
|
_8_11_1.test.describe('Structured Extraction', () => {
|
|
152
147
|
for (const params of structuredTestCases) {
|
|
153
|
-
|
|
154
|
-
// comment. Not bug #8500.
|
|
155
|
-
_8_11_1.test.skip(`${params.provider} structured - User creates an idp application with a document extraction template`, async ({ page, idpCreatePage, modelerHomePage, homePage, appsPage, clusterPage, clusterSecretsPage, }) => {
|
|
148
|
+
(0, _8_11_1.test)(`${params.provider} structured - User creates an idp application with a document extraction template`, async ({ page, idpCreatePage, modelerHomePage, homePage, appsPage, clusterPage, clusterSecretsPage, }) => {
|
|
156
149
|
_8_11_1.test.slow();
|
|
157
150
|
idpApplicationName = await (0, randomName_1.randomNameAgregator)(`${params.provider} structured` + ' - IDP_Application_Name');
|
|
158
151
|
idpDocumentExtractionTemplateName = await (0, randomName_1.randomNameAgregator)(`${params.provider} structured` + ' - IDP_Extraction_Template_Name');
|