@camunda/e2e-test-suite 0.0.347 → 0.0.349

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.
@@ -3,8 +3,11 @@ declare class IdpCreatePage {
3
3
  private page;
4
4
  readonly createNewDropdownButton: Locator;
5
5
  readonly createExtractionTemplateOption: Locator;
6
+ readonly createClassificationTemplateOption: Locator;
6
7
  readonly idpExtractionTemplateName: Locator;
7
- readonly idpDescriptionField: Locator;
8
+ readonly idpClassificationTemplateName: Locator;
9
+ readonly idpExtractionDescriptionField: Locator;
10
+ readonly idpClassificationDescriptionField: Locator;
8
11
  readonly providerDropdown: Locator;
9
12
  readonly createIdpExtractationTemplateButton: Locator;
10
13
  readonly unstructured_UploadFilesButton: Locator;
@@ -43,10 +46,26 @@ declare class IdpCreatePage {
43
46
  readonly structured_PublishTemplateButton: Locator;
44
47
  readonly structured_PublishTemplateToProjectButton: Locator;
45
48
  readonly structured_SuccessfullPublishNotification: Locator;
49
+ readonly idpClassificationAddDocumentTypeButton: Locator;
50
+ readonly idpClassificationInvoiceTypeOption: Locator;
51
+ readonly idpClassificationBankStatementTypeOption: Locator;
52
+ readonly addDocumentsTypesButton: Locator;
53
+ readonly classificationUploadFilesButton: Locator;
54
+ readonly selectDocumentDropdown: Locator;
55
+ readonly selectFilesButton: Locator;
56
+ readonly classificationRunTestButton: Locator;
57
+ readonly classificationTestResultsPanel: Locator;
58
+ readonly classificationModelName: Locator;
59
+ readonly classificationAccuracyValue: Locator;
60
+ readonly classifyingLoader: Locator;
61
+ readonly classificationSuccessfullPublishNotification: Locator;
46
62
  constructor(page: Page);
47
63
  clickCreateIdpTemplateButton(): Promise<void>;
48
64
  fillIdpExtractionTemplateName(name: string): Promise<void>;
65
+ clickCreateIdpClassificationTemplateButton(): Promise<void>;
66
+ fillIdpClassificationTemplateName(name: string): Promise<void>;
49
67
  clickCreateIdpExtractationTemplateButton(): Promise<void>;
68
+ clickCreateTemplateButton(): Promise<void>;
50
69
  clickUnstructuredUploadFilesButton(): Promise<void>;
51
70
  clickExtractButton(): Promise<void>;
52
71
  fillExtractFieldName(name: string): Promise<void>;
@@ -77,7 +96,23 @@ declare class IdpCreatePage {
77
96
  clickPublishTemplateButton(): Promise<void>;
78
97
  clickPublishTemplateToProjectButton(): Promise<void>;
79
98
  assertStructuredTemplateSuccessNotification(): Promise<void>;
80
- fillIdpDescriptionField(description: string): Promise<void>;
99
+ fillIdpExtractionDescriptionField(description: string): Promise<void>;
100
+ fillIdpClassificationDescriptionField(description: string): Promise<void>;
101
+ clickAddDocumentTypeButton(): Promise<void>;
102
+ clickInvoiceTypeOption(): Promise<void>;
103
+ clickBankStatementTypeOption(): Promise<void>;
104
+ clickAddTypesButton(): Promise<void>;
105
+ clickClassificationUploadFilesButton(): Promise<void>;
106
+ clickSelectDocumentDropdown(): Promise<void>;
107
+ selectDocumentTypeOption(documentType: string): Promise<void>;
108
+ clickSelectFilesButton(): Promise<void>;
109
+ clickClassificationRunTestButton(): Promise<void>;
110
+ assertClassificationTestResultsArePresent(): Promise<void>;
111
+ assertClassificationModelName(expectedModel: string): Promise<void>;
112
+ assertClassificationAccuracy(expectedAccuracy: string): Promise<void>;
113
+ assertClassificationAccuracyIsPresent(): Promise<void>;
114
+ classifyingProgressIsComplete(): Promise<void>;
115
+ assertClassificationTemplateSuccessNotification(): Promise<void>;
81
116
  selectProvider(provider: string): Promise<void>;
82
117
  }
83
118
  export { IdpCreatePage };
@@ -7,8 +7,11 @@ class IdpCreatePage {
7
7
  page;
8
8
  createNewDropdownButton;
9
9
  createExtractionTemplateOption;
10
+ createClassificationTemplateOption;
10
11
  idpExtractionTemplateName;
11
- idpDescriptionField;
12
+ idpClassificationTemplateName;
13
+ idpExtractionDescriptionField;
14
+ idpClassificationDescriptionField;
12
15
  providerDropdown;
13
16
  createIdpExtractationTemplateButton;
14
17
  unstructured_UploadFilesButton;
@@ -47,12 +50,32 @@ class IdpCreatePage {
47
50
  structured_PublishTemplateButton;
48
51
  structured_PublishTemplateToProjectButton;
49
52
  structured_SuccessfullPublishNotification;
53
+ idpClassificationAddDocumentTypeButton;
54
+ idpClassificationInvoiceTypeOption;
55
+ idpClassificationBankStatementTypeOption;
56
+ addDocumentsTypesButton;
57
+ classificationUploadFilesButton;
58
+ selectDocumentDropdown;
59
+ selectFilesButton;
60
+ classificationRunTestButton;
61
+ classificationTestResultsPanel;
62
+ classificationModelName;
63
+ classificationAccuracyValue;
64
+ classifyingLoader;
65
+ classificationSuccessfullPublishNotification;
50
66
  constructor(page) {
51
67
  this.page = page;
52
68
  this.createNewDropdownButton = page.locator('[data-test="idp-create-template-dropdown"]');
53
69
  this.createExtractionTemplateOption = page.locator('[data-test="create-extraction-template"]');
70
+ this.createClassificationTemplateOption = page.locator('[data-test="create-classification-template"]');
54
71
  this.idpExtractionTemplateName = page.locator('#idp-project-name');
55
- this.idpDescriptionField = page.getByLabel('Description');
72
+ this.idpClassificationTemplateName = page.locator('#idp-classification-template-name');
73
+ this.idpExtractionDescriptionField = page
74
+ .getByRole('region', { name: 'Create extraction template' })
75
+ .locator('#idp-project-description');
76
+ this.idpClassificationDescriptionField = page
77
+ .getByRole('region', { name: 'Create classification template' })
78
+ .locator('#idp-project-description');
56
79
  this.createIdpExtractationTemplateButton = page.getByRole('button', {
57
80
  name: 'Create template',
58
81
  exact: true,
@@ -141,6 +164,37 @@ class IdpCreatePage {
141
164
  this.structured_SuccessfullPublishNotification =
142
165
  page.getByText('Template published');
143
166
  this.providerDropdown = page.getByRole('combobox', { name: 'Provider' });
167
+ this.idpClassificationAddDocumentTypeButton = page.locator('[data-test="add-document-type-empty"]');
168
+ this.idpClassificationInvoiceTypeOption = page.getByRole('button', {
169
+ name: 'Invoice Business invoices and',
170
+ });
171
+ this.idpClassificationBankStatementTypeOption = page.getByRole('button', {
172
+ name: 'Bank Statement Financial',
173
+ });
174
+ this.addDocumentsTypesButton = page.getByRole('button', {
175
+ name: 'Add types',
176
+ });
177
+ this.classificationUploadFilesButton = page.getByRole('button', {
178
+ name: 'Upload files',
179
+ });
180
+ this.selectDocumentDropdown = page.locator('#document-type-dropdown');
181
+ this.selectFilesButton = page.getByRole('button', { name: 'Select files' });
182
+ this.classificationRunTestButton = page.getByRole('button', {
183
+ name: 'Run Test',
184
+ });
185
+ this.classificationTestResultsPanel = page.locator('[data-test="test-template-tab-panel"]');
186
+ this.classifyingLoader = page.getByText('Classifying...');
187
+ this.classificationSuccessfullPublishNotification = page
188
+ .getByRole('alert')
189
+ .filter({ hasText: 'IDP project published successfully.' });
190
+ const modelResultsRegion = this.classificationTestResultsPanel.getByRole('region', { name: 'Model results' });
191
+ this.classificationModelName = modelResultsRegion
192
+ .locator('.cds--tile span[title]')
193
+ .first();
194
+ this.classificationAccuracyValue = modelResultsRegion
195
+ .locator('.cds--tile')
196
+ .first()
197
+ .locator('span:has-text("Accuracy") + span');
144
198
  }
145
199
  async clickCreateIdpTemplateButton() {
146
200
  await this.createNewDropdownButton.click({ timeout: 60000 });
@@ -152,7 +206,20 @@ class IdpCreatePage {
152
206
  async fillIdpExtractionTemplateName(name) {
153
207
  await this.idpExtractionTemplateName.fill(name);
154
208
  }
209
+ async clickCreateIdpClassificationTemplateButton() {
210
+ await this.createNewDropdownButton.click({ timeout: 60000 });
211
+ await (0, test_1.expect)(this.createClassificationTemplateOption).toBeVisible({
212
+ timeout: 10000,
213
+ });
214
+ await this.createClassificationTemplateOption.click({ timeout: 60000 });
215
+ }
216
+ async fillIdpClassificationTemplateName(name) {
217
+ await this.idpClassificationTemplateName.fill(name);
218
+ }
155
219
  async clickCreateIdpExtractationTemplateButton() {
220
+ await this.clickCreateTemplateButton();
221
+ }
222
+ async clickCreateTemplateButton() {
156
223
  await this.createIdpExtractationTemplateButton.click({
157
224
  timeout: 60000,
158
225
  });
@@ -357,8 +424,76 @@ class IdpCreatePage {
357
424
  timeout: 120000,
358
425
  });
359
426
  }
360
- async fillIdpDescriptionField(description) {
361
- await this.idpDescriptionField.fill(description);
427
+ async fillIdpExtractionDescriptionField(description) {
428
+ await this.idpExtractionDescriptionField.fill(description);
429
+ }
430
+ async fillIdpClassificationDescriptionField(description) {
431
+ await this.idpClassificationDescriptionField.fill(description);
432
+ }
433
+ async clickAddDocumentTypeButton() {
434
+ await (0, test_1.expect)(this.idpClassificationAddDocumentTypeButton).toBeVisible();
435
+ await this.idpClassificationAddDocumentTypeButton.click();
436
+ }
437
+ async clickInvoiceTypeOption() {
438
+ await (0, test_1.expect)(this.idpClassificationInvoiceTypeOption).toBeVisible();
439
+ await this.idpClassificationInvoiceTypeOption.click();
440
+ }
441
+ async clickBankStatementTypeOption() {
442
+ await (0, test_1.expect)(this.idpClassificationBankStatementTypeOption).toBeVisible();
443
+ await this.idpClassificationBankStatementTypeOption.click();
444
+ }
445
+ async clickAddTypesButton() {
446
+ await (0, test_1.expect)(this.addDocumentsTypesButton).toBeVisible();
447
+ await this.addDocumentsTypesButton.click();
448
+ }
449
+ async clickClassificationUploadFilesButton() {
450
+ await (0, test_1.expect)(this.classificationUploadFilesButton).toBeVisible({
451
+ timeout: 60000,
452
+ });
453
+ await this.classificationUploadFilesButton.click();
454
+ await (0, test_1.expect)(this.selectDocumentDropdown).toBeVisible({ timeout: 30000 });
455
+ }
456
+ async clickSelectDocumentDropdown() {
457
+ await (0, test_1.expect)(this.selectDocumentDropdown).toBeVisible();
458
+ await this.selectDocumentDropdown.click();
459
+ }
460
+ async selectDocumentTypeOption(documentType) {
461
+ const option = this.page
462
+ .locator('[data-test="test-template-tab-panel"]')
463
+ .getByText(new RegExp(`^${documentType}$`));
464
+ await (0, test_1.expect)(option).toBeVisible();
465
+ await option.click();
466
+ }
467
+ async clickSelectFilesButton() {
468
+ await (0, test_1.expect)(this.selectFilesButton).toBeVisible();
469
+ await this.selectFilesButton.click();
470
+ }
471
+ async clickClassificationRunTestButton() {
472
+ await (0, test_1.expect)(this.classificationRunTestButton).toBeEnabled();
473
+ await this.classificationRunTestButton.click();
474
+ }
475
+ async assertClassificationTestResultsArePresent() {
476
+ await (0, test_1.expect)(this.classificationTestResultsPanel).toBeVisible();
477
+ }
478
+ async assertClassificationModelName(expectedModel) {
479
+ await (0, test_1.expect)(this.classificationModelName).toBeVisible();
480
+ await (0, test_1.expect)(this.classificationModelName).toHaveText(expectedModel);
481
+ }
482
+ async assertClassificationAccuracy(expectedAccuracy) {
483
+ await (0, test_1.expect)(this.classificationAccuracyValue).toBeVisible();
484
+ await (0, test_1.expect)(this.classificationAccuracyValue).toHaveText(expectedAccuracy);
485
+ }
486
+ async assertClassificationAccuracyIsPresent() {
487
+ await (0, test_1.expect)(this.classificationAccuracyValue).toBeVisible({
488
+ timeout: 60000,
489
+ });
490
+ await (0, test_1.expect)(this.classificationAccuracyValue).toHaveText(/^\d+%$/);
491
+ }
492
+ async classifyingProgressIsComplete() {
493
+ await (0, test_1.expect)(this.classifyingLoader).not.toBeVisible({ timeout: 300000 });
494
+ }
495
+ async assertClassificationTemplateSuccessNotification() {
496
+ await (0, test_1.expect)(this.classificationSuccessfullPublishNotification).toBeVisible({ timeout: 120000 });
362
497
  }
363
498
  async selectProvider(provider) {
364
499
  await (0, test_1.expect)(async () => {
@@ -45,8 +45,8 @@ class OperateHomePage {
45
45
  throw new Error(`Failed to click the processes tab after ${maxRetries} attempts.`);
46
46
  }
47
47
  async clickEditVariableButton(variableName) {
48
- const editVariableButton = 'Edit variable ' + variableName;
49
- await this.page.getByLabel(editVariableButton).click();
48
+ const editVariableButton = 'variable-' + variableName;
49
+ await this.page.getByTestId(editVariableButton).getByLabel('Edit').click();
50
50
  }
51
51
  async clickVariableValueInput() {
52
52
  await this.variableValueInput.click();
@@ -50,6 +50,13 @@ const structuredTestCases = [
50
50
  ],
51
51
  },
52
52
  ]; /* For structured documents, the model is empty since is not necessary */
53
+ const classificationTestCases = [
54
+ {
55
+ provider: 'AWS',
56
+ model: 'Claude Sonnet 4',
57
+ uploadFiles: ['idp/idp_sample_bank_statement.pdf'],
58
+ },
59
+ ];
53
60
  _8_9_1.test.describe.configure({ mode: 'parallel' });
54
61
  _8_9_1.test.describe('IDP User Flow Tests', () => {
55
62
  const clusterName = 'Test Cluster';
@@ -96,7 +103,7 @@ _8_9_1.test.describe('IDP User Flow Tests', () => {
96
103
  await modelerHomePage.clickCreateIdpApplicationButton();
97
104
  await idpCreatePage.clickCreateIdpTemplateButton();
98
105
  await idpCreatePage.fillIdpExtractionTemplateName(`${idpDocumentExtractionTemplateName}`);
99
- await idpCreatePage.fillIdpDescriptionField(`${idpDocumentExtractionTemplateName} description`);
106
+ await idpCreatePage.fillIdpExtractionDescriptionField(`${idpDocumentExtractionTemplateName} description`);
100
107
  await idpCreatePage.selectProvider(params.provider);
101
108
  await idpCreatePage.clickCreateIdpExtractationTemplateButton();
102
109
  });
@@ -169,7 +176,7 @@ _8_9_1.test.describe('IDP User Flow Tests', () => {
169
176
  await idpCreatePage.clickCreateIdpTemplateButton();
170
177
  await idpCreatePage.selectStructuredDataExtractionMethod();
171
178
  await idpCreatePage.fillIdpExtractionTemplateName(`${idpDocumentExtractionTemplateName}`);
172
- await idpCreatePage.fillIdpDescriptionField(`${idpDocumentExtractionTemplateName} - description`);
179
+ await idpCreatePage.fillIdpExtractionDescriptionField(`${idpDocumentExtractionTemplateName} - description`);
173
180
  await idpCreatePage.selectProvider(params.provider);
174
181
  await idpCreatePage.clickCreateIdpExtractationTemplateButton();
175
182
  });
@@ -211,4 +218,81 @@ _8_9_1.test.describe('IDP User Flow Tests', () => {
211
218
  });
212
219
  }
213
220
  });
221
+ _8_9_1.test.describe('Classification Template', () => {
222
+ for (const params of classificationTestCases) {
223
+ (0, _8_9_1.test)(`${params.provider} classification - User creates an idp application with a classification template`, async ({ page, idpCreatePage, modelerHomePage, homePage, appsPage, clusterPage, clusterSecretsPage, }) => {
224
+ _8_9_1.test.slow();
225
+ const idpApplicationName = await (0, randomName_1.randomNameAgregator)(`${params.provider} classification` + ' - IDP_Application_Name');
226
+ const idpClassificationTemplateName = await (0, randomName_1.randomNameAgregator)(`${params.provider} classification` +
227
+ ' - IDP_Classification_Template_Name');
228
+ await _8_9_1.test.step('Navigate to Connectors Secrets', async () => {
229
+ await homePage.clickClusters();
230
+ await clusterPage.clickClusterLink(clusterName);
231
+ await clusterPage.clickConnectorSecretsTab(clusterName);
232
+ await clusterSecretsPage.assertSecretsOrCreate(clusterName, connectorSecrets_1.allConnectorSecrets[params.provider]);
233
+ });
234
+ await _8_9_1.test.step('Navigate to Web Modeler', async () => {
235
+ await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
236
+ timeout: 120000,
237
+ });
238
+ await appsPage.clickCamundaApps();
239
+ await appsPage.clickModeler();
240
+ await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
241
+ timeout: 120000,
242
+ });
243
+ });
244
+ await _8_9_1.test.step('Navigate to Cross Component Test Project', async () => {
245
+ await modelerHomePage.clickMessageBanner();
246
+ await modelerHomePage.clickCrossComponentProjectFolder();
247
+ });
248
+ await _8_9_1.test.step('Add an IDP application to the project', async () => {
249
+ await modelerHomePage.clickDiagramTypeDropdown();
250
+ await modelerHomePage.clickIdpApplicationTemplateOption();
251
+ });
252
+ await _8_9_1.test.step('Creates a classification template', async () => {
253
+ await modelerHomePage.enterIdpApplicationName(idpApplicationName);
254
+ await modelerHomePage.selectCluster(clusterName);
255
+ await modelerHomePage.clickCreateIdpApplicationButton();
256
+ await idpCreatePage.clickCreateIdpClassificationTemplateButton();
257
+ await idpCreatePage.fillIdpClassificationTemplateName(`${idpClassificationTemplateName}`);
258
+ await idpCreatePage.fillIdpClassificationDescriptionField(`${idpClassificationTemplateName} - description`);
259
+ await idpCreatePage.selectProvider(params.provider);
260
+ await idpCreatePage.clickCreateTemplateButton();
261
+ });
262
+ await _8_9_1.test.step('Add two predefined document types', async () => {
263
+ await idpCreatePage.clickAddDocumentTypeButton();
264
+ await idpCreatePage.clickInvoiceTypeOption();
265
+ await idpCreatePage.clickBankStatementTypeOption();
266
+ await idpCreatePage.clickAddTypesButton();
267
+ });
268
+ await _8_9_1.test.step('Click on the Test Template tab', async () => {
269
+ await idpCreatePage.clickTestTemplateTab();
270
+ });
271
+ await _8_9_1.test.step('Upload a file for classification', async () => {
272
+ await idpCreatePage.clickClassificationUploadFilesButton();
273
+ await idpCreatePage.clickSelectDocumentDropdown();
274
+ await idpCreatePage.selectDocumentTypeOption('Bank Statement');
275
+ await idpCreatePage.clickSelectFilesButton();
276
+ await (0, fileUpload_1.uploadFile)(page, params.uploadFiles);
277
+ });
278
+ await _8_9_1.test.step('Test the classification', async () => {
279
+ await idpCreatePage.clickClassificationRunTestButton();
280
+ await idpCreatePage.classifyingProgressIsComplete();
281
+ });
282
+ await _8_9_1.test.step('Validate classification results', async () => {
283
+ await idpCreatePage.assertClassificationTestResultsArePresent();
284
+ await idpCreatePage.assertClassificationModelName(params.model);
285
+ await idpCreatePage.assertClassificationAccuracyIsPresent();
286
+ });
287
+ await _8_9_1.test.step('Publish the IDP classification template to project', async () => {
288
+ await idpCreatePage.clickPublishTemplateButton();
289
+ await idpCreatePage.clickPublishToProjecOption();
290
+ await idpCreatePage.fillVersionFieldName(idpApplicationName);
291
+ await idpCreatePage.fillVersionFieldDescription(idpApplicationName);
292
+ await idpCreatePage.clickPublishTemplateToProjectButton();
293
+ await idpCreatePage.assertClassificationTemplateSuccessNotification();
294
+ });
295
+ });
296
+ }
297
+ });
214
298
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.347",
3
+ "version": "0.0.349",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",