@umbraco/playwright-testhelpers 17.0.19 → 17.1.0-beta.1
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/lib/helpers/BasePage.d.ts +447 -0
- package/dist/lib/helpers/BasePage.js +543 -0
- package/dist/lib/helpers/BasePage.js.map +1 -0
- package/dist/lib/helpers/ConstantHelper.d.ts +17 -0
- package/dist/lib/helpers/ConstantHelper.js +17 -0
- package/dist/lib/helpers/ConstantHelper.js.map +1 -1
- package/dist/lib/helpers/ContentRenderUiHelper.js +3 -3
- package/dist/lib/helpers/ContentRenderUiHelper.js.map +1 -1
- package/dist/lib/helpers/ContentUiHelper.d.ts +0 -6
- package/dist/lib/helpers/ContentUiHelper.js +333 -495
- package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
- package/dist/lib/helpers/CurrentUserProfileUiHelper.js +4 -10
- package/dist/lib/helpers/CurrentUserProfileUiHelper.js.map +1 -1
- package/dist/lib/helpers/DataTypeUiHelper.js +189 -328
- package/dist/lib/helpers/DataTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/DictionaryUiHelper.js +16 -21
- package/dist/lib/helpers/DictionaryUiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentBlueprintUiHelper.js +7 -8
- package/dist/lib/helpers/DocumentBlueprintUiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentTypeApiHelper.d.ts +1 -4
- package/dist/lib/helpers/DocumentTypeApiHelper.js +1 -121
- package/dist/lib/helpers/DocumentTypeApiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentTypeUiHelper.js +18 -33
- package/dist/lib/helpers/DocumentTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/ExamineManagementUiHelper.js +4 -4
- package/dist/lib/helpers/ExamineManagementUiHelper.js.map +1 -1
- package/dist/lib/helpers/FormsUiHelper.js +119 -158
- package/dist/lib/helpers/FormsUiHelper.js.map +1 -1
- package/dist/lib/helpers/HealthCheckUiHelper.js +3 -3
- package/dist/lib/helpers/HealthCheckUiHelper.js.map +1 -1
- package/dist/lib/helpers/LanguageUiHelper.js +15 -17
- package/dist/lib/helpers/LanguageUiHelper.js.map +1 -1
- package/dist/lib/helpers/LogViewerUiHelper.js +21 -30
- package/dist/lib/helpers/LogViewerUiHelper.js.map +1 -1
- package/dist/lib/helpers/LoginUiHelper.js +5 -7
- package/dist/lib/helpers/LoginUiHelper.js.map +1 -1
- package/dist/lib/helpers/MediaTypeUiHelper.js +11 -17
- package/dist/lib/helpers/MediaTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/MediaUiHelper.js +34 -43
- package/dist/lib/helpers/MediaUiHelper.js.map +1 -1
- package/dist/lib/helpers/MemberGroupUiHelper.js +12 -15
- package/dist/lib/helpers/MemberGroupUiHelper.js.map +1 -1
- package/dist/lib/helpers/MemberTypeUiHelper.js +2 -3
- package/dist/lib/helpers/MemberTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/MemberUiHelper.js +24 -42
- package/dist/lib/helpers/MemberUiHelper.js.map +1 -1
- package/dist/lib/helpers/ModelsBuilderUiHelper.js +2 -3
- package/dist/lib/helpers/ModelsBuilderUiHelper.js.map +1 -1
- package/dist/lib/helpers/PackageUiHelper.js +29 -34
- package/dist/lib/helpers/PackageUiHelper.js.map +1 -1
- package/dist/lib/helpers/PartialViewUiHelper.js +13 -15
- package/dist/lib/helpers/PartialViewUiHelper.js.map +1 -1
- package/dist/lib/helpers/ProfilingUiHelper.js +2 -4
- package/dist/lib/helpers/ProfilingUiHelper.js.map +1 -1
- package/dist/lib/helpers/PublishedStatusUiHelper.js +6 -6
- package/dist/lib/helpers/PublishedStatusUiHelper.js.map +1 -1
- package/dist/lib/helpers/RedirectManagementUiHelper.js +7 -12
- package/dist/lib/helpers/RedirectManagementUiHelper.js.map +1 -1
- package/dist/lib/helpers/RelationTypeUiHelper.js +12 -14
- package/dist/lib/helpers/RelationTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/ScriptUiHelper.js +8 -11
- package/dist/lib/helpers/ScriptUiHelper.js.map +1 -1
- package/dist/lib/helpers/StylesheetUiHelper.js +8 -12
- package/dist/lib/helpers/StylesheetUiHelper.js.map +1 -1
- package/dist/lib/helpers/TelemetryDataUiHelper.js +2 -3
- package/dist/lib/helpers/TelemetryDataUiHelper.js.map +1 -1
- package/dist/lib/helpers/TemplateUiHelper.js +17 -22
- package/dist/lib/helpers/TemplateUiHelper.js.map +1 -1
- package/dist/lib/helpers/UiBaseLocators.d.ts +230 -228
- package/dist/lib/helpers/UiBaseLocators.js +832 -869
- package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
- package/dist/lib/helpers/UserGroupUiHelper.js +27 -44
- package/dist/lib/helpers/UserGroupUiHelper.js.map +1 -1
- package/dist/lib/helpers/UserUiHelper.js +43 -46
- package/dist/lib/helpers/UserUiHelper.js.map +1 -1
- package/dist/lib/helpers/WebhookUiHelper.js +11 -27
- package/dist/lib/helpers/WebhookUiHelper.js.map +1 -1
- package/dist/lib/helpers/WelcomeDashboardUiHelper.js +1 -1
- package/dist/lib/helpers/WelcomeDashboardUiHelper.js.map +1 -1
- package/dist/lib/helpers/differentAppSettingsHelpers/ExternalLoginUiHelpers.js +4 -9
- package/dist/lib/helpers/differentAppSettingsHelpers/ExternalLoginUiHelpers.js.map +1 -1
- package/dist/lib/helpers/differentAppSettingsHelpers/InstallUiHelper.js +5 -10
- package/dist/lib/helpers/differentAppSettingsHelpers/InstallUiHelper.js.map +1 -1
- package/dist/lib/helpers/index.d.ts +1 -0
- package/dist/lib/helpers/index.js +3 -1
- package/dist/lib/helpers/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FormsUiHelper = void 0;
|
|
4
4
|
const UiBaseLocators_1 = require("./UiBaseLocators");
|
|
5
|
-
const
|
|
5
|
+
const ConstantHelper_1 = require("./ConstantHelper");
|
|
6
6
|
class FormsUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
7
7
|
quickCreateNewBtn;
|
|
8
8
|
createNewFormModalBtn;
|
|
@@ -135,350 +135,311 @@ class FormsUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
135
135
|
* Methods for Forms.
|
|
136
136
|
*/
|
|
137
137
|
async clickQuickCreateFormButton() {
|
|
138
|
-
await this.formMenuItemForForm.
|
|
139
|
-
await this.formMenuItemForForm.locator(this.quickCreateNewBtn).click();
|
|
138
|
+
await this.hoverAndClick(this.formMenuItemForForm, this.formMenuItemForForm.locator(this.quickCreateNewBtn));
|
|
140
139
|
}
|
|
141
140
|
async clickNewFormButton() {
|
|
142
|
-
await
|
|
143
|
-
await this.createNewFormModalBtn.click();
|
|
141
|
+
await this.click(this.createNewFormModalBtn);
|
|
144
142
|
}
|
|
145
143
|
async clickSaveFormButton() {
|
|
146
|
-
await this.
|
|
144
|
+
await this.click(this.saveFormBtn);
|
|
147
145
|
}
|
|
148
146
|
async fillFormName(name) {
|
|
149
|
-
await
|
|
150
|
-
await this.formNameTxt.fill(name);
|
|
147
|
+
await this.enterText(this.formNameTxt, name);
|
|
151
148
|
}
|
|
152
149
|
async fillFormPageName(position, name) {
|
|
153
150
|
const nameInput = this.formPageNametxt.nth(position);
|
|
154
|
-
await (
|
|
155
|
-
await nameInput.fill(name);
|
|
151
|
+
await this.enterText(nameInput, name);
|
|
156
152
|
}
|
|
157
153
|
async fillFormGroupName(position, name) {
|
|
158
154
|
const groupInput = this.formGroupNameTxt.nth(position);
|
|
159
|
-
await (
|
|
160
|
-
await groupInput.fill(name);
|
|
155
|
+
await this.enterText(groupInput, name);
|
|
161
156
|
}
|
|
162
157
|
async fillFormFieldName(name) {
|
|
163
158
|
await this.formEditFieldModal.locator(this.formFieldNameTxt).fill(name);
|
|
164
159
|
}
|
|
165
160
|
async clickAddNewPageButton() {
|
|
166
|
-
await this.
|
|
161
|
+
await this.click(this.formAddNewPageBtn);
|
|
167
162
|
}
|
|
168
163
|
async clickAddNewGroupButton() {
|
|
169
|
-
await this.
|
|
164
|
+
await this.click(this.formAddNewGroupBtn);
|
|
170
165
|
}
|
|
171
166
|
async clickAddQuestionButton(index = 0) {
|
|
172
167
|
const button = this.formPage.nth(index).locator(this.formAddQuestionBtn);
|
|
173
|
-
await
|
|
168
|
+
await this.click(button);
|
|
174
169
|
}
|
|
175
170
|
async chooseFormFieldType(type) {
|
|
176
|
-
await this.formFieldType.filter({ hasText: type }).nth(0)
|
|
171
|
+
await this.click(this.formFieldType.filter({ hasText: type }).nth(0));
|
|
177
172
|
}
|
|
178
173
|
async clickExpandFormsTreeButton() {
|
|
179
|
-
await this.
|
|
174
|
+
await this.click(this.formExpandBtn);
|
|
180
175
|
}
|
|
181
176
|
async doesFormTreeHaveFormName(name) {
|
|
182
|
-
await
|
|
177
|
+
await this.containsText(this.formTree, name);
|
|
183
178
|
}
|
|
184
179
|
async goToFormWithName(name) {
|
|
185
|
-
await this.formTree.getByText(name, { exact: true })
|
|
180
|
+
await this.click(this.formTree.getByText(name, { exact: true }));
|
|
186
181
|
}
|
|
187
182
|
async clickFormFieldTypeSubmitModal() {
|
|
188
|
-
await this.
|
|
183
|
+
await this.click(this.formSubmitButtonModal);
|
|
189
184
|
}
|
|
190
185
|
async clickActionMenuOnFormMenuItem(name) {
|
|
191
|
-
await this.menuItem.locator(
|
|
186
|
+
await this.click(this.menuItem.locator(`[label="${name}"] uui-button[label="Open actions menu"]`));
|
|
192
187
|
}
|
|
193
188
|
async clickDeleteFormButton() {
|
|
194
|
-
await this.formActionModal.locator(this.formDeleteThreeDotBtn)
|
|
195
|
-
await this.
|
|
189
|
+
await this.click(this.formActionModal.locator(this.formDeleteThreeDotBtn));
|
|
190
|
+
await this.click(this.deleteExactBtn);
|
|
196
191
|
}
|
|
197
192
|
async goToFormSetting() {
|
|
198
|
-
await this.formWorkspaceEditor.locator(this.formSettingIcon)
|
|
193
|
+
await this.click(this.formWorkspaceEditor.locator(this.formSettingIcon));
|
|
199
194
|
}
|
|
200
195
|
async setFormStoreRecordsSetting() {
|
|
201
|
-
await
|
|
196
|
+
await this.waitForVisible(this.formSettingStoreRecordBtn);
|
|
202
197
|
const toggle = this.formSettingStoreRecordBtn.locator(this.formToggleSlider);
|
|
203
|
-
await
|
|
198
|
+
await this.waitForVisible(toggle);
|
|
204
199
|
await toggle.check();
|
|
205
200
|
}
|
|
206
201
|
async setFormCaptionsSetting() {
|
|
207
|
-
await
|
|
202
|
+
await this.waitForVisible(this.formSettingCaptionsContainer);
|
|
208
203
|
for (let i = 0; i < 3; i++) {
|
|
209
204
|
const captionInput = this.formSettingCaptions.locator(this.formInputTxt).nth(i);
|
|
210
|
-
await (
|
|
211
|
-
await captionInput.fill("Test Caption " + (i + 1));
|
|
205
|
+
await this.enterText(captionInput, `Test Caption ${i + 1}`);
|
|
212
206
|
}
|
|
213
207
|
}
|
|
214
208
|
async setFormStylingSetting() {
|
|
215
|
-
await
|
|
209
|
+
await this.waitForVisible(this.formSettingStylingContainer);
|
|
216
210
|
const cssClassInput = this.formSettingStyling.locator(this.formInputTxt);
|
|
217
|
-
await (
|
|
218
|
-
await cssClassInput.fill("custom-css-class");
|
|
211
|
+
await this.enterText(cssClassInput, "custom-css-class");
|
|
219
212
|
const disableDefaultStylesheetInput = this.formSettingStyling.locator(this.formToggleSlider);
|
|
220
|
-
await
|
|
221
|
-
await disableDefaultStylesheetInput.click();
|
|
213
|
+
await this.click(disableDefaultStylesheetInput);
|
|
222
214
|
}
|
|
223
215
|
async setFormValidationSetting() {
|
|
224
|
-
await
|
|
216
|
+
await this.waitForVisible(this.formSettingValidationContainer);
|
|
225
217
|
const requiredErrorMessageInput = this.formSettingValidation.locator(this.formInputTxt).nth(0);
|
|
226
|
-
await (
|
|
227
|
-
await requiredErrorMessageInput.fill("Required error message");
|
|
218
|
+
await this.enterText(requiredErrorMessageInput, "Required error message");
|
|
228
219
|
const invalidErrorMessageInput = this.formSettingValidation.locator(this.formInputTxt).nth(1);
|
|
229
|
-
await (
|
|
230
|
-
await invalidErrorMessageInput.fill("Invalid error message");
|
|
220
|
+
await this.enterText(invalidErrorMessageInput, "Invalid error message");
|
|
231
221
|
const showValidationSummaryInput = this.formSettingValidation.locator(this.formToggleSlider).nth(0);
|
|
232
|
-
await
|
|
233
|
-
await showValidationSummaryInput.click();
|
|
222
|
+
await this.click(showValidationSummaryInput);
|
|
234
223
|
const hideFieldValidationInput = this.formSettingValidation.locator(this.formToggleSlider).nth(1);
|
|
235
|
-
await
|
|
236
|
-
await hideFieldValidationInput.click();
|
|
224
|
+
await this.click(hideFieldValidationInput);
|
|
237
225
|
const markMandatoryFieldRadioInput = this.formSettingValidation.locator("uui-radio[value = 'MarkMandatoryFields']");
|
|
238
|
-
await
|
|
239
|
-
await markMandatoryFieldRadioInput.click();
|
|
226
|
+
await this.click(markMandatoryFieldRadioInput);
|
|
240
227
|
const indicatorInput = this.formSettingValidation.locator(this.formInputTxt).nth(2);
|
|
241
|
-
await (
|
|
242
|
-
await indicatorInput.fill("+");
|
|
228
|
+
await this.enterText(indicatorInput, "+");
|
|
243
229
|
}
|
|
244
230
|
async setFormAutocompleteSetting() {
|
|
245
|
-
await
|
|
231
|
+
await this.waitForVisible(this.formSettingAutocompleteContainer);
|
|
246
232
|
const autocompleteAttributeRadioInput = this.formSettingAutocomplete.locator('uui-radio[value = "On"]');
|
|
247
|
-
await
|
|
248
|
-
await autocompleteAttributeRadioInput.click();
|
|
233
|
+
await this.click(autocompleteAttributeRadioInput);
|
|
249
234
|
}
|
|
250
235
|
async setFormModerationSetting() {
|
|
251
|
-
await
|
|
236
|
+
await this.waitForVisible(this.formSettingModerationContainer);
|
|
252
237
|
const enablePostModerationAttributeToggleInput = this.formSettingModeration.locator(this.formToggleSlider);
|
|
253
|
-
await
|
|
254
|
-
await enablePostModerationAttributeToggleInput.click();
|
|
238
|
+
await this.click(enablePostModerationAttributeToggleInput);
|
|
255
239
|
}
|
|
256
240
|
async setFormFieldsDisplayedSetting() {
|
|
257
|
-
await
|
|
241
|
+
await this.waitForVisible(this.formSettingFieldsDisplayedContainer);
|
|
258
242
|
const displayDefaultFieldsToggleInput = this.formSettingFieldsDisplayed.locator(this.formToggleSlider);
|
|
259
|
-
await
|
|
260
|
-
await
|
|
261
|
-
await this.page.waitForTimeout(100); // short pause required here otherwise revealed elements are not found
|
|
243
|
+
await this.click(displayDefaultFieldsToggleInput);
|
|
244
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.minimal); // short pause required here otherwise revealed elements are not found
|
|
262
245
|
const displayFieldsSelect = this.formSettingFieldsDisplayed.locator("select");
|
|
263
|
-
await (
|
|
264
|
-
await displayFieldsSelect.selectOption({ value: '_system_state' });
|
|
246
|
+
await this.selectByValue(displayFieldsSelect, '_system_state');
|
|
265
247
|
const displayFieldsAddButton = this.formSettingFieldsDisplayed.locator("button[id='button']");
|
|
266
|
-
await
|
|
267
|
-
await displayFieldsAddButton.click();
|
|
248
|
+
await this.click(displayFieldsAddButton);
|
|
268
249
|
}
|
|
269
250
|
async setFormDataRetentionSetting(recordNumber) {
|
|
270
|
-
await
|
|
251
|
+
await this.waitForVisible(this.formSettingDataRetentionContainer);
|
|
271
252
|
const retainSubmittedRecordsToggleInput = this.formSettingDataRetention.locator(this.formToggleSlider).nth(0);
|
|
272
|
-
await
|
|
273
|
-
await
|
|
274
|
-
await this.page.waitForTimeout(100); // short pause required here otherwise revealed elements are not found
|
|
253
|
+
await this.click(retainSubmittedRecordsToggleInput);
|
|
254
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.minimal); // short pause required here otherwise revealed elements are not found
|
|
275
255
|
const retainSubmittedRecordsNumberInput = this.formSettingDataRetention.locator(this.formInputNumber).nth(0);
|
|
276
|
-
await (
|
|
277
|
-
await retainSubmittedRecordsNumberInput.fill(recordNumber);
|
|
256
|
+
await this.enterText(retainSubmittedRecordsNumberInput, recordNumber);
|
|
278
257
|
}
|
|
279
258
|
async toggleFieldSetting(settingAlias) {
|
|
280
|
-
const settingFieldLocator = this.page.locator(
|
|
281
|
-
await
|
|
282
|
-
await settingFieldLocator.click();
|
|
259
|
+
const settingFieldLocator = this.page.locator(`umb-property-layout[alias="${settingAlias}"] #toggle`);
|
|
260
|
+
await this.click(settingFieldLocator);
|
|
283
261
|
}
|
|
284
262
|
async applyFieldSettingViaTextInput(settingAlias, settingValue) {
|
|
285
|
-
const settingFieldLocator = this.page.locator(
|
|
263
|
+
const settingFieldLocator = this.page.locator(`umb-property[alias="${settingAlias}"] input`);
|
|
286
264
|
await settingFieldLocator.fill(settingValue);
|
|
287
265
|
}
|
|
288
266
|
async applyFieldSettingViaDropDown(settingAlias, settingValue) {
|
|
289
|
-
const settingFieldLocator = this.page.locator(
|
|
290
|
-
await
|
|
267
|
+
const settingFieldLocator = this.page.locator(`umb-property[alias="${settingAlias}"] select`);
|
|
268
|
+
await this.selectByValue(settingFieldLocator, settingValue);
|
|
291
269
|
}
|
|
292
270
|
async applyFieldSettingViaSlider(settingAlias) {
|
|
293
|
-
const settingFieldLocator = this.page.locator(
|
|
294
|
-
await
|
|
295
|
-
await settingFieldLocator.click();
|
|
271
|
+
const settingFieldLocator = this.page.locator(`umb-property[alias="${settingAlias}"] #toggle`);
|
|
272
|
+
await this.click(settingFieldLocator);
|
|
296
273
|
}
|
|
297
274
|
async applyFieldFileUploadSettings(settingAlias, allowedProvidedExtensions, allowedCustomExtensions, allowMultiple) {
|
|
298
|
-
const settingFieldLocator = this.page.locator(
|
|
275
|
+
const settingFieldLocator = this.page.locator(`umb-property-layout[alias="${settingAlias}"]`);
|
|
299
276
|
for (var i = 0; i < allowedProvidedExtensions.length; i++) {
|
|
300
277
|
const checkBoxLocator = settingFieldLocator.locator('uui-toggle', { hasText: allowedProvidedExtensions[i].toUpperCase() }).locator('#toggle');
|
|
301
|
-
await
|
|
302
|
-
await checkBoxLocator.click();
|
|
278
|
+
await this.click(checkBoxLocator);
|
|
303
279
|
}
|
|
304
280
|
const addNewExtensionLocator = settingFieldLocator.locator('input[placeholder = "Add new allowed file type"]');
|
|
305
|
-
await
|
|
281
|
+
await this.waitForVisible(addNewExtensionLocator);
|
|
306
282
|
const buttonLocator = settingFieldLocator.locator('form svg');
|
|
307
|
-
await
|
|
283
|
+
await this.waitForVisible(buttonLocator);
|
|
308
284
|
for (var i = 0; i < allowedCustomExtensions.length; i++) {
|
|
309
285
|
await addNewExtensionLocator.fill(allowedCustomExtensions[i]);
|
|
310
|
-
await
|
|
286
|
+
await this.click(buttonLocator);
|
|
311
287
|
}
|
|
312
288
|
if (allowMultiple) {
|
|
313
289
|
const alias = "allowMultipleFileUploads";
|
|
314
|
-
const multipleUploadLocator = this.page.locator(
|
|
315
|
-
await
|
|
316
|
-
await multipleUploadLocator.click();
|
|
290
|
+
const multipleUploadLocator = this.page.locator(`umb-property-layout[alias="${alias}"] #toggle`);
|
|
291
|
+
await this.click(multipleUploadLocator);
|
|
317
292
|
}
|
|
318
293
|
}
|
|
319
294
|
async applyFieldPrevalues(settingAlias, prevalues) {
|
|
320
|
-
const settingFieldLocator = this.page.locator(
|
|
295
|
+
const settingFieldLocator = this.page.locator(`umb-property-layout[alias="${settingAlias}"]`);
|
|
321
296
|
for (var i = 0; i < prevalues.length; i++) {
|
|
322
297
|
const valueFieldLocator = settingFieldLocator.locator("input[placeholder = 'New value']");
|
|
323
|
-
await
|
|
298
|
+
await this.waitForVisible(valueFieldLocator);
|
|
324
299
|
await valueFieldLocator.fill(prevalues[i].value);
|
|
325
300
|
const captionFieldLocator = settingFieldLocator.locator("input[placeholder = 'New caption']");
|
|
326
|
-
await
|
|
301
|
+
await this.waitForVisible(captionFieldLocator);
|
|
327
302
|
await captionFieldLocator.fill(prevalues[i].caption);
|
|
328
303
|
const buttonLocator = settingFieldLocator.locator('uui-button[label="add"]');
|
|
329
|
-
await
|
|
330
|
-
await buttonLocator.click();
|
|
304
|
+
await this.click(buttonLocator);
|
|
331
305
|
}
|
|
332
306
|
}
|
|
333
307
|
async applyFieldSettingViaTextArea(settingAlias, settingValue) {
|
|
334
|
-
const settingFieldLocator = this.page.locator(
|
|
308
|
+
const settingFieldLocator = this.page.locator(`umb-property[alias="${settingAlias}"] textarea`);
|
|
335
309
|
await settingFieldLocator.fill(settingValue);
|
|
336
310
|
}
|
|
337
311
|
async applyFieldSettingViaRichTextInput(settingAlias, settingValue) {
|
|
338
|
-
const richTextAreaTxt = this.page.locator(
|
|
339
|
-
await
|
|
312
|
+
const richTextAreaTxt = this.page.locator(`umb-property[alias="${settingAlias}"] umb-property-editor-ui-tiptap`).locator('#editor .tiptap');
|
|
313
|
+
await this.waitForVisible(richTextAreaTxt);
|
|
340
314
|
await richTextAreaTxt.fill(settingValue);
|
|
341
315
|
}
|
|
342
316
|
async applyFieldSettingViaRange(settingAlias, settingValue) {
|
|
343
|
-
const settingFieldLocator = this.page.locator(
|
|
317
|
+
const settingFieldLocator = this.page.locator(`umb-property[alias="${settingAlias}"]`);
|
|
344
318
|
await settingFieldLocator.locator('input[type="range"]').fill(settingValue);
|
|
345
319
|
}
|
|
346
320
|
async applyFieldSettingViaFieldMappingInput(settingAlias, settingValue) {
|
|
347
|
-
const settingFieldLocator = this.page.locator(
|
|
348
|
-
await
|
|
321
|
+
const settingFieldLocator = this.page.locator(`umb-property[alias="${settingAlias}"]`);
|
|
322
|
+
await this.waitForVisible(settingFieldLocator);
|
|
349
323
|
for (let i = 0; i < settingValue.length; i++) {
|
|
350
324
|
const buttonLocator = settingFieldLocator.locator('uui-button[label="add"]');
|
|
351
|
-
await
|
|
352
|
-
await buttonLocator.click();
|
|
325
|
+
await this.click(buttonLocator);
|
|
353
326
|
const aliasInputLocator = settingFieldLocator.locator("input[placeholder = 'Alias']").nth(i);
|
|
354
|
-
await
|
|
327
|
+
await this.waitForVisible(aliasInputLocator);
|
|
355
328
|
await aliasInputLocator.fill(settingValue[i].alias);
|
|
356
329
|
const staticValueInputLocator = settingFieldLocator.locator("input[placeholder = 'Static value']").nth(i);
|
|
357
|
-
await
|
|
330
|
+
await this.waitForVisible(staticValueInputLocator);
|
|
358
331
|
await staticValueInputLocator.fill(settingValue[i].staticValue);
|
|
359
332
|
}
|
|
360
333
|
}
|
|
361
334
|
async applyFieldSettingViaDocumentMapper(settingAlias, settingValue) {
|
|
362
|
-
const settingFieldLocator = this.page.locator(
|
|
363
|
-
await
|
|
335
|
+
const settingFieldLocator = this.page.locator(`umb-property[alias="${settingAlias}"]`);
|
|
336
|
+
await this.waitForVisible(settingFieldLocator);
|
|
364
337
|
const selectLocator = settingFieldLocator.locator("forms-document-mapper-property-editor select");
|
|
365
|
-
await
|
|
338
|
+
await this.selectByValue(selectLocator, settingValue.doctype);
|
|
366
339
|
const inputLocator = settingFieldLocator.locator('forms-document-mapper-property-editor input[type = "text"]');
|
|
367
|
-
await
|
|
340
|
+
await this.waitForVisible(inputLocator.first());
|
|
368
341
|
const inputLocatorCount = await inputLocator.count();
|
|
369
342
|
for (let i = 0; i < inputLocatorCount; i++) {
|
|
370
|
-
await
|
|
343
|
+
await this.waitForVisible(inputLocator.nth(i));
|
|
371
344
|
await inputLocator.nth(i).fill(settingValue.nameStaticValue);
|
|
372
345
|
}
|
|
373
346
|
}
|
|
374
347
|
async applyFieldSettingViaEmailTemplatePicker(settingAlias, settingValue) {
|
|
375
|
-
const settingFieldLocator = this.page.locator(
|
|
376
|
-
await
|
|
348
|
+
const settingFieldLocator = this.page.locator(`umb-property[alias="${settingAlias}"]`);
|
|
349
|
+
await this.waitForVisible(settingFieldLocator);
|
|
377
350
|
const buttonLocator = settingFieldLocator.locator("#caret-button");
|
|
378
|
-
await
|
|
351
|
+
await this.click(buttonLocator);
|
|
379
352
|
const templateLocator = this.page.locator("#label-button", { hasText: settingValue });
|
|
380
|
-
await
|
|
381
|
-
await templateLocator.click();
|
|
353
|
+
await this.click(templateLocator);
|
|
382
354
|
}
|
|
383
355
|
async applyFieldSettingViaStandardFieldMappingInput(settingAlias, settingValue) {
|
|
384
|
-
const settingFieldLocator = this.page.locator(
|
|
385
|
-
await
|
|
356
|
+
const settingFieldLocator = this.page.locator(`umb-property[alias="${settingAlias}"]`);
|
|
357
|
+
await this.waitForVisible(settingFieldLocator);
|
|
386
358
|
for (let i = 0; i < settingValue.length; i++) {
|
|
387
359
|
if (settingValue[i].include) {
|
|
388
|
-
const includeButtonLocator = settingFieldLocator.locator(
|
|
389
|
-
await
|
|
360
|
+
const includeButtonLocator = settingFieldLocator.locator(`div[data-umb-standard-field-mapping-include="${settingValue[i].alias}"] #toggle`);
|
|
361
|
+
await this.click(includeButtonLocator);
|
|
390
362
|
}
|
|
391
|
-
const keyNameButtonLocator = settingFieldLocator.locator(
|
|
363
|
+
const keyNameButtonLocator = settingFieldLocator.locator(`div[data-umb-standard-field-mapping-key-name="${settingValue[i].alias}"] input[type="text"]`);
|
|
392
364
|
await keyNameButtonLocator.fill(settingValue[0].keyName);
|
|
393
365
|
}
|
|
394
366
|
}
|
|
395
367
|
async setFieldMandatory(message) {
|
|
396
|
-
await
|
|
397
|
-
await this.
|
|
398
|
-
await this.page.waitForTimeout(1000);
|
|
368
|
+
await this.click(this.formFieldMandatory.locator("#toggle"));
|
|
369
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.medium);
|
|
399
370
|
const inputLocator = this.formFieldMandatory.locator(this.formInputTxt);
|
|
400
|
-
await (
|
|
401
|
-
await inputLocator.fill(message);
|
|
371
|
+
await this.enterText(inputLocator, message);
|
|
402
372
|
}
|
|
403
373
|
async setFieldValidation(label, message) {
|
|
404
|
-
await
|
|
374
|
+
await this.waitForVisible(this.formFieldRegex);
|
|
405
375
|
const selectLocator = this.formFieldRegex.locator("select");
|
|
406
|
-
await
|
|
407
|
-
await this.page.waitForTimeout(
|
|
376
|
+
await this.selectByText(selectLocator, label);
|
|
377
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.medium);
|
|
408
378
|
const inputLocator = this.formFieldRegex.locator("input");
|
|
409
|
-
await (
|
|
410
|
-
await inputLocator.fill(message);
|
|
379
|
+
await this.enterText(inputLocator, message);
|
|
411
380
|
}
|
|
412
381
|
async clickFormWorkflowConfigureButton() {
|
|
413
|
-
await this.
|
|
382
|
+
await this.click(this.formWorkflowConfigureBtn);
|
|
414
383
|
}
|
|
415
384
|
async clickFormWorkflowEditSubmitButton() {
|
|
416
|
-
await this.formEditWorkflowModal.locator(this.formSubmitButtonModal)
|
|
385
|
+
await this.click(this.formEditWorkflowModal.locator(this.formSubmitButtonModal));
|
|
417
386
|
}
|
|
418
387
|
async clickFormWorkflowConfigureSubmitButton() {
|
|
419
|
-
await this.formConfigureWorkflowModal.locator(this.formSubmitButtonModal)
|
|
388
|
+
await this.click(this.formConfigureWorkflowModal.locator(this.formSubmitButtonModal));
|
|
420
389
|
}
|
|
421
390
|
async clickFormWorkflowAddButton() {
|
|
422
|
-
await this.formWorkflowOnSubmitStage.locator(this.formWorkflowAddButtonModal)
|
|
391
|
+
await this.click(this.formWorkflowOnSubmitStage.locator(this.formWorkflowAddButtonModal), { force: true });
|
|
423
392
|
}
|
|
424
393
|
async selectWorkflowType(workflowType) {
|
|
425
|
-
this.page.locator(
|
|
394
|
+
await this.click(this.page.locator(`umb-ref-item[title="${workflowType}"]`));
|
|
426
395
|
}
|
|
427
396
|
async fillWorkflowName(workflowName) {
|
|
428
|
-
await
|
|
429
|
-
await this.formWorkflowNameTxt.fill(workflowName);
|
|
397
|
+
await this.enterText(this.formWorkflowNameTxt, workflowName);
|
|
430
398
|
}
|
|
431
399
|
/*
|
|
432
400
|
* Methods for Prevalue Source.
|
|
433
401
|
*/
|
|
434
402
|
async clickQuickCreatePrevalueSourceButton() {
|
|
435
|
-
await (
|
|
436
|
-
await this.formMenuItemForPrevalueSource.hover();
|
|
437
|
-
await this.formMenuItemForPrevalueSource.locator(this.quickCreateNewBtn).click();
|
|
403
|
+
await this.hoverAndClick(this.formMenuItemForPrevalueSource, this.formMenuItemForPrevalueSource.locator(this.quickCreateNewBtn));
|
|
438
404
|
}
|
|
439
405
|
async clickPrevalueSourceTypeButton(type) {
|
|
440
406
|
const button = this.createNewPrevaluesourceModalBtn.locator("#name", { hasText: type });
|
|
441
|
-
await
|
|
442
|
-
await button.click();
|
|
407
|
+
await this.click(button);
|
|
443
408
|
}
|
|
444
409
|
async clickExpandPrevalueSourceTreeButton() {
|
|
445
|
-
await this.
|
|
410
|
+
await this.click(this.prevalueSourceExpandBtn);
|
|
446
411
|
}
|
|
447
412
|
async goToPrevalueSourceWithName(name) {
|
|
448
|
-
await this.prevalueSourceTree.locator(
|
|
413
|
+
await this.click(this.prevalueSourceTree.locator(`uui-menu-item[label="${name}"]`));
|
|
449
414
|
}
|
|
450
415
|
async clickDeletePrevalueSourceButton(name) {
|
|
451
|
-
const prevalueSource =
|
|
452
|
-
await prevalueSource.locator(this.prevalueSourceDeleteBtn)
|
|
453
|
-
await this.
|
|
416
|
+
const prevalueSource = this.prevalueSourceTree.locator(`uui-menu-item[label="${name}"]`);
|
|
417
|
+
await this.click(prevalueSource.locator(this.prevalueSourceDeleteBtn));
|
|
418
|
+
await this.click(this.deleteExactBtn);
|
|
454
419
|
}
|
|
455
420
|
async applyCacheOptions(option, timeValue = 0, timeUnit = "") {
|
|
456
|
-
await
|
|
457
|
-
const optionSelect = this.prevalueSourceCacheContainer.locator(
|
|
458
|
-
await
|
|
459
|
-
await optionSelect.click();
|
|
421
|
+
await this.waitForVisible(this.prevalueSourceCacheContainer);
|
|
422
|
+
const optionSelect = this.prevalueSourceCacheContainer.locator(`uui-radio[value = "${option}"]`);
|
|
423
|
+
await this.click(optionSelect);
|
|
460
424
|
if (option === "time") {
|
|
461
425
|
const numberInput = this.prevalueSourceCacheContainer.locator("input[type='number']");
|
|
462
|
-
await
|
|
426
|
+
await this.waitForVisible(numberInput);
|
|
463
427
|
await numberInput.fill(timeValue.toString());
|
|
464
428
|
const unitSelect = this.prevalueSourceCacheContainer.locator("select");
|
|
465
|
-
await (
|
|
466
|
-
await unitSelect.selectOption({ value: timeUnit });
|
|
429
|
+
await this.selectByValue(unitSelect, timeUnit);
|
|
467
430
|
}
|
|
468
431
|
}
|
|
469
432
|
async applyPrevalueSourceSettingViaNodeSelector(labelText, settingValue) {
|
|
470
|
-
const container = this.page.locator(
|
|
471
|
-
await
|
|
433
|
+
const container = this.page.locator(`umb-property[alias="${labelText}"]`);
|
|
434
|
+
await this.waitForVisible(container);
|
|
472
435
|
const rootNode = container.locator('uui-button[label="Specify root node"]');
|
|
473
|
-
await
|
|
474
|
-
await
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
await (0, test_1.expect)(value).toBeVisible();
|
|
478
|
-
await value.click();
|
|
436
|
+
await this.click(rootNode);
|
|
437
|
+
await this.waitForVisible(this.prevalueSourceOriginModal);
|
|
438
|
+
const value = this.prevalueSourceOriginModal.locator(`umb-ref-item[name="${settingValue}"]`);
|
|
439
|
+
await this.click(value);
|
|
479
440
|
}
|
|
480
441
|
async checkPrevalueSourceTypeLabel() {
|
|
481
|
-
await
|
|
442
|
+
await this.waitForVisible(this.prevalueSourceTypeLabel);
|
|
482
443
|
}
|
|
483
444
|
}
|
|
484
445
|
exports.FormsUiHelper = FormsUiHelper;
|