@bigbinary/neeto-playwright-commons 1.9.13 → 1.9.14
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/index.cjs.js +143 -22
- package/index.cjs.js.map +1 -1
- package/index.d.ts +65 -1
- package/index.js +143 -23
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -15357,6 +15357,148 @@ class SidebarSection {
|
|
|
15357
15357
|
}
|
|
15358
15358
|
}
|
|
15359
15359
|
|
|
15360
|
+
const TAGS_SELECTORS = {
|
|
15361
|
+
newTagButton: "add-new-tag-button",
|
|
15362
|
+
tagNameTextField: "tag-name-text-field",
|
|
15363
|
+
editButton: "tags-edit-button",
|
|
15364
|
+
deleteButton: "tags-delete-button",
|
|
15365
|
+
cancelButton: "neeto-tags-manage-tag-cancel-button",
|
|
15366
|
+
submitButton: "neeto-tags-manage-tag-submit-button",
|
|
15367
|
+
searchTextField: "neeto-tags-search-text-input-field",
|
|
15368
|
+
descriptionTextArea: "tag-description-text-area",
|
|
15369
|
+
addTagButton: "neeto-tags-add-tag-button",
|
|
15370
|
+
tagSearchField: "select-tag-container",
|
|
15371
|
+
deleteTagButton: "tag-close-icon",
|
|
15372
|
+
metaDataCard: "metadata-card",
|
|
15373
|
+
metaDataBlock: "metadata-block",
|
|
15374
|
+
tagContainer: "tag-container",
|
|
15375
|
+
ticketTagsBreadcrumb: "ticket-tags-breadcrumb",
|
|
15376
|
+
};
|
|
15377
|
+
const MERGE_TAGS_SELECTORS = {
|
|
15378
|
+
mergeTagsButton: "neeto-tags-merge-tags-button",
|
|
15379
|
+
mergeButton: "neeto-tags-merge-button",
|
|
15380
|
+
sourceSearchTextField: "neeto-tags-merge-source-search-text-input-field",
|
|
15381
|
+
sourceTagsList: "neeto-tags-merge-source-tags-list",
|
|
15382
|
+
destinationTagsList: "neeto-tags-merge-destination-tags-list",
|
|
15383
|
+
destinationSearchTextField: "neeto-tags-merge-destination-search-text-input-field",
|
|
15384
|
+
cancelButton: "neeto-tags-merge-cancel-button",
|
|
15385
|
+
proceedButton: "neeto-tags-merge-proceed-button",
|
|
15386
|
+
disabledTag: ".neeto-ui-cursor-not-allowed",
|
|
15387
|
+
sourceTagRow: "neeto-tags-merge-source-tags",
|
|
15388
|
+
destinationTagRow: "neeto-tags-merge-destination-tags",
|
|
15389
|
+
};
|
|
15390
|
+
|
|
15391
|
+
class TagsPage {
|
|
15392
|
+
constructor(page, neetoPlaywrightUtilities) {
|
|
15393
|
+
this.searchAndVerifyTags = async (tagName) => {
|
|
15394
|
+
await this.page.getByTestId(TAGS_SELECTORS.searchTextField).fill(tagName);
|
|
15395
|
+
await test$1.expect(this.page.getByRole("row", { name: tagName })).toBeVisible();
|
|
15396
|
+
};
|
|
15397
|
+
this.addTagViaUI = async ({ tagName, addTagsLabel, tagsResponseUrl, }) => {
|
|
15398
|
+
await this.page
|
|
15399
|
+
.getByTestId(COMMON_SELECTORS.header)
|
|
15400
|
+
.getByTestId(TAGS_SELECTORS.newTagButton)
|
|
15401
|
+
.click();
|
|
15402
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.paneHeader)).toHaveText(addTagsLabel);
|
|
15403
|
+
await this.page.getByTestId(TAGS_SELECTORS.tagNameTextField).fill(tagName);
|
|
15404
|
+
await this.page
|
|
15405
|
+
.getByTestId(TAGS_SELECTORS.descriptionTextArea)
|
|
15406
|
+
.fill(faker.faker.lorem.word(7));
|
|
15407
|
+
const waitForSave = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
15408
|
+
responseUrl: tagsResponseUrl,
|
|
15409
|
+
});
|
|
15410
|
+
await this.page.getByTestId(TAGS_SELECTORS.submitButton).click();
|
|
15411
|
+
await waitForSave;
|
|
15412
|
+
await this.neetoPlaywrightUtilities.verifySuccessToast();
|
|
15413
|
+
await this.searchAndVerifyTags(tagName);
|
|
15414
|
+
};
|
|
15415
|
+
this.filterTagsViaUI = async (tagName) => {
|
|
15416
|
+
await this.page
|
|
15417
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
15418
|
+
.click();
|
|
15419
|
+
await this.page.getByTestId(NEETO_FILTERS_SELECTORS.filterButton).click();
|
|
15420
|
+
await this.page
|
|
15421
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersNameFilterField)
|
|
15422
|
+
.fill(tagName);
|
|
15423
|
+
await this.page.waitForURL(new RegExp(tagName));
|
|
15424
|
+
await this.page
|
|
15425
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.filterDoneButton)
|
|
15426
|
+
.click();
|
|
15427
|
+
await test$1.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFilterNameBlock)).toBeVisible();
|
|
15428
|
+
await test$1.expect(this.page.getByRole("row", { name: tagName })).toBeVisible();
|
|
15429
|
+
await this.page
|
|
15430
|
+
.getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersBarClearButton)
|
|
15431
|
+
.click();
|
|
15432
|
+
await test$1.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.neetoFilterNameBlock)).toBeHidden();
|
|
15433
|
+
};
|
|
15434
|
+
this.editTagViaUI = async ({ tagName, newTagName, }) => {
|
|
15435
|
+
await this.page
|
|
15436
|
+
.getByRole("row", { name: tagName })
|
|
15437
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
15438
|
+
.click();
|
|
15439
|
+
await this.page.getByTestId(TAGS_SELECTORS.editButton).click();
|
|
15440
|
+
await this.page
|
|
15441
|
+
.getByTestId(TAGS_SELECTORS.tagNameTextField)
|
|
15442
|
+
.fill(newTagName);
|
|
15443
|
+
await this.page.getByTestId(TAGS_SELECTORS.submitButton).click();
|
|
15444
|
+
await this.neetoPlaywrightUtilities.verifySuccessToast();
|
|
15445
|
+
await test$1.expect(this.page.getByRole("row", { name: tagName })).toBeHidden();
|
|
15446
|
+
await test$1.expect(this.page.getByRole("row", { name: newTagName })).toBeVisible();
|
|
15447
|
+
};
|
|
15448
|
+
this.deleteTagViaUI = async (tagName) => {
|
|
15449
|
+
await this.page
|
|
15450
|
+
.getByRole("row", { name: tagName })
|
|
15451
|
+
.getByTestId(COMMON_SELECTORS.dropdownIcon)
|
|
15452
|
+
.click();
|
|
15453
|
+
await this.page.getByTestId(TAGS_SELECTORS.deleteButton).click();
|
|
15454
|
+
await this.page
|
|
15455
|
+
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
15456
|
+
.click();
|
|
15457
|
+
await this.neetoPlaywrightUtilities.verifySuccessToast();
|
|
15458
|
+
await test$1.expect(this.page.getByRole("row", { name: tagName })).toBeHidden();
|
|
15459
|
+
};
|
|
15460
|
+
this.addTagsViaResponse = ({ name, description, tagsResponseUrl, }) => this.neetoPlaywrightUtilities.apiRequest({
|
|
15461
|
+
url: tagsResponseUrl,
|
|
15462
|
+
body: { name, description },
|
|
15463
|
+
method: "post",
|
|
15464
|
+
});
|
|
15465
|
+
this.navigateToMergeTagsPage = async (mergeTagsLabel) => {
|
|
15466
|
+
await this.page.getByTestId(MERGE_TAGS_SELECTORS.mergeTagsButton).click();
|
|
15467
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
15468
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.heading)).toHaveText(mergeTagsLabel);
|
|
15469
|
+
};
|
|
15470
|
+
this.searchAndSelect = async ({ selector, tagName, rowSelector, }) => {
|
|
15471
|
+
await this.page.getByTestId(selector).fill(tagName);
|
|
15472
|
+
await this.page
|
|
15473
|
+
.getByTestId(rowSelector)
|
|
15474
|
+
.filter({ hasText: tagName })
|
|
15475
|
+
.click();
|
|
15476
|
+
};
|
|
15477
|
+
this.mergeTagsViaUI = async ({ sourceTagName, destinationTagName, mergeTagsLabel, }) => {
|
|
15478
|
+
await this.searchAndSelect({
|
|
15479
|
+
selector: MERGE_TAGS_SELECTORS.sourceSearchTextField,
|
|
15480
|
+
tagName: sourceTagName,
|
|
15481
|
+
rowSelector: MERGE_TAGS_SELECTORS.sourceTagRow,
|
|
15482
|
+
});
|
|
15483
|
+
await this.searchAndSelect({
|
|
15484
|
+
selector: MERGE_TAGS_SELECTORS.destinationSearchTextField,
|
|
15485
|
+
tagName: destinationTagName,
|
|
15486
|
+
rowSelector: MERGE_TAGS_SELECTORS.destinationTagRow,
|
|
15487
|
+
});
|
|
15488
|
+
await this.page.getByTestId(MERGE_TAGS_SELECTORS.mergeButton).click();
|
|
15489
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.modalHeader)).toHaveText(mergeTagsLabel);
|
|
15490
|
+
await this.page.getByTestId(MERGE_TAGS_SELECTORS.proceedButton).click();
|
|
15491
|
+
await this.neetoPlaywrightUtilities.verifySuccessToast();
|
|
15492
|
+
await this.page.getByTestId(TAGS_SELECTORS.ticketTagsBreadcrumb).click();
|
|
15493
|
+
await test$1.expect(this.page.getByText(sourceTagName)).toBeHidden();
|
|
15494
|
+
await test$1.expect(this.page.getByText(destinationTagName)).toBeVisible();
|
|
15495
|
+
};
|
|
15496
|
+
this.page = page;
|
|
15497
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
15498
|
+
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
15499
|
+
}
|
|
15500
|
+
}
|
|
15501
|
+
|
|
15360
15502
|
const USER_AGENTS = {
|
|
15361
15503
|
windows: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
|
|
15362
15504
|
mac: "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
|
|
@@ -15403,28 +15545,6 @@ const ROLES_SELECTORS = {
|
|
|
15403
15545
|
permissionCard: "ntm-roles-permission-card",
|
|
15404
15546
|
};
|
|
15405
15547
|
|
|
15406
|
-
const TAGS_SELECTORS = {
|
|
15407
|
-
newTagButton: "add-new-tag-button",
|
|
15408
|
-
tagNameTextField: "tag-name-text-field",
|
|
15409
|
-
editButton: "tags-edit-button",
|
|
15410
|
-
deleteButton: "tags-delete-button",
|
|
15411
|
-
cancelButton: "neeto-tags-manage-tag-cancel-button",
|
|
15412
|
-
submitButton: "neeto-tags-manage-tag-submit-button",
|
|
15413
|
-
searchTextField: "neeto-tags-search-text-input-field",
|
|
15414
|
-
descriptionTextArea: "tag-description-text-area",
|
|
15415
|
-
};
|
|
15416
|
-
const MERGE_TAGS_SELECTORS = {
|
|
15417
|
-
mergeTagsButton: "neeto-tags-merge-tags-button",
|
|
15418
|
-
mergeButton: "neeto-tags-merge-button",
|
|
15419
|
-
sourceSearchTextField: "neeto-tags-merge-source-search-text-input-field",
|
|
15420
|
-
sourceTagsList: "neeto-tags-merge-source-tags-list",
|
|
15421
|
-
destinationTagsList: "neeto-tags-merge-destination-tags-list",
|
|
15422
|
-
destinationSearchTextField: "neeto-tags-merge-destination-search-text-input-field",
|
|
15423
|
-
cancelButton: "neeto-tags-merge-cancel-button",
|
|
15424
|
-
proceedButton: "neeto-tags-merge-proceed-button",
|
|
15425
|
-
disabledTag: ".neeto-ui-cursor-not-allowed",
|
|
15426
|
-
};
|
|
15427
|
-
|
|
15428
15548
|
const initializeCredentials = (product) => {
|
|
15429
15549
|
var _a;
|
|
15430
15550
|
if (process.env.SKIP_SETUP === "true" && getGlobalUserState()) {
|
|
@@ -149100,6 +149220,7 @@ exports.TEXT_MODIFIER_SELECTORS = TEXT_MODIFIER_SELECTORS;
|
|
|
149100
149220
|
exports.TEXT_MODIFIER_TAGS = TEXT_MODIFIER_TAGS;
|
|
149101
149221
|
exports.THIRD_PARTY_ROUTES = THIRD_PARTY_ROUTES;
|
|
149102
149222
|
exports.TOASTR_MESSAGES = TOASTR_MESSAGES;
|
|
149223
|
+
exports.TagsPage = TagsPage;
|
|
149103
149224
|
exports.TeamMembers = TeamMembers;
|
|
149104
149225
|
exports.USER_AGENTS = USER_AGENTS;
|
|
149105
149226
|
exports.WebhooksPage = WebhooksPage;
|