@bigbinary/neeto-playwright-commons 1.9.12 → 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 +155 -29
- package/index.cjs.js.map +1 -1
- package/index.d.ts +72 -2
- package/index.js +155 -30
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -14888,8 +14888,9 @@ const MEMBER_FORM_SELECTORS = {
|
|
|
14888
14888
|
|
|
14889
14889
|
class TeamMembers {
|
|
14890
14890
|
constructor({ page, neetoPlaywrightUtilities, }) {
|
|
14891
|
-
this.navigateToTeamMembersSublink = async (sublink = "all") => {
|
|
14892
|
-
|
|
14891
|
+
this.navigateToTeamMembersSublink = async ({ clickMembersTab = true, sublink = "all", } = {}) => {
|
|
14892
|
+
clickMembersTab &&
|
|
14893
|
+
(await this.page.getByTestId(MEMBER_SELECTORS.membersTab).click());
|
|
14893
14894
|
await this.page
|
|
14894
14895
|
.getByTestId(MEMBER_SELECTORS.menubarSubLink(sublink))
|
|
14895
14896
|
.click();
|
|
@@ -14901,12 +14902,14 @@ class TeamMembers {
|
|
|
14901
14902
|
.getByTestId(MEMBER_FORM_SELECTORS.emailTextField)
|
|
14902
14903
|
.fill(emails.join(", "));
|
|
14903
14904
|
await this.page.getByTestId(MEMBER_SELECTORS.roleLabel(role)).click();
|
|
14904
|
-
|
|
14905
|
-
|
|
14905
|
+
await this.page.getByTestId(MEMBER_SELECTORS.continueButton).click();
|
|
14906
|
+
if (IS_STAGING_ENV) {
|
|
14907
|
+
await this.page
|
|
14906
14908
|
.getByTestId(COMMON_SELECTORS.paneBody)
|
|
14907
14909
|
.getByTestId(COMMON_SELECTORS.checkboxLabel)
|
|
14908
|
-
.click()
|
|
14909
|
-
|
|
14910
|
+
.click();
|
|
14911
|
+
await this.page.getByTestId(MEMBER_SELECTORS.continueButton).click();
|
|
14912
|
+
}
|
|
14910
14913
|
await this.page.getByTestId(MEMBER_SELECTORS.submitButton).click();
|
|
14911
14914
|
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
14912
14915
|
await this.neetoPlaywrightUtilities.verifySuccessToast();
|
|
@@ -15002,7 +15005,9 @@ class TeamMembers {
|
|
|
15002
15005
|
.click();
|
|
15003
15006
|
};
|
|
15004
15007
|
// TODO: Change the selector after this issue is resolved: https://github.com/bigbinary/neeto-team-members-nano/issues/258
|
|
15005
|
-
this.getMemberRowByName = (name) => this.page.getByRole("row", {
|
|
15008
|
+
this.getMemberRowByName = (name) => this.page.getByRole("row", {
|
|
15009
|
+
name: IS_STAGING_ENV ? name : `avatar--${name}`,
|
|
15010
|
+
});
|
|
15006
15011
|
this.takeActionOnMembers = async ({ names = [], state, action, }) => {
|
|
15007
15012
|
if (neetoCist.isPresent(names)) {
|
|
15008
15013
|
for (const name of names) {
|
|
@@ -15352,6 +15357,148 @@ class SidebarSection {
|
|
|
15352
15357
|
}
|
|
15353
15358
|
}
|
|
15354
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
|
+
|
|
15355
15502
|
const USER_AGENTS = {
|
|
15356
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",
|
|
15357
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",
|
|
@@ -15398,28 +15545,6 @@ const ROLES_SELECTORS = {
|
|
|
15398
15545
|
permissionCard: "ntm-roles-permission-card",
|
|
15399
15546
|
};
|
|
15400
15547
|
|
|
15401
|
-
const TAGS_SELECTORS = {
|
|
15402
|
-
newTagButton: "add-new-tag-button",
|
|
15403
|
-
tagNameTextField: "tag-name-text-field",
|
|
15404
|
-
editButton: "tags-edit-button",
|
|
15405
|
-
deleteButton: "tags-delete-button",
|
|
15406
|
-
cancelButton: "neeto-tags-manage-tag-cancel-button",
|
|
15407
|
-
submitButton: "neeto-tags-manage-tag-submit-button",
|
|
15408
|
-
searchTextField: "neeto-tags-search-text-input-field",
|
|
15409
|
-
descriptionTextArea: "tag-description-text-area",
|
|
15410
|
-
};
|
|
15411
|
-
const MERGE_TAGS_SELECTORS = {
|
|
15412
|
-
mergeTagsButton: "neeto-tags-merge-tags-button",
|
|
15413
|
-
mergeButton: "neeto-tags-merge-button",
|
|
15414
|
-
sourceSearchTextField: "neeto-tags-merge-source-search-text-input-field",
|
|
15415
|
-
sourceTagsList: "neeto-tags-merge-source-tags-list",
|
|
15416
|
-
destinationTagsList: "neeto-tags-merge-destination-tags-list",
|
|
15417
|
-
destinationSearchTextField: "neeto-tags-merge-destination-search-text-input-field",
|
|
15418
|
-
cancelButton: "neeto-tags-merge-cancel-button",
|
|
15419
|
-
proceedButton: "neeto-tags-merge-proceed-button",
|
|
15420
|
-
disabledTag: ".neeto-ui-cursor-not-allowed",
|
|
15421
|
-
};
|
|
15422
|
-
|
|
15423
15548
|
const initializeCredentials = (product) => {
|
|
15424
15549
|
var _a;
|
|
15425
15550
|
if (process.env.SKIP_SETUP === "true" && getGlobalUserState()) {
|
|
@@ -149095,6 +149220,7 @@ exports.TEXT_MODIFIER_SELECTORS = TEXT_MODIFIER_SELECTORS;
|
|
|
149095
149220
|
exports.TEXT_MODIFIER_TAGS = TEXT_MODIFIER_TAGS;
|
|
149096
149221
|
exports.THIRD_PARTY_ROUTES = THIRD_PARTY_ROUTES;
|
|
149097
149222
|
exports.TOASTR_MESSAGES = TOASTR_MESSAGES;
|
|
149223
|
+
exports.TagsPage = TagsPage;
|
|
149098
149224
|
exports.TeamMembers = TeamMembers;
|
|
149099
149225
|
exports.USER_AGENTS = USER_AGENTS;
|
|
149100
149226
|
exports.WebhooksPage = WebhooksPage;
|