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