@camunda/e2e-test-suite 0.0.1549 → 0.0.1550

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.
@@ -67,12 +67,21 @@ class IdpCreatePage {
67
67
  constructor(page) {
68
68
  this.page = page;
69
69
  this.createNewDropdownButton = page.locator('[data-test="idp-create-template-dropdown"]');
70
- this.createExtractionTemplateOption = page.locator('[data-test="create-extraction-template"]');
70
+ // A project with no templates yet shows an empty state whose CTA is a
71
+ // plain button instead of the create menu, so accept either entry point.
72
+ this.createExtractionTemplateOption = page
73
+ .locator('[data-test="create-extraction-template"]')
74
+ .or(page.getByRole('button', {
75
+ name: 'Create extraction template',
76
+ exact: true,
77
+ }))
78
+ .first();
71
79
  this.createClassificationTemplateOption = page.locator('[data-test="create-classification-template"]');
72
80
  this.idpExtractionTemplateName = page.locator('#idp-project-name');
73
81
  this.idpClassificationTemplateName = page.locator('#idp-classification-template-name');
74
82
  this.idpExtractionDescriptionField = page
75
- .getByRole('region', { name: 'Create extraction template' })
83
+ .getByRole('dialog', { name: 'Create extraction template' })
84
+ .or(page.getByRole('region', { name: 'Create extraction template' }))
76
85
  .locator('#idp-project-description');
77
86
  // Hub now renders "Create classification template" as a design-system
78
87
  // dialog (role="dialog", data-slot="dialog-content") rather than a
@@ -86,8 +95,8 @@ class IdpCreatePage {
86
95
  name: 'Create template',
87
96
  exact: true,
88
97
  });
89
- this.unstructured_UploadFilesButton = page.getByRole('button', {
90
- name: 'Drag and drop PDF files here',
98
+ this.unstructured_UploadFilesButton = page.getByRole('region', {
99
+ name: /Drag and drop.*PDF.*upload/i,
91
100
  });
92
101
  this.extractButton = page.getByRole('button', {
93
102
  name: 'Extract',
@@ -96,7 +105,7 @@ class IdpCreatePage {
96
105
  this.unstructured_extractFieldName = page.locator('#new-extraction-field-name');
97
106
  this.unstructured_extractFieldPrompt = page.locator('#new-extraction-field-prompt');
98
107
  this.unstructured_addExtractionFieldButton = page.getByRole('button', {
99
- name: 'Add',
108
+ name: 'Add field',
100
109
  exact: true,
101
110
  });
102
111
  this.unstructured_extractionModelDropdown =
@@ -110,8 +119,13 @@ class IdpCreatePage {
110
119
  this.unstructured_validateExtractionTab = page.getByRole('tab', {
111
120
  name: 'Validate extraction',
112
121
  });
113
- this.unstructured_testCaseSavedNotification = page.getByText('NotificationTest case');
114
- this.unstructured_expandAllRowsButton = page.getByLabel('Expand all rows');
122
+ this.unstructured_testCaseSavedNotification = page.getByText('Test case successfully saved');
123
+ this.unstructured_expandAllRowsButton = page
124
+ .getByRole('row')
125
+ .filter({ hasText: 'bank_account_number' })
126
+ .getByRole('button')
127
+ .first()
128
+ .or(page.getByLabel('Expand all rows'));
115
129
  this.unstructured_passTestCaseResultsRows = page.locator('[data-test="pass-test-case-results"]');
116
130
  this.unstructured_publishButton = page.getByRole('button', {
117
131
  name: 'Publish',
@@ -126,12 +140,25 @@ class IdpCreatePage {
126
140
  this.unstructured_publishButtonModal = page
127
141
  .getByLabel('Publish Extraction Project')
128
142
  .getByRole('button', { name: 'Publish' });
129
- this.unstructured_idpSuccessfullPublishNotification = page.getByText('NotificationSuccessIDP');
130
- this.unstructured_toastNotificationCloseButton =
131
- page.getByLabel('Close notification');
143
+ this.unstructured_idpSuccessfullPublishNotification = page.getByText('IDP project published successfully.');
144
+ this.unstructured_toastNotificationCloseButton = page
145
+ .locator('[data-sonner-toast]')
146
+ .getByRole('button', { name: 'Dismiss' })
147
+ .or(page.getByLabel('Close notification'))
148
+ .first();
132
149
  this.selectUnstructuredDataExtraction = page.locator('#idp-project-extraction-method-unstructured');
133
- this.selectStructuredDataExtraction = page.locator('#idp-project-extraction-method-structured');
134
- this.selectStructuredDataExtractionLabel = page.locator('label[for="idp-project-extraction-method-structured"]');
150
+ // The design-system radio tile exposes a `radio` named after its title and
151
+ // description and renders no `label[for]`, so match on the role and keep the
152
+ // id/label lookups for the Carbon variant.
153
+ this.selectStructuredDataExtraction = page
154
+ .getByRole('radio', { name: /^Structured form extraction/ })
155
+ .or(page.locator('#idp-project-extraction-method-structured'))
156
+ .first();
157
+ this.selectStructuredDataExtractionLabel = page
158
+ .getByRole('radiogroup')
159
+ .getByText('Structured form extraction')
160
+ .or(page.locator('label[for="idp-project-extraction-method-structured"]'))
161
+ .first();
135
162
  this.extractionInProgressNotification = page.getByText('Extracting document...');
136
163
  // Structured extraction cycles through several progress messages before it
137
164
  // finishes: "Extracting document..." (single file, Configure template),
@@ -141,9 +168,7 @@ class IdpCreatePage {
141
168
  // the end-state element.
142
169
  this.structured_ExtractionInProgress = page.getByText(/Extracting documents?\.\.\.|Just a little bit more\.\.\./);
143
170
  this.structured_uploadFilesButton = page
144
- .getByRole('button', {
145
- name: /Drag and drop.*PDF.*upload/i,
146
- })
171
+ .getByRole('region', { name: /Drag and drop.*PDF.*upload/i })
147
172
  .first();
148
173
  this.structured_FieldsTab = page.getByRole('tab', {
149
174
  name: /fields/i,
@@ -154,12 +179,19 @@ class IdpCreatePage {
154
179
  this.structured_TestTemplateTab = page.getByRole('tab', {
155
180
  name: 'Test template',
156
181
  });
157
- this.structured_CheckboxSelectAllFields = page.getByRole('columnheader', {
158
- name: 'Activate all rows',
159
- });
160
- this.structured_CheckboxSelectAllTables =
161
- page.getByText('Select all tables');
162
- this.structured_SelectedFieldsTablesMessage = page.getByText(/^\s*\d+\s+fields\s*&\s*\d+\s+table(?:s)?\s+selected$/);
182
+ // The design-system table puts `aria-label="Activate all rows"` on the
183
+ // header checkbox itself, so the column header no longer carries that name.
184
+ this.structured_CheckboxSelectAllFields = page
185
+ .getByRole('checkbox', { name: 'Activate all rows' })
186
+ .or(page
187
+ .getByRole('table', { name: 'Extracted fields' })
188
+ .getByRole('columnheader')
189
+ .getByRole('checkbox'))
190
+ .first();
191
+ this.structured_CheckboxSelectAllTables = page
192
+ .getByText('Select all tables')
193
+ .first();
194
+ this.structured_SelectedFieldsTablesMessage = page.getByText(/^\s*\d+\s+fields?\s*&\s*\d+\s+tables?\s+selected$/);
163
195
  this.structured_TestExtractionTemplateButton = page.getByRole('button', {
164
196
  name: 'Test extraction template',
165
197
  });
@@ -178,7 +210,14 @@ class IdpCreatePage {
178
210
  });
179
211
  this.structured_SuccessfullPublishNotification =
180
212
  page.getByText('Template published');
181
- this.providerDropdown = page.getByRole('combobox', { name: 'Provider' });
213
+ // The design-system `SelectTrigger` the IDP dialogs now render carries
214
+ // `aria-labelledby` pointing at a `Label` that emits no matching `id`, so
215
+ // the trigger exposes no accessible name and a role+name query matches
216
+ // nothing. Target the trigger ids the dialogs set, keeping the role+name
217
+ // match for the Carbon variant.
218
+ this.providerDropdown = page
219
+ .locator('#idp-classification-project-provider-select, #idp-extraction-project-provider-select')
220
+ .or(page.getByRole('combobox', { name: 'Provider' }));
182
221
  this.idpClassificationAddDocumentTypeButton = page.locator('[data-test="add-document-type-empty"]');
183
222
  this.idpClassificationInvoiceTypeOption = page.getByRole('button', {
184
223
  name: 'Invoice Business invoices and',
@@ -221,7 +260,10 @@ class IdpCreatePage {
221
260
  }
222
261
  async clickCreateIdpTemplateButton() {
223
262
  for (let attempt = 0; attempt < 3; attempt++) {
224
- await this.createNewDropdownButton.click({ timeout: 60000 });
263
+ await (0, test_1.expect)(this.createExtractionTemplateOption.or(this.createNewDropdownButton)).toBeVisible({ timeout: 60000 });
264
+ if (!(await this.createExtractionTemplateOption.isVisible())) {
265
+ await this.createNewDropdownButton.click({ timeout: 60000 });
266
+ }
225
267
  try {
226
268
  await (0, test_1.expect)(this.createExtractionTemplateOption).toBeVisible({
227
269
  timeout: 10000,
@@ -230,7 +272,7 @@ class IdpCreatePage {
230
272
  return;
231
273
  }
232
274
  catch {
233
- // menu detached or closed; retry
275
+ // menu did not open, or item detached before the click; retry
234
276
  }
235
277
  }
236
278
  throw new Error('Failed to click create extraction template option after 3 attempts');
@@ -266,8 +308,9 @@ class IdpCreatePage {
266
308
  });
267
309
  }
268
310
  async clickUnstructuredUploadFilesButton() {
269
- await this.unstructured_UploadFilesButton.click({ timeout: 60000 });
270
- await (0, sleep_1.sleep)(6000);
311
+ await (0, test_1.expect)(this.unstructured_UploadFilesButton).toBeVisible({
312
+ timeout: 60000,
313
+ });
271
314
  }
272
315
  async clickExtractButton() {
273
316
  await (0, test_1.expect)(this.extractButton).toBeEnabled({
@@ -287,15 +330,21 @@ class IdpCreatePage {
287
330
  }
288
331
  async selectExtractionModelOption(option) {
289
332
  const comboboxOption = this.page.getByRole('option', { name: option });
290
- if (await comboboxOption.isVisible()) {
291
- console.log(`Option ${option} is already visible, no need to click dropdown`);
292
- }
293
- else {
294
- await this.unstructured_extractionModelDropdown.click({
295
- timeout: 60000,
296
- });
297
- await comboboxOption.click({ timeout: 120000 });
333
+ for (let attempt = 0; attempt < 4; attempt++) {
334
+ if (!(await comboboxOption.isVisible())) {
335
+ await this.unstructured_extractionModelDropdown.click({
336
+ timeout: 60000,
337
+ });
338
+ }
339
+ try {
340
+ await comboboxOption.click({ timeout: 10000 });
341
+ return;
342
+ }
343
+ catch {
344
+ // list re-rendered and detached the option mid-click; reopen and retry
345
+ }
298
346
  }
347
+ throw new Error(`Failed to select extraction model ${option} after 4 attempts`);
299
348
  }
300
349
  async clickExtractDocumentButton() {
301
350
  await (0, test_1.expect)(this.unstructured_extractDocumentButton).toBeVisible({
@@ -391,8 +440,6 @@ class IdpCreatePage {
391
440
  await (0, test_1.expect)(this.structured_uploadFilesButton).toBeVisible({
392
441
  timeout: 60000,
393
442
  });
394
- await this.structured_uploadFilesButton.click({ timeout: 60000 });
395
- await (0, sleep_1.sleep)(6000);
396
443
  }
397
444
  // Blocks until the structured extraction really finished, instead of until
398
445
  // one particular progress message went away. The LLM-backed extraction takes
@@ -14,7 +14,7 @@ let idpDocumentExtractionTemplateName;
14
14
  const unstructuredTestCases = [
15
15
  {
16
16
  provider: 'AWS',
17
- model: 'Claude Sonnet 4',
17
+ model: 'Claude Sonnet 5.5',
18
18
  uploadFiles: ['idp/idp_sample_bank_statement.pdf'],
19
19
  },
20
20
  {
@@ -39,9 +39,11 @@ const structuredTestCases = [
39
39
  'idp/structured_invoice_3.pdf',
40
40
  ],
41
41
  },
42
+ // Skipped due to bug #9956: https://github.com/camunda/connectors/issues/9956
42
43
  {
43
44
  provider: 'GCP',
44
45
  model: '',
46
+ skipped: true,
45
47
  uploadFiles: ['idp/structured_invoice_test.pdf'],
46
48
  extractionFiles: [
47
49
  'idp/structured_invoice_1.pdf',
@@ -69,14 +71,7 @@ _8_9_1.test.describe('IDP User Flow Tests', () => {
69
71
  });
70
72
  _8_9_1.test.describe('Unstructured Extraction', () => {
71
73
  for (const params of unstructuredTestCases) {
72
- // Still fails after bug #8500 was fixed -- that bug was specifically
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). Hard-fails for AWS/Azure in
76
- // both chromium-v1 and chromium-v2 (PR #3350, run 34110011982); GCP
77
- // recovers on retry but shares the same root cause. Mis-attributed to
78
- // #8500 originally; needs its own bug filed before unskipping again.
79
- _8_9_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, }) => {
74
+ (0, _8_9_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, }) => {
80
75
  _8_9_1.test.slow();
81
76
  idpApplicationName = await (0, randomName_1.randomNameAgregator)(`${params.provider} unstructured` + ' - IDP_Application_Name');
82
77
  idpDocumentExtractionTemplateName = await (0, randomName_1.randomNameAgregator)(`${params.provider} unstructured` + ' - IDP_Extraction_Template_Name');
@@ -151,11 +146,8 @@ _8_9_1.test.describe('IDP User Flow Tests', () => {
151
146
  });
152
147
  _8_9_1.test.describe('Structured Extraction', () => {
153
148
  for (const params of structuredTestCases) {
154
- // Same still-open issue as Unstructured Extraction above -- see that
155
- // comment. Hard-fails for both AWS and GCP in chromium-v1 (PR #3350,
156
- // run 34110011982); recovers on retry in chromium-v2 but shares the
157
- // same root cause. Not bug #8500.
158
- _8_9_1.test.skip(`${params.provider} structured - User creates an idp application with a document extraction template`, async ({ page, idpCreatePage, modelerHomePage, homePage, appsPage, clusterPage, clusterSecretsPage, }) => {
149
+ const structuredTest = params.skipped ? _8_9_1.test.skip : _8_9_1.test;
150
+ structuredTest(`${params.provider} structured - User creates an idp application with a document extraction template`, async ({ page, idpCreatePage, modelerHomePage, homePage, appsPage, clusterPage, clusterSecretsPage, }) => {
159
151
  _8_9_1.test.slow();
160
152
  idpApplicationName = await (0, randomName_1.randomNameAgregator)(`${params.provider} structured` + ' - IDP_Application_Name');
161
153
  idpDocumentExtractionTemplateName = await (0, randomName_1.randomNameAgregator)(`${params.provider} structured` + ' - IDP_Extraction_Template_Name');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1549",
3
+ "version": "0.0.1550",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",