@camunda/e2e-test-suite 0.0.932 → 0.0.933

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.
@@ -28,6 +28,7 @@ declare class IdpCreatePage {
28
28
  readonly selectUnstructuredDataExtraction: Locator;
29
29
  readonly selectStructuredDataExtraction: Locator;
30
30
  readonly extractionInProgressNotification: Locator;
31
+ readonly extractionFailureIndicator: Locator;
31
32
  readonly structured_FieldsTab: Locator;
32
33
  readonly structured_TablesTab: Locator;
33
34
  readonly structured_CheckboxSelectAllFields: Locator;
@@ -42,6 +43,12 @@ declare class IdpCreatePage {
42
43
  readonly structured_PublishTemplateToProjectButton: Locator;
43
44
  readonly structured_SuccessfullPublishNotification: Locator;
44
45
  constructor(page: Page);
46
+ /**
47
+ * Surfaces a product-side extraction failure as the test error instead of
48
+ * letting the next assertion block for its full timeout and report only
49
+ * "locator timed out" — the on-screen error carries the actual cause.
50
+ */
51
+ private assertNoExtractionFailure;
45
52
  clickCreateIdpTemplateButton(): Promise<void>;
46
53
  fillIdpExtractionTemplateName(name: string): Promise<void>;
47
54
  clickCreateIdpExtractationTemplateButton(): Promise<void>;
@@ -32,6 +32,7 @@ class IdpCreatePage {
32
32
  selectUnstructuredDataExtraction;
33
33
  selectStructuredDataExtraction;
34
34
  extractionInProgressNotification;
35
+ extractionFailureIndicator;
35
36
  structured_FieldsTab;
36
37
  structured_TablesTab;
37
38
  structured_CheckboxSelectAllFields;
@@ -101,6 +102,15 @@ class IdpCreatePage {
101
102
  this.selectUnstructuredDataExtraction = page.getByText('Unstructured data extraction');
102
103
  this.selectStructuredDataExtraction = page.getByText('Structured form extraction');
103
104
  this.extractionInProgressNotification = page.getByText('Extracting document...');
105
+ // Terminal states the product renders when extraction itself fails: the
106
+ // error toast (unstructured) and the empty state (structured). Both persist,
107
+ // so they can be probed once the in-progress indicator clears.
108
+ this.extractionFailureIndicator = page
109
+ .getByRole('alert')
110
+ .filter({ has: page.getByText(/^(Error|Extraction failed)$/) })
111
+ .or(page.getByRole('heading', {
112
+ name: 'Extraction could not be completed',
113
+ }));
104
114
  this.structured_uploadFilesButton = page
105
115
  .getByRole('button', {
106
116
  name: /Drag and drop.*PDF.*upload/i,
@@ -141,6 +151,22 @@ class IdpCreatePage {
141
151
  page.getByText('Template published');
142
152
  this.providerDropdown = page.getByRole('combobox', { name: 'Provider' });
143
153
  }
154
+ /**
155
+ * Surfaces a product-side extraction failure as the test error instead of
156
+ * letting the next assertion block for its full timeout and report only
157
+ * "locator timed out" — the on-screen error carries the actual cause.
158
+ */
159
+ async assertNoExtractionFailure(step) {
160
+ const failure = this.extractionFailureIndicator.first();
161
+ const failed = await failure.isVisible().catch(() => false);
162
+ if (!failed) {
163
+ return;
164
+ }
165
+ const detail = (await failure.innerText().catch(() => ''))
166
+ .replace(/\s+/g, ' ')
167
+ .trim();
168
+ throw new Error(`${step} failed in the product: ${detail}`);
169
+ }
144
170
  async clickCreateIdpTemplateButton() {
145
171
  await this.createIdpTemplateButton.click({ timeout: 60000 });
146
172
  }
@@ -192,12 +218,19 @@ class IdpCreatePage {
192
218
  await (0, test_1.expect)(this.page.getByText('Extracting..')).not.toBeVisible({
193
219
  timeout: 300000,
194
220
  });
221
+ await this.assertNoExtractionFailure('Document extraction');
195
222
  await (0, test_1.expect)(this.unstructured_saveAsTestCaseButton).toBeVisible({
196
223
  timeout: 300000,
197
224
  });
198
- await (0, test_1.expect)(this.unstructured_saveAsTestCaseButton).toBeEnabled({
199
- timeout: 300000,
200
- });
225
+ try {
226
+ await (0, test_1.expect)(this.unstructured_saveAsTestCaseButton).toBeEnabled({
227
+ timeout: 300000,
228
+ });
229
+ }
230
+ catch (error) {
231
+ await this.assertNoExtractionFailure('Document extraction');
232
+ throw error;
233
+ }
201
234
  }
202
235
  async clickSaveAsTestCaseButton() {
203
236
  await this.unstructured_saveAsTestCaseButton.click({ timeout: 60000 });
@@ -271,9 +304,16 @@ class IdpCreatePage {
271
304
  await (0, test_1.expect)(this.extractionInProgressNotification).not.toBeVisible({
272
305
  timeout: 300000,
273
306
  });
274
- await (0, test_1.expect)(this.structured_FieldsTab).toBeVisible({
275
- timeout: 300000,
276
- });
307
+ await this.assertNoExtractionFailure('Structured form extraction');
308
+ try {
309
+ await (0, test_1.expect)(this.structured_FieldsTab).toBeVisible({
310
+ timeout: 300000,
311
+ });
312
+ }
313
+ catch (error) {
314
+ await this.assertNoExtractionFailure('Structured form extraction');
315
+ throw error;
316
+ }
277
317
  await (0, test_1.expect)(this.structured_CheckboxSelectAllFields).toBeVisible({
278
318
  timeout: 60000,
279
319
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.932",
3
+ "version": "0.0.933",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",