@camunda/e2e-test-suite 0.0.719 → 0.0.720
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.
|
@@ -14,6 +14,7 @@ declare class IdpCreatePage {
|
|
|
14
14
|
readonly unstructured_addExtractionFieldButton: Locator;
|
|
15
15
|
readonly unstructured_extractionModelDropdown: Locator;
|
|
16
16
|
readonly unstructured_extractDocumentButton: Locator;
|
|
17
|
+
readonly unstructured_overrideTestCaseButton: Locator;
|
|
17
18
|
readonly unstructured_saveAsTestCaseButton: Locator;
|
|
18
19
|
readonly unstructured_testCaseSavedNotification: Locator;
|
|
19
20
|
readonly unstructured_validateExtractionTab: Locator;
|
|
@@ -18,6 +18,7 @@ class IdpCreatePage {
|
|
|
18
18
|
unstructured_addExtractionFieldButton;
|
|
19
19
|
unstructured_extractionModelDropdown;
|
|
20
20
|
unstructured_extractDocumentButton;
|
|
21
|
+
unstructured_overrideTestCaseButton;
|
|
21
22
|
unstructured_saveAsTestCaseButton;
|
|
22
23
|
unstructured_testCaseSavedNotification;
|
|
23
24
|
unstructured_validateExtractionTab;
|
|
@@ -79,6 +80,9 @@ class IdpCreatePage {
|
|
|
79
80
|
this.unstructured_extractDocumentButton = page.getByRole('button', {
|
|
80
81
|
name: 'Extract document',
|
|
81
82
|
});
|
|
83
|
+
this.unstructured_overrideTestCaseButton = page.getByRole('button', {
|
|
84
|
+
name: 'Override test case',
|
|
85
|
+
});
|
|
82
86
|
this.unstructured_saveAsTestCaseButton = page.getByRole('button', {
|
|
83
87
|
name: 'Save as test case',
|
|
84
88
|
});
|
|
@@ -194,16 +198,43 @@ class IdpCreatePage {
|
|
|
194
198
|
}
|
|
195
199
|
}
|
|
196
200
|
async clickExtractDocumentButton() {
|
|
201
|
+
// The unstructured extraction runs an AI model (e.g. AWS Bedrock Claude
|
|
202
|
+
// Sonnet 4) whose backend has been observed to stall in the "Extracting..."
|
|
203
|
+
// state or surface a transient failure, leaving "Save as test case"
|
|
204
|
+
// disabled. Re-trigger the extraction up to maxRetries times so a one-off
|
|
205
|
+
// backend blip self-heals while a sustained outage still surfaces red.
|
|
197
206
|
await (0, test_1.expect)(this.unstructured_extractDocumentButton).toBeVisible({
|
|
198
207
|
timeout: 90000,
|
|
199
208
|
});
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
timeout:
|
|
206
|
-
|
|
209
|
+
const maxRetries = 3;
|
|
210
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
211
|
+
await (0, test_1.expect)(this.unstructured_extractDocumentButton).toBeEnabled({
|
|
212
|
+
timeout: 120000,
|
|
213
|
+
});
|
|
214
|
+
await this.unstructured_extractDocumentButton.click({ timeout: 60000 });
|
|
215
|
+
const overrideVisible = await this.unstructured_overrideTestCaseButton
|
|
216
|
+
.isVisible()
|
|
217
|
+
.catch(() => false);
|
|
218
|
+
if (overrideVisible) {
|
|
219
|
+
await this.unstructured_overrideTestCaseButton.click({ timeout: 60000 });
|
|
220
|
+
}
|
|
221
|
+
try {
|
|
222
|
+
await (0, test_1.expect)(this.unstructured_saveAsTestCaseButton).toBeEnabled({
|
|
223
|
+
timeout: 150000,
|
|
224
|
+
});
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
console.error(`Attempt ${attempt + 1} of unstructured extraction did not ` +
|
|
229
|
+
`enable "Save as test case": ${error}`);
|
|
230
|
+
await this.closeNotificationButton
|
|
231
|
+
.click({ timeout: 5000 })
|
|
232
|
+
.catch(() => { });
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
throw new Error(`Unstructured extraction did not complete after ${maxRetries} ` +
|
|
236
|
+
`attempts ("Save as test case" never enabled). Check Camunda's IDP ` +
|
|
237
|
+
`backend / upstream AI provider response.`);
|
|
207
238
|
}
|
|
208
239
|
async clickSaveAsTestCaseButton() {
|
|
209
240
|
await this.unstructured_saveAsTestCaseButton.click({ timeout: 60000 });
|