@camunda/e2e-test-suite 0.0.136 → 0.0.138
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.
- package/dist/fixtures/SM-8.8.d.ts +2 -0
- package/dist/fixtures/SM-8.8.js +4 -0
- package/dist/pages/SM-8.8/IdpCreatePage.d.ts +83 -0
- package/dist/pages/SM-8.8/IdpCreatePage.js +352 -0
- package/dist/pages/SM-8.8/ModelerHomePage.d.ts +8 -0
- package/dist/pages/SM-8.8/ModelerHomePage.js +38 -0
- package/dist/tests/SM-8.8/idp-user-flows.spec.d.ts +1 -0
- package/dist/tests/SM-8.8/idp-user-flows.spec.js +153 -0
- package/package.json +1 -1
|
@@ -35,6 +35,7 @@ import { KeycloakLoginPage } from '../pages/SM-8.8/KeycloakLoginPage';
|
|
|
35
35
|
import { OCIdentityAuthorizationsPage } from '../pages/SM-8.8/OCIdentityAuthorizationsPage';
|
|
36
36
|
import { OCIdentityGroupsPage } from '../pages/SM-8.8/OCIdentityGroupsPage';
|
|
37
37
|
import { OCTenantPage } from '../pages/SM-8.8/OCTenantPage';
|
|
38
|
+
import { IdpCreatePage } from '../pages/SM-8.8/IdpCreatePage';
|
|
38
39
|
type PlaywrightFixtures = {
|
|
39
40
|
makeAxeBuilder: () => AxeBuilder;
|
|
40
41
|
loginPage: LoginPage;
|
|
@@ -73,6 +74,7 @@ type PlaywrightFixtures = {
|
|
|
73
74
|
connectorTemplatePage: ConnectorTemplatePage;
|
|
74
75
|
ocIdentityGroupsPage: OCIdentityGroupsPage;
|
|
75
76
|
ocTenantPage: OCTenantPage;
|
|
77
|
+
idpCreatePage: IdpCreatePage;
|
|
76
78
|
overrideTrackingScripts: void;
|
|
77
79
|
};
|
|
78
80
|
declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & PlaywrightFixtures, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
package/dist/fixtures/SM-8.8.js
CHANGED
|
@@ -42,6 +42,7 @@ const KeycloakLoginPage_1 = require("../pages/SM-8.8/KeycloakLoginPage");
|
|
|
42
42
|
const OCIdentityAuthorizationsPage_1 = require("../pages/SM-8.8/OCIdentityAuthorizationsPage");
|
|
43
43
|
const OCIdentityGroupsPage_1 = require("../pages/SM-8.8/OCIdentityGroupsPage");
|
|
44
44
|
const OCTenantPage_1 = require("../pages/SM-8.8/OCTenantPage");
|
|
45
|
+
const IdpCreatePage_1 = require("../pages/SM-8.8/IdpCreatePage");
|
|
45
46
|
const test = test_1.test.extend({
|
|
46
47
|
makeAxeBuilder: async ({ page }, use) => {
|
|
47
48
|
const makeAxeBuilder = () => new playwright_1.default({ page }).withTags([
|
|
@@ -161,6 +162,9 @@ const test = test_1.test.extend({
|
|
|
161
162
|
ocTenantPage: async ({ page }, use) => {
|
|
162
163
|
await use(new OCTenantPage_1.OCTenantPage(page));
|
|
163
164
|
},
|
|
165
|
+
idpCreatePage: async ({ page }, use) => {
|
|
166
|
+
await use(new IdpCreatePage_1.IdpCreatePage(page));
|
|
167
|
+
},
|
|
164
168
|
overrideTrackingScripts: [
|
|
165
169
|
async ({ context }, use) => {
|
|
166
170
|
await context.route('https://cmp.osano.com/16CVvwSNKHi9t1grQ/9403708a-488b-4f3b-aea6-613825dec79f/osano.js', (route) => route.fulfill({
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
declare class IdpCreatePage {
|
|
3
|
+
private page;
|
|
4
|
+
readonly createIdpTemplateButton: Locator;
|
|
5
|
+
readonly idpExtractionTemplateName: Locator;
|
|
6
|
+
readonly idpDescriptionField: Locator;
|
|
7
|
+
readonly providerDropdown: Locator;
|
|
8
|
+
readonly createIdpExtractionTemplateButton: Locator;
|
|
9
|
+
readonly unstructured_UploadFilesButton: Locator;
|
|
10
|
+
readonly extractButton: Locator;
|
|
11
|
+
readonly closeNotificationButton: Locator;
|
|
12
|
+
readonly unstructured_extractFieldName: Locator;
|
|
13
|
+
readonly unstructured_extractFieldPrompt: Locator;
|
|
14
|
+
readonly unstructured_addExtractionFieldButton: Locator;
|
|
15
|
+
readonly unstructured_extractionModelDropdown: Locator;
|
|
16
|
+
readonly unstructured_extractDocumentButton: Locator;
|
|
17
|
+
readonly unstructured_saveAsTestCaseButton: Locator;
|
|
18
|
+
readonly unstructured_testCaseSavedNotification: Locator;
|
|
19
|
+
readonly unstructured_validateExtractionTab: Locator;
|
|
20
|
+
readonly unstructured_expandAllRowsButton: Locator;
|
|
21
|
+
readonly unstructured_passTestCaseResultsRows: Locator;
|
|
22
|
+
readonly unstructured_publishButton: Locator;
|
|
23
|
+
readonly unstructured_publishToProjectOption: Locator;
|
|
24
|
+
readonly unstructured_versionFieldName: Locator;
|
|
25
|
+
readonly unstructured_versionFieldDescription: Locator;
|
|
26
|
+
readonly unstructured_publishButtonModal: Locator;
|
|
27
|
+
readonly unstructured_idpSuccessfulPublishNotification: Locator;
|
|
28
|
+
readonly selectUnstructuredDataExtraction: Locator;
|
|
29
|
+
readonly selectStructuredDataExtraction: Locator;
|
|
30
|
+
readonly extractionInProgressNotification: Locator;
|
|
31
|
+
readonly structured_FieldsTab: Locator;
|
|
32
|
+
readonly structured_TablesTab: Locator;
|
|
33
|
+
readonly structured_CheckboxSelectAllFields: Locator;
|
|
34
|
+
readonly structured_CheckboxSelectAllTables: Locator;
|
|
35
|
+
readonly structured_uploadFilesButton: Locator;
|
|
36
|
+
readonly structured_SelectedFieldsTablesMessage: Locator;
|
|
37
|
+
readonly structured_TestTemplateTab: Locator;
|
|
38
|
+
readonly structured_TestExtractionTemplateButton: Locator;
|
|
39
|
+
readonly structured_ExtractDocumentsLoader: Locator;
|
|
40
|
+
readonly structured_TestSummaryResult: Locator;
|
|
41
|
+
readonly structured_DetailsResult: Locator;
|
|
42
|
+
readonly structured_PublishTemplateButton: Locator;
|
|
43
|
+
readonly structured_PublishTemplateToProjectButton: Locator;
|
|
44
|
+
readonly structured_SuccessfulPublishNotification: Locator;
|
|
45
|
+
constructor(page: Page);
|
|
46
|
+
clickCreateIdpTemplateButton(): Promise<void>;
|
|
47
|
+
fillIdpExtractionTemplateName(name: string): Promise<void>;
|
|
48
|
+
clickCreateIdpExtractionTemplateButton(): Promise<void>;
|
|
49
|
+
clickUnstructuredUploadFilesButton(): Promise<void>;
|
|
50
|
+
clickExtractButton(): Promise<void>;
|
|
51
|
+
fillExtractFieldName(name: string): Promise<void>;
|
|
52
|
+
fillPromptField(): Promise<void>;
|
|
53
|
+
clickAddExtractionFieldButton(): Promise<void>;
|
|
54
|
+
selectExtractionModelOption(option: string): Promise<void>;
|
|
55
|
+
clickExtractDocumentButton(): Promise<void>;
|
|
56
|
+
clickSaveAsTestCaseButton(): Promise<void>;
|
|
57
|
+
clickValidateExtractionTab(): Promise<void>;
|
|
58
|
+
clickExpandAllRowsButton(): Promise<void>;
|
|
59
|
+
assertPassTestCaseResultsRow(retries?: number): Promise<void>;
|
|
60
|
+
clickPublishButton(): Promise<void>;
|
|
61
|
+
clickPublishToProjectOption(): Promise<void>;
|
|
62
|
+
fillVersionFieldName(name: string): Promise<void>;
|
|
63
|
+
fillVersionFieldDescription(description: string): Promise<void>;
|
|
64
|
+
clickPublishButtonModal(): Promise<void>;
|
|
65
|
+
assertIdpSuccessPublishNotification(): Promise<void>;
|
|
66
|
+
clickCloseToastNotification(): Promise<void>;
|
|
67
|
+
selectStructuredDataExtractionMethod(): Promise<void>;
|
|
68
|
+
clickStructuredUploadFilesButton(): Promise<void>;
|
|
69
|
+
assertMultipleFilesUploaded(): Promise<void>;
|
|
70
|
+
selectAllExtractionFields(): Promise<void>;
|
|
71
|
+
clickTablesTab(): Promise<void>;
|
|
72
|
+
selectAllExtractedTables(): Promise<void>;
|
|
73
|
+
assertFieldsAndTablesSelection(): Promise<void>;
|
|
74
|
+
clickTestTemplateTab(): Promise<void>;
|
|
75
|
+
clickTestExtractionTemplateButton(): Promise<void>;
|
|
76
|
+
extractionResultsAreVisible(): Promise<void>;
|
|
77
|
+
clickPublishTemplateButton(): Promise<void>;
|
|
78
|
+
clickPublishTemplateToProjectButton(): Promise<void>;
|
|
79
|
+
assertStructuredTemplateSuccessNotification(): Promise<void>;
|
|
80
|
+
fillIdpDescriptionField(description: string): Promise<void>;
|
|
81
|
+
selectProvider(provider: string): Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
export { IdpCreatePage };
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IdpCreatePage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const sleep_1 = require("../../utils/sleep");
|
|
6
|
+
class IdpCreatePage {
|
|
7
|
+
page;
|
|
8
|
+
createIdpTemplateButton;
|
|
9
|
+
idpExtractionTemplateName;
|
|
10
|
+
idpDescriptionField;
|
|
11
|
+
providerDropdown;
|
|
12
|
+
createIdpExtractionTemplateButton;
|
|
13
|
+
unstructured_UploadFilesButton;
|
|
14
|
+
extractButton;
|
|
15
|
+
closeNotificationButton;
|
|
16
|
+
unstructured_extractFieldName;
|
|
17
|
+
unstructured_extractFieldPrompt;
|
|
18
|
+
unstructured_addExtractionFieldButton;
|
|
19
|
+
unstructured_extractionModelDropdown;
|
|
20
|
+
unstructured_extractDocumentButton;
|
|
21
|
+
unstructured_saveAsTestCaseButton;
|
|
22
|
+
unstructured_testCaseSavedNotification;
|
|
23
|
+
unstructured_validateExtractionTab;
|
|
24
|
+
unstructured_expandAllRowsButton;
|
|
25
|
+
unstructured_passTestCaseResultsRows;
|
|
26
|
+
unstructured_publishButton;
|
|
27
|
+
unstructured_publishToProjectOption;
|
|
28
|
+
unstructured_versionFieldName;
|
|
29
|
+
unstructured_versionFieldDescription;
|
|
30
|
+
unstructured_publishButtonModal;
|
|
31
|
+
unstructured_idpSuccessfulPublishNotification;
|
|
32
|
+
selectUnstructuredDataExtraction;
|
|
33
|
+
selectStructuredDataExtraction;
|
|
34
|
+
extractionInProgressNotification;
|
|
35
|
+
structured_FieldsTab;
|
|
36
|
+
structured_TablesTab;
|
|
37
|
+
structured_CheckboxSelectAllFields;
|
|
38
|
+
structured_CheckboxSelectAllTables;
|
|
39
|
+
structured_uploadFilesButton;
|
|
40
|
+
structured_SelectedFieldsTablesMessage;
|
|
41
|
+
structured_TestTemplateTab;
|
|
42
|
+
structured_TestExtractionTemplateButton;
|
|
43
|
+
structured_ExtractDocumentsLoader;
|
|
44
|
+
structured_TestSummaryResult;
|
|
45
|
+
structured_DetailsResult;
|
|
46
|
+
structured_PublishTemplateButton;
|
|
47
|
+
structured_PublishTemplateToProjectButton;
|
|
48
|
+
structured_SuccessfulPublishNotification;
|
|
49
|
+
constructor(page) {
|
|
50
|
+
this.page = page;
|
|
51
|
+
this.createIdpTemplateButton = page.getByRole('button', {
|
|
52
|
+
name: 'Create extraction template',
|
|
53
|
+
exact: true,
|
|
54
|
+
});
|
|
55
|
+
this.idpExtractionTemplateName = page.getByLabel('Name');
|
|
56
|
+
this.idpDescriptionField = page.getByLabel('Description');
|
|
57
|
+
this.createIdpExtractionTemplateButton = page.getByRole('button', {
|
|
58
|
+
name: 'Create template',
|
|
59
|
+
exact: true,
|
|
60
|
+
});
|
|
61
|
+
this.unstructured_UploadFilesButton = page
|
|
62
|
+
.getByRole('button', {
|
|
63
|
+
name: 'Upload documents',
|
|
64
|
+
})
|
|
65
|
+
.first();
|
|
66
|
+
this.extractButton = page.getByRole('button', {
|
|
67
|
+
name: 'Extract',
|
|
68
|
+
exact: true,
|
|
69
|
+
});
|
|
70
|
+
this.unstructured_extractFieldName = page.locator('#new-extraction-field-name');
|
|
71
|
+
this.unstructured_extractFieldPrompt = page.locator('#new-extraction-field-prompt');
|
|
72
|
+
this.unstructured_addExtractionFieldButton = page.getByRole('button', {
|
|
73
|
+
name: 'Add',
|
|
74
|
+
exact: true,
|
|
75
|
+
});
|
|
76
|
+
this.unstructured_extractionModelDropdown =
|
|
77
|
+
page.locator('#extraction-model');
|
|
78
|
+
this.unstructured_extractDocumentButton = page.getByRole('button', {
|
|
79
|
+
name: 'Extract document',
|
|
80
|
+
});
|
|
81
|
+
this.unstructured_saveAsTestCaseButton = page.getByRole('button', {
|
|
82
|
+
name: 'Save as test case',
|
|
83
|
+
});
|
|
84
|
+
this.unstructured_validateExtractionTab = page.getByRole('tab', {
|
|
85
|
+
name: 'Validate extraction',
|
|
86
|
+
});
|
|
87
|
+
this.unstructured_testCaseSavedNotification = page.getByText('NotificationTest case');
|
|
88
|
+
this.unstructured_expandAllRowsButton = page.getByLabel('Expand all rows');
|
|
89
|
+
this.unstructured_passTestCaseResultsRows = page.locator('[data-test="pass-test-case-results"]');
|
|
90
|
+
this.unstructured_publishButton = page.getByRole('button', {
|
|
91
|
+
name: 'Publish',
|
|
92
|
+
});
|
|
93
|
+
this.unstructured_publishToProjectOption = page.getByRole('menuitem', {
|
|
94
|
+
name: 'Publish to project',
|
|
95
|
+
});
|
|
96
|
+
this.unstructured_versionFieldName = page.locator('#version-name');
|
|
97
|
+
this.unstructured_versionFieldDescription = page.locator('#version-description');
|
|
98
|
+
this.unstructured_publishButtonModal = page
|
|
99
|
+
.getByLabel('Publish Extraction Project')
|
|
100
|
+
.getByRole('button', { name: 'Publish' });
|
|
101
|
+
this.unstructured_idpSuccessfulPublishNotification = page.getByText('NotificationSuccessIDP');
|
|
102
|
+
this.selectUnstructuredDataExtraction = page.getByText('Unstructured data extraction');
|
|
103
|
+
this.selectStructuredDataExtraction = page.getByText('Structured form extraction');
|
|
104
|
+
this.extractionInProgressNotification = page.getByText('Extracting document...');
|
|
105
|
+
this.structured_uploadFilesButton = page
|
|
106
|
+
.getByRole('button', {
|
|
107
|
+
name: /Drag and drop.*PDF.*upload/i,
|
|
108
|
+
})
|
|
109
|
+
.first();
|
|
110
|
+
this.structured_FieldsTab = page.getByRole('tab', {
|
|
111
|
+
name: 'Fields',
|
|
112
|
+
});
|
|
113
|
+
this.structured_TablesTab = page.getByRole('tab', {
|
|
114
|
+
name: 'Tables',
|
|
115
|
+
});
|
|
116
|
+
this.structured_TestTemplateTab = page.getByRole('tab', {
|
|
117
|
+
name: 'Test template',
|
|
118
|
+
});
|
|
119
|
+
this.structured_CheckboxSelectAllFields = page.getByRole('columnheader', {
|
|
120
|
+
name: 'Activate all rows',
|
|
121
|
+
});
|
|
122
|
+
this.structured_CheckboxSelectAllTables =
|
|
123
|
+
page.getByText('Select all tables');
|
|
124
|
+
this.structured_SelectedFieldsTablesMessage = page.getByText(/^\s*\d+\s+fields\s*&\s*\d+\s+table(?:s)?\s+selected$/);
|
|
125
|
+
this.structured_TestExtractionTemplateButton = page.getByRole('button', {
|
|
126
|
+
name: 'Test extraction template',
|
|
127
|
+
});
|
|
128
|
+
this.structured_TestSummaryResult = page.getByRole('heading', {
|
|
129
|
+
name: 'Test Summary Results',
|
|
130
|
+
});
|
|
131
|
+
this.structured_DetailsResult = page.getByRole('heading', {
|
|
132
|
+
name: 'Detailed Results',
|
|
133
|
+
});
|
|
134
|
+
this.structured_PublishTemplateButton = page.getByRole('button', {
|
|
135
|
+
name: 'Publish Template',
|
|
136
|
+
});
|
|
137
|
+
this.structured_PublishTemplateToProjectButton = page.getByRole('button', {
|
|
138
|
+
name: 'Publish',
|
|
139
|
+
exact: true,
|
|
140
|
+
});
|
|
141
|
+
this.structured_SuccessfulPublishNotification =
|
|
142
|
+
page.getByText('Template published');
|
|
143
|
+
this.providerDropdown = page.getByRole('combobox', { name: 'Provider' });
|
|
144
|
+
this.structured_ExtractDocumentsLoader = page.getByText('Extracting documents...');
|
|
145
|
+
this.closeNotificationButton = page
|
|
146
|
+
.getByLabel('Close notification')
|
|
147
|
+
.first();
|
|
148
|
+
}
|
|
149
|
+
async clickCreateIdpTemplateButton() {
|
|
150
|
+
await this.createIdpTemplateButton.click({ timeout: 60000 });
|
|
151
|
+
}
|
|
152
|
+
async fillIdpExtractionTemplateName(name) {
|
|
153
|
+
await this.idpExtractionTemplateName.fill(name);
|
|
154
|
+
}
|
|
155
|
+
async clickCreateIdpExtractionTemplateButton() {
|
|
156
|
+
await this.createIdpExtractionTemplateButton.click({
|
|
157
|
+
timeout: 60000,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
async clickUnstructuredUploadFilesButton() {
|
|
161
|
+
await this.unstructured_UploadFilesButton.click({ timeout: 60000 });
|
|
162
|
+
await (0, sleep_1.sleep)(6000);
|
|
163
|
+
}
|
|
164
|
+
async clickExtractButton() {
|
|
165
|
+
await (0, test_1.expect)(this.extractButton).toBeEnabled({
|
|
166
|
+
timeout: 80000,
|
|
167
|
+
});
|
|
168
|
+
await this.extractButton.click({ timeout: 60000 });
|
|
169
|
+
await (0, sleep_1.sleep)(6000);
|
|
170
|
+
}
|
|
171
|
+
async fillExtractFieldName(name) {
|
|
172
|
+
await this.unstructured_extractFieldName.fill(name);
|
|
173
|
+
}
|
|
174
|
+
async fillPromptField() {
|
|
175
|
+
await this.unstructured_extractFieldPrompt.fill('Provide me the account number from this document');
|
|
176
|
+
}
|
|
177
|
+
async clickAddExtractionFieldButton() {
|
|
178
|
+
await this.unstructured_addExtractionFieldButton.click({ timeout: 60000 });
|
|
179
|
+
}
|
|
180
|
+
async selectExtractionModelOption(option) {
|
|
181
|
+
const comboboxOption = this.page.getByRole('option', { name: option });
|
|
182
|
+
if (await comboboxOption.isVisible()) {
|
|
183
|
+
console.log(`Option ${option} is already visible, no need to click dropdown`);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
await this.unstructured_extractionModelDropdown.click({
|
|
187
|
+
timeout: 60000,
|
|
188
|
+
});
|
|
189
|
+
await comboboxOption.click({ timeout: 120000 });
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
async clickExtractDocumentButton() {
|
|
193
|
+
await (0, test_1.expect)(this.unstructured_extractDocumentButton).toBeVisible({
|
|
194
|
+
timeout: 90000,
|
|
195
|
+
});
|
|
196
|
+
await this.unstructured_extractDocumentButton.click({ timeout: 60000 });
|
|
197
|
+
await (0, test_1.expect)(this.unstructured_saveAsTestCaseButton).toBeEnabled({
|
|
198
|
+
timeout: 180000,
|
|
199
|
+
});
|
|
200
|
+
await (0, test_1.expect)(this.unstructured_saveAsTestCaseButton).toBeEnabled({
|
|
201
|
+
timeout: 120000,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
async clickSaveAsTestCaseButton() {
|
|
205
|
+
await this.unstructured_saveAsTestCaseButton.click({ timeout: 60000 });
|
|
206
|
+
await (0, test_1.expect)(this.unstructured_testCaseSavedNotification).toBeVisible({
|
|
207
|
+
timeout: 120000,
|
|
208
|
+
});
|
|
209
|
+
await this.closeNotificationButton.click({ timeout: 60000 });
|
|
210
|
+
}
|
|
211
|
+
async clickValidateExtractionTab() {
|
|
212
|
+
await this.unstructured_validateExtractionTab.click({ timeout: 60000 });
|
|
213
|
+
}
|
|
214
|
+
async clickExpandAllRowsButton() {
|
|
215
|
+
await (0, test_1.expect)(this.unstructured_expandAllRowsButton).toBeVisible({
|
|
216
|
+
timeout: 120000,
|
|
217
|
+
});
|
|
218
|
+
await this.unstructured_expandAllRowsButton.click({ timeout: 60000 });
|
|
219
|
+
await (0, sleep_1.sleep)(1000);
|
|
220
|
+
}
|
|
221
|
+
async assertPassTestCaseResultsRow(retries = 3) {
|
|
222
|
+
for (let i = 0; i < retries; i++) {
|
|
223
|
+
try {
|
|
224
|
+
await (0, test_1.expect)(this.unstructured_passTestCaseResultsRows).toBeVisible({
|
|
225
|
+
timeout: 60000,
|
|
226
|
+
});
|
|
227
|
+
return; // Click succeeded, exit the loop
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
console.error(`Attempt ${i + 1} to assert pass test case failed: ${error}`);
|
|
231
|
+
await this.page.reload();
|
|
232
|
+
await this.clickValidateExtractionTab();
|
|
233
|
+
await this.clickExpandAllRowsButton();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
throw new Error(`Failed to assert pass test case after ${retries} retries`);
|
|
237
|
+
}
|
|
238
|
+
async clickPublishButton() {
|
|
239
|
+
await this.unstructured_publishButton.click({ timeout: 60000 });
|
|
240
|
+
}
|
|
241
|
+
async clickPublishToProjectOption() {
|
|
242
|
+
await this.unstructured_publishToProjectOption.click({ timeout: 60000 });
|
|
243
|
+
}
|
|
244
|
+
async fillVersionFieldName(name) {
|
|
245
|
+
await this.unstructured_versionFieldName.fill(name);
|
|
246
|
+
}
|
|
247
|
+
async fillVersionFieldDescription(description) {
|
|
248
|
+
await this.unstructured_versionFieldDescription.fill(description);
|
|
249
|
+
}
|
|
250
|
+
async clickPublishButtonModal() {
|
|
251
|
+
await this.unstructured_publishButtonModal.click({ timeout: 60000 });
|
|
252
|
+
}
|
|
253
|
+
async assertIdpSuccessPublishNotification() {
|
|
254
|
+
await (0, test_1.expect)(this.unstructured_idpSuccessfulPublishNotification).toBeVisible({
|
|
255
|
+
timeout: 120000,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
async clickCloseToastNotification() {
|
|
259
|
+
await this.closeNotificationButton.click({
|
|
260
|
+
timeout: 60000,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
async selectStructuredDataExtractionMethod() {
|
|
264
|
+
await this.selectStructuredDataExtraction.click();
|
|
265
|
+
}
|
|
266
|
+
async clickStructuredUploadFilesButton() {
|
|
267
|
+
await (0, test_1.expect)(this.structured_uploadFilesButton).toBeVisible({
|
|
268
|
+
timeout: 60000,
|
|
269
|
+
});
|
|
270
|
+
await this.structured_uploadFilesButton.click({ timeout: 60000 });
|
|
271
|
+
await (0, sleep_1.sleep)(6000);
|
|
272
|
+
}
|
|
273
|
+
async assertMultipleFilesUploaded() {
|
|
274
|
+
await (0, test_1.expect)(this.structured_ExtractDocumentsLoader).not.toBeVisible({
|
|
275
|
+
timeout: 180000,
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
async selectAllExtractionFields() {
|
|
279
|
+
await (0, test_1.expect)(this.structured_CheckboxSelectAllFields).toBeVisible({
|
|
280
|
+
timeout: 60000,
|
|
281
|
+
});
|
|
282
|
+
await this.structured_CheckboxSelectAllFields.click({ timeout: 60000 });
|
|
283
|
+
}
|
|
284
|
+
async clickTablesTab() {
|
|
285
|
+
await (0, test_1.expect)(this.structured_TablesTab).toBeVisible({
|
|
286
|
+
timeout: 60000,
|
|
287
|
+
});
|
|
288
|
+
await this.structured_TablesTab.click({ timeout: 60000 });
|
|
289
|
+
}
|
|
290
|
+
async selectAllExtractedTables() {
|
|
291
|
+
await (0, test_1.expect)(this.structured_CheckboxSelectAllTables).toBeVisible({
|
|
292
|
+
timeout: 60000,
|
|
293
|
+
});
|
|
294
|
+
await this.structured_CheckboxSelectAllTables.click({ timeout: 60000 });
|
|
295
|
+
}
|
|
296
|
+
async assertFieldsAndTablesSelection() {
|
|
297
|
+
await (0, test_1.expect)(this.structured_SelectedFieldsTablesMessage).toBeVisible({
|
|
298
|
+
timeout: 60000,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
async clickTestTemplateTab() {
|
|
302
|
+
await (0, test_1.expect)(this.structured_TestTemplateTab).toBeVisible({
|
|
303
|
+
timeout: 60000,
|
|
304
|
+
});
|
|
305
|
+
await this.structured_TestTemplateTab.click({ timeout: 60000 });
|
|
306
|
+
}
|
|
307
|
+
async clickTestExtractionTemplateButton() {
|
|
308
|
+
await (0, test_1.expect)(this.structured_TestExtractionTemplateButton).toBeEnabled({
|
|
309
|
+
timeout: 120000,
|
|
310
|
+
});
|
|
311
|
+
await this.structured_TestExtractionTemplateButton.click({ timeout: 120000 });
|
|
312
|
+
}
|
|
313
|
+
async extractionResultsAreVisible() {
|
|
314
|
+
await (0, test_1.expect)(this.structured_TestSummaryResult).toBeVisible({
|
|
315
|
+
timeout: 60000,
|
|
316
|
+
});
|
|
317
|
+
await (0, test_1.expect)(this.structured_DetailsResult).toBeVisible({
|
|
318
|
+
timeout: 60000,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
async clickPublishTemplateButton() {
|
|
322
|
+
await (0, test_1.expect)(this.structured_PublishTemplateButton).toBeVisible({
|
|
323
|
+
timeout: 60000,
|
|
324
|
+
});
|
|
325
|
+
await this.structured_PublishTemplateButton.click({ timeout: 60000 });
|
|
326
|
+
}
|
|
327
|
+
async clickPublishTemplateToProjectButton() {
|
|
328
|
+
await (0, test_1.expect)(this.structured_PublishTemplateToProjectButton).toBeVisible({
|
|
329
|
+
timeout: 60000,
|
|
330
|
+
});
|
|
331
|
+
await this.structured_PublishTemplateToProjectButton.click({
|
|
332
|
+
timeout: 60000,
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
async assertStructuredTemplateSuccessNotification() {
|
|
336
|
+
await (0, test_1.expect)(this.structured_SuccessfulPublishNotification).toBeVisible({
|
|
337
|
+
timeout: 120000,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
async fillIdpDescriptionField(description) {
|
|
341
|
+
await this.idpDescriptionField.fill(description);
|
|
342
|
+
}
|
|
343
|
+
async selectProvider(provider) {
|
|
344
|
+
await this.providerDropdown.click({ timeout: 60000 });
|
|
345
|
+
const providerOption = this.page
|
|
346
|
+
.getByRole('option', { name: provider })
|
|
347
|
+
.getByText(provider);
|
|
348
|
+
await (0, test_1.expect)(providerOption).toBeVisible({ timeout: 120000 });
|
|
349
|
+
await providerOption.click({ timeout: 120000 });
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
exports.IdpCreatePage = IdpCreatePage;
|
|
@@ -23,6 +23,10 @@ declare class ModelerHomePage {
|
|
|
23
23
|
readonly uploadFilesButton: Locator;
|
|
24
24
|
readonly messageBanner: Locator;
|
|
25
25
|
readonly closeButton: Locator;
|
|
26
|
+
readonly idpTemplateOption: Locator;
|
|
27
|
+
readonly idpApplicationNameInput: Locator;
|
|
28
|
+
readonly dialog: Locator;
|
|
29
|
+
readonly createIdpApplicationButton: Locator;
|
|
26
30
|
constructor(page: Page);
|
|
27
31
|
clickCreateNewProjectButton(): Promise<void>;
|
|
28
32
|
enterNewProjectName(name: string): Promise<void>;
|
|
@@ -40,5 +44,9 @@ declare class ModelerHomePage {
|
|
|
40
44
|
clickManageButton(): Promise<void>;
|
|
41
45
|
clickUploadFilesButton(): Promise<void>;
|
|
42
46
|
clickMessageBanner(): Promise<void>;
|
|
47
|
+
clickIdpApplicationTemplateOption(): Promise<void>;
|
|
48
|
+
enterIdpApplicationName(name: string): Promise<void>;
|
|
49
|
+
selectCluster(clusterName: string): Promise<void>;
|
|
50
|
+
clickCreateIdpApplicationButton(): Promise<void>;
|
|
43
51
|
}
|
|
44
52
|
export { ModelerHomePage };
|
|
@@ -27,6 +27,10 @@ class ModelerHomePage {
|
|
|
27
27
|
uploadFilesButton;
|
|
28
28
|
messageBanner;
|
|
29
29
|
closeButton;
|
|
30
|
+
idpTemplateOption;
|
|
31
|
+
idpApplicationNameInput;
|
|
32
|
+
dialog;
|
|
33
|
+
createIdpApplicationButton;
|
|
30
34
|
constructor(page) {
|
|
31
35
|
this.page = page;
|
|
32
36
|
this.modelerPageBanner = page
|
|
@@ -66,6 +70,15 @@ class ModelerHomePage {
|
|
|
66
70
|
this.uploadFilesButton = page.getByRole('menuitem', { name: 'Upload files' });
|
|
67
71
|
this.messageBanner = page.locator('[data-test="close-top-banner"]');
|
|
68
72
|
this.closeButton = page.getByRole('button', { name: 'Got it - Dismiss' });
|
|
73
|
+
this.idpTemplateOption = page
|
|
74
|
+
.locator('[data-test="create-idp-application"]')
|
|
75
|
+
.getByText('IDP Application');
|
|
76
|
+
this.idpApplicationNameInput = page.getByPlaceholder('New IDP Application');
|
|
77
|
+
this.dialog = page.getByRole('dialog');
|
|
78
|
+
this.createIdpApplicationButton = page.getByRole('button', {
|
|
79
|
+
name: 'Create',
|
|
80
|
+
exact: true,
|
|
81
|
+
});
|
|
69
82
|
}
|
|
70
83
|
async clickCreateNewProjectButton() {
|
|
71
84
|
await this.createNewProjectButton.click({ timeout: 60000 });
|
|
@@ -167,5 +180,30 @@ class ModelerHomePage {
|
|
|
167
180
|
console.log('No banner or close button found to click');
|
|
168
181
|
}
|
|
169
182
|
}
|
|
183
|
+
async clickIdpApplicationTemplateOption() {
|
|
184
|
+
await this.idpTemplateOption.click({ timeout: 120000 });
|
|
185
|
+
}
|
|
186
|
+
async enterIdpApplicationName(name) {
|
|
187
|
+
await this.idpApplicationNameInput.click({ timeout: 60000 });
|
|
188
|
+
await this.idpApplicationNameInput.fill(name);
|
|
189
|
+
}
|
|
190
|
+
async selectCluster(clusterName) {
|
|
191
|
+
//Select the correct cluster if multiple exist
|
|
192
|
+
const baseClusterName = clusterName.split('(')[0].trim();
|
|
193
|
+
const cluster = this.dialog.getByText(baseClusterName, { exact: false });
|
|
194
|
+
await (0, test_1.expect)(cluster).toBeVisible({
|
|
195
|
+
timeout: 30000,
|
|
196
|
+
});
|
|
197
|
+
await cluster.click();
|
|
198
|
+
await (0, test_1.expect)(this.dialog
|
|
199
|
+
.locator('label')
|
|
200
|
+
.filter({
|
|
201
|
+
hasText: clusterName,
|
|
202
|
+
})
|
|
203
|
+
.getByRole('switch')).toBeChecked({ timeout: 30000 });
|
|
204
|
+
}
|
|
205
|
+
async clickCreateIdpApplicationButton() {
|
|
206
|
+
await this.createIdpApplicationButton.click();
|
|
207
|
+
}
|
|
170
208
|
}
|
|
171
209
|
exports.ModelerHomePage = ModelerHomePage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const SM_8_8_1 = require("../../fixtures/SM-8.8");
|
|
4
|
+
const _setup_1 = require("../../test-setup.js");
|
|
5
|
+
const randomName_1 = require("../../utils/randomName");
|
|
6
|
+
const fileUpload_1 = require("../../utils/fileUpload");
|
|
7
|
+
let idpApplicationName;
|
|
8
|
+
let idpDocumentExtractionTemplateName;
|
|
9
|
+
const unstructuredTestCases = [
|
|
10
|
+
{
|
|
11
|
+
provider: 'AWS',
|
|
12
|
+
model: 'Claude 3.5 Sonnet',
|
|
13
|
+
uploadFiles: ['idp/idp_sample_bank_statement.pdf'],
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
const structuredTestCases = [
|
|
17
|
+
{
|
|
18
|
+
provider: 'AWS',
|
|
19
|
+
model: '',
|
|
20
|
+
uploadFiles: ['idp/structured_invoice_test.pdf'],
|
|
21
|
+
extractionFiles: ['idp/structured_invoice_1.pdf'],
|
|
22
|
+
},
|
|
23
|
+
]; /* For structured documents, the model is empty since it is not necessary */
|
|
24
|
+
if (process.env.IS_DS === 'true') {
|
|
25
|
+
SM_8_8_1.test.describe('IDP User Flow Tests', () => {
|
|
26
|
+
SM_8_8_1.test.afterEach(async ({ page }, testInfo) => {
|
|
27
|
+
await (0, _setup_1.captureScreenshot)(page, testInfo);
|
|
28
|
+
await (0, _setup_1.captureFailureVideo)(page, testInfo);
|
|
29
|
+
});
|
|
30
|
+
SM_8_8_1.test.beforeEach(async ({ navigationPage }, testInfo) => {
|
|
31
|
+
await navigationPage.goToModeler((testInfo.workerIndex + 1) * 1000);
|
|
32
|
+
});
|
|
33
|
+
SM_8_8_1.test.describe('Unstructured Extraction', () => {
|
|
34
|
+
for (const params of unstructuredTestCases) {
|
|
35
|
+
(0, SM_8_8_1.test)(`${params.provider} unstructured (${params.model}) - User creates an idp application with a document extraction template`, async ({ page, idpCreatePage, modelerHomePage, }) => {
|
|
36
|
+
SM_8_8_1.test.slow();
|
|
37
|
+
idpApplicationName = await (0, randomName_1.randomNameAgregator)(`${params.provider} unstructured` + ' - IDP_Application_Name');
|
|
38
|
+
idpDocumentExtractionTemplateName = await (0, randomName_1.randomNameAgregator)(`${params.provider} unstructured` +
|
|
39
|
+
' - IDP_Extraction_Template_Name');
|
|
40
|
+
await SM_8_8_1.test.step('Navigate to Cross Component Test Project', async () => {
|
|
41
|
+
await modelerHomePage.clickMessageBanner();
|
|
42
|
+
await modelerHomePage.clickCrossComponentProjectFolder();
|
|
43
|
+
});
|
|
44
|
+
await SM_8_8_1.test.step('Add an IDP application to the project', async () => {
|
|
45
|
+
await modelerHomePage.clickDiagramTypeDropdown();
|
|
46
|
+
await modelerHomePage.clickIdpApplicationTemplateOption();
|
|
47
|
+
});
|
|
48
|
+
await SM_8_8_1.test.step('Creates a document extraction template', async () => {
|
|
49
|
+
await modelerHomePage.enterIdpApplicationName(idpApplicationName);
|
|
50
|
+
await modelerHomePage.clickCreateIdpApplicationButton();
|
|
51
|
+
await idpCreatePage.clickCreateIdpTemplateButton();
|
|
52
|
+
await idpCreatePage.fillIdpExtractionTemplateName(`${idpDocumentExtractionTemplateName}`);
|
|
53
|
+
await idpCreatePage.fillIdpDescriptionField(`${idpDocumentExtractionTemplateName} description`);
|
|
54
|
+
await idpCreatePage.selectProvider(params.provider);
|
|
55
|
+
await idpCreatePage.clickCreateIdpExtractionTemplateButton();
|
|
56
|
+
});
|
|
57
|
+
await SM_8_8_1.test.step('Upload a file for extraction', async () => {
|
|
58
|
+
await idpCreatePage.clickUnstructuredUploadFilesButton();
|
|
59
|
+
await (0, fileUpload_1.uploadFile)(page, params.uploadFiles);
|
|
60
|
+
await idpCreatePage.clickExtractButton();
|
|
61
|
+
});
|
|
62
|
+
await SM_8_8_1.test.step('Add a field for extraction and extract the data', async () => {
|
|
63
|
+
await idpCreatePage.fillExtractFieldName('bank_account_number');
|
|
64
|
+
await idpCreatePage.fillPromptField();
|
|
65
|
+
await idpCreatePage.clickAddExtractionFieldButton();
|
|
66
|
+
await idpCreatePage.selectExtractionModelOption(params.model);
|
|
67
|
+
await idpCreatePage.clickExtractDocumentButton();
|
|
68
|
+
});
|
|
69
|
+
await SM_8_8_1.test.step('Save extracted data as a test case', async () => {
|
|
70
|
+
await idpCreatePage.clickSaveAsTestCaseButton();
|
|
71
|
+
await idpCreatePage.clickCloseToastNotification();
|
|
72
|
+
});
|
|
73
|
+
await SM_8_8_1.test.step('Validate extraction', async () => {
|
|
74
|
+
await idpCreatePage.clickValidateExtractionTab();
|
|
75
|
+
await idpCreatePage.clickExpandAllRowsButton();
|
|
76
|
+
await idpCreatePage.assertPassTestCaseResultsRow();
|
|
77
|
+
});
|
|
78
|
+
await SM_8_8_1.test.step('Publish the IDP application to project', async () => {
|
|
79
|
+
await idpCreatePage.clickPublishButton();
|
|
80
|
+
await idpCreatePage.clickPublishToProjectOption();
|
|
81
|
+
await idpCreatePage.fillVersionFieldName(idpApplicationName);
|
|
82
|
+
await idpCreatePage.fillVersionFieldDescription(idpApplicationName);
|
|
83
|
+
await idpCreatePage.clickPublishButtonModal();
|
|
84
|
+
await idpCreatePage.assertIdpSuccessPublishNotification();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
SM_8_8_1.test.describe('Structured Extraction', () => {
|
|
90
|
+
for (const params of structuredTestCases) {
|
|
91
|
+
(0, SM_8_8_1.test)(`${params.provider} structured - User creates an idp application with a document extraction template`, async ({ page, idpCreatePage, modelerHomePage, }) => {
|
|
92
|
+
SM_8_8_1.test.slow();
|
|
93
|
+
idpApplicationName = await (0, randomName_1.randomNameAgregator)(`${params.provider} structured` + ' - IDP_Application_Name');
|
|
94
|
+
idpDocumentExtractionTemplateName = await (0, randomName_1.randomNameAgregator)(`${params.provider} structured` + ' - IDP_Extraction_Template_Name');
|
|
95
|
+
await SM_8_8_1.test.step('Navigate to Cross Component Test Project', async () => {
|
|
96
|
+
await modelerHomePage.clickMessageBanner();
|
|
97
|
+
await modelerHomePage.clickCrossComponentProjectFolder();
|
|
98
|
+
});
|
|
99
|
+
await SM_8_8_1.test.step('Add an IDP application to the project', async () => {
|
|
100
|
+
await modelerHomePage.clickDiagramTypeDropdown();
|
|
101
|
+
await modelerHomePage.clickIdpApplicationTemplateOption();
|
|
102
|
+
});
|
|
103
|
+
await SM_8_8_1.test.step('Creates a document extraction template', async () => {
|
|
104
|
+
await modelerHomePage.enterIdpApplicationName(idpApplicationName);
|
|
105
|
+
await modelerHomePage.clickCreateIdpApplicationButton();
|
|
106
|
+
await idpCreatePage.clickCreateIdpTemplateButton();
|
|
107
|
+
await idpCreatePage.selectStructuredDataExtractionMethod();
|
|
108
|
+
await idpCreatePage.fillIdpExtractionTemplateName(`${idpDocumentExtractionTemplateName}`);
|
|
109
|
+
await idpCreatePage.fillIdpDescriptionField(`${idpDocumentExtractionTemplateName} - description`);
|
|
110
|
+
await idpCreatePage.selectProvider(params.provider);
|
|
111
|
+
await idpCreatePage.clickCreateIdpExtractionTemplateButton();
|
|
112
|
+
});
|
|
113
|
+
await SM_8_8_1.test.step('Upload a file for extraction', async () => {
|
|
114
|
+
await idpCreatePage.clickStructuredUploadFilesButton();
|
|
115
|
+
await (0, fileUpload_1.uploadFile)(page, params.uploadFiles);
|
|
116
|
+
});
|
|
117
|
+
await SM_8_8_1.test.step('Select all the fields extracted rows', async () => {
|
|
118
|
+
await idpCreatePage.selectAllExtractionFields();
|
|
119
|
+
});
|
|
120
|
+
await SM_8_8_1.test.step('Switch to the tables tab', async () => {
|
|
121
|
+
await idpCreatePage.clickTablesTab();
|
|
122
|
+
});
|
|
123
|
+
await SM_8_8_1.test.step('Select all the extracted tables', async () => {
|
|
124
|
+
await idpCreatePage.selectAllExtractedTables();
|
|
125
|
+
});
|
|
126
|
+
await SM_8_8_1.test.step('Confirm selection of fields and tables', async () => {
|
|
127
|
+
await idpCreatePage.assertFieldsAndTablesSelection();
|
|
128
|
+
});
|
|
129
|
+
await SM_8_8_1.test.step('Click on the Test Template tab', async () => {
|
|
130
|
+
await idpCreatePage.clickTestTemplateTab();
|
|
131
|
+
});
|
|
132
|
+
await SM_8_8_1.test.step('Upload multiple files for testing the extraction', async () => {
|
|
133
|
+
await idpCreatePage.clickStructuredUploadFilesButton();
|
|
134
|
+
await (0, fileUpload_1.uploadFile)(page, params.extractionFiles);
|
|
135
|
+
await idpCreatePage.assertMultipleFilesUploaded();
|
|
136
|
+
await idpCreatePage.clickTestExtractionTemplateButton();
|
|
137
|
+
});
|
|
138
|
+
await SM_8_8_1.test.step('Test Summary Results and Details Results sections are visible ', async () => {
|
|
139
|
+
await idpCreatePage.extractionResultsAreVisible();
|
|
140
|
+
});
|
|
141
|
+
await SM_8_8_1.test.step('Publish the IDP application to project', async () => {
|
|
142
|
+
await idpCreatePage.clickPublishTemplateButton();
|
|
143
|
+
await idpCreatePage.clickPublishToProjectOption();
|
|
144
|
+
await idpCreatePage.fillVersionFieldName(idpApplicationName);
|
|
145
|
+
await idpCreatePage.fillVersionFieldDescription(idpApplicationName);
|
|
146
|
+
await idpCreatePage.clickPublishTemplateToProjectButton();
|
|
147
|
+
await idpCreatePage.assertStructuredTemplateSuccessNotification();
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|