@bigbinary/neeto-playwright-commons 1.17.8 → 1.18.0
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 +94 -15
- package/index.cjs.js.map +1 -1
- package/index.d.ts +70 -1
- package/index.js +93 -16
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -330,6 +330,8 @@ const COMMON_SELECTORS = {
|
|
|
330
330
|
modalForever: "modal-footer",
|
|
331
331
|
navigationHeader: "navigation-header",
|
|
332
332
|
buttonSpinner: ".neeto-ui-btn__spinner",
|
|
333
|
+
pendingTagContainer: "pending-tag-container",
|
|
334
|
+
nextYearButton: "next-year-button",
|
|
333
335
|
customSelectValueContainer: (label = "nui") => `${hyphenize(label)}-select-value-container`,
|
|
334
336
|
customDropDownMenu: (label = "nui") => `${hyphenize(label)}-select-menu`,
|
|
335
337
|
popoverTitle: "popover-title",
|
|
@@ -21296,6 +21298,39 @@ const i18nFixture = {
|
|
|
21296
21298
|
],
|
|
21297
21299
|
};
|
|
21298
21300
|
|
|
21301
|
+
const ADMIN_PANEL_SELECTORS = {
|
|
21302
|
+
settingsItemHeading: "settings-item-heading",
|
|
21303
|
+
settingsItemDescription: "settings-item-description",
|
|
21304
|
+
expiryDateInput: "expiry-date-input",
|
|
21305
|
+
};
|
|
21306
|
+
const CUSTOM_DOMAIN_SELECTORS = {
|
|
21307
|
+
addCustomDomainButton: "add-new-custom-domain-button",
|
|
21308
|
+
customDomainInputField: "custom-domain-input-field",
|
|
21309
|
+
submitCustomDomainButton: "submit-custom-domain-button",
|
|
21310
|
+
customDomainValidateButton: "validate-domain-button",
|
|
21311
|
+
moreDropdownButton: "custom-domains-more-dropdown-button",
|
|
21312
|
+
editCustomDomainButton: "edit-custom-domain-button",
|
|
21313
|
+
deleteCustomDomainButton: "delete-custom-domain-button",
|
|
21314
|
+
};
|
|
21315
|
+
const API_KEYS_SELECTORS = {
|
|
21316
|
+
editApiKeyButton: "api-key-edit-button",
|
|
21317
|
+
deleteApiKeyButton: "api-key-delete-button",
|
|
21318
|
+
addApiKeyButton: "add-api-key-button",
|
|
21319
|
+
};
|
|
21320
|
+
|
|
21321
|
+
class AdminPanelPage {
|
|
21322
|
+
constructor(page, neetoPlaywrightUtilities) {
|
|
21323
|
+
this.verifyAdminPanelCard = ({ cardLocator, title, description, }) => Promise.all([
|
|
21324
|
+
test$1.expect(cardLocator.getByTestId(ADMIN_PANEL_SELECTORS.settingsItemHeading)).toHaveText(title),
|
|
21325
|
+
test$1.expect(cardLocator.getByTestId(ADMIN_PANEL_SELECTORS.settingsItemDescription)).toHaveText(description),
|
|
21326
|
+
test$1.expect(this.page.getByTestId(COMMON_SELECTORS.sidebarSubLink(title))).toHaveCSS("background-color", COLOR.transparent),
|
|
21327
|
+
]);
|
|
21328
|
+
this.page = page;
|
|
21329
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
21330
|
+
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
21331
|
+
}
|
|
21332
|
+
}
|
|
21333
|
+
|
|
21299
21334
|
class ThankYouPage {
|
|
21300
21335
|
constructor(page, neetoPlaywrightUtilities) {
|
|
21301
21336
|
this.navigateToThankYouPage = async () => {
|
|
@@ -25087,9 +25122,8 @@ class TeamMembers {
|
|
|
25087
25122
|
.getByTestId(NEETO_FILTERS_SELECTORS.filterDoneButton)
|
|
25088
25123
|
.click();
|
|
25089
25124
|
};
|
|
25090
|
-
|
|
25091
|
-
|
|
25092
|
-
name: IS_STAGING_ENV ? name : `avatar--${name}`,
|
|
25125
|
+
this.getMemberRowByName = (name) => this.page.getByRole("row").filter({
|
|
25126
|
+
has: this.page.getByTestId(MEMBER_SELECTORS.memberNameCell(name)),
|
|
25093
25127
|
});
|
|
25094
25128
|
this.takeActionOnMembers = async ({ names = [], state, action, }) => {
|
|
25095
25129
|
if (neetoCist.isPresent(names)) {
|
|
@@ -25414,12 +25448,6 @@ class OrganizationPage {
|
|
|
25414
25448
|
}
|
|
25415
25449
|
}
|
|
25416
25450
|
|
|
25417
|
-
const ADMIN_PANEL_SELECTORS = {
|
|
25418
|
-
settingsItemHeading: "settings-item-heading",
|
|
25419
|
-
settingsItemDescription: "settings-item-description",
|
|
25420
|
-
expiryDateInput: "expiry-date-input",
|
|
25421
|
-
};
|
|
25422
|
-
|
|
25423
25451
|
class ApiKeysPage {
|
|
25424
25452
|
constructor(page, neetoPlaywrightUtilities) {
|
|
25425
25453
|
this.fillApiKeyDetails = async ({ label, expiryDate }) => {
|
|
@@ -25435,7 +25463,7 @@ class ApiKeysPage {
|
|
|
25435
25463
|
.getByTestId(COMMON_SELECTORS.paneBody)
|
|
25436
25464
|
.getByTestId(ADMIN_PANEL_SELECTORS.expiryDateInput)
|
|
25437
25465
|
.click();
|
|
25438
|
-
//TODO: Use data-cy labels when this https://github.com/bigbinary/neeto-
|
|
25466
|
+
//TODO: Use data-cy labels when this https://github.com/bigbinary/neeto-playwright-commons/issues/602 is resolved
|
|
25439
25467
|
await this.page.getByLabel(DATE_TEXTS.nextYear, { exact: true }).click();
|
|
25440
25468
|
await this.page.getByText(expiryDate, { exact: true }).click();
|
|
25441
25469
|
}
|
|
@@ -25451,19 +25479,17 @@ class ApiKeysPage {
|
|
|
25451
25479
|
})).toBeVisible(),
|
|
25452
25480
|
]);
|
|
25453
25481
|
this.editApiKey = async ({ label, expiryDate }) => {
|
|
25454
|
-
//TODO: Use data-cy labels when this https://github.com/bigbinary/neeto-kb-playwright/issues/46 is resolved
|
|
25455
25482
|
await this.page
|
|
25456
25483
|
.getByTestId(COMMON_SELECTORS.dropdownContainer)
|
|
25457
|
-
.
|
|
25484
|
+
.getByTestId(API_KEYS_SELECTORS.editApiKeyButton)
|
|
25458
25485
|
.click();
|
|
25459
25486
|
await this.fillApiKeyDetails({ label, expiryDate });
|
|
25460
25487
|
};
|
|
25461
25488
|
this.deleteApiKey = async (targetRow) => {
|
|
25462
25489
|
await targetRow.getByTestId(COMMON_SELECTORS.dropdownIcon).click();
|
|
25463
|
-
//TODO: Use data-cy labels when this https://github.com/bigbinary/neeto-kb-playwright/issues/46 is resolved
|
|
25464
25490
|
await this.page
|
|
25465
25491
|
.getByTestId(COMMON_SELECTORS.dropdownContainer)
|
|
25466
|
-
.
|
|
25492
|
+
.getByTestId(API_KEYS_SELECTORS.deleteApiKeyButton)
|
|
25467
25493
|
.click();
|
|
25468
25494
|
await this.page
|
|
25469
25495
|
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
@@ -25516,6 +25542,48 @@ class AuditLogsPage {
|
|
|
25516
25542
|
}
|
|
25517
25543
|
}
|
|
25518
25544
|
|
|
25545
|
+
class CustomDomainPage {
|
|
25546
|
+
constructor(page, neetoPlaywrightUtilities) {
|
|
25547
|
+
this.addCustomDomainViaUI = async (domainName) => {
|
|
25548
|
+
const addCustomDomainButton = this.page.getByTestId(CUSTOM_DOMAIN_SELECTORS.addCustomDomainButton);
|
|
25549
|
+
await test$1.expect(addCustomDomainButton).toBeVisible();
|
|
25550
|
+
(await addCustomDomainButton.isDisabled()) &&
|
|
25551
|
+
(await this.deleteCustomDomainViaUI());
|
|
25552
|
+
await addCustomDomainButton.click();
|
|
25553
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.paneBody)).toBeVisible();
|
|
25554
|
+
await this.page
|
|
25555
|
+
.getByTestId(CUSTOM_DOMAIN_SELECTORS.customDomainInputField)
|
|
25556
|
+
.fill(domainName);
|
|
25557
|
+
await this.page
|
|
25558
|
+
.getByTestId(CUSTOM_DOMAIN_SELECTORS.submitCustomDomainButton)
|
|
25559
|
+
.click();
|
|
25560
|
+
await test$1.expect(this.page.getByTestId(CUSTOM_DOMAIN_SELECTORS.customDomainValidateButton)).toBeVisible();
|
|
25561
|
+
await this.page.getByTestId(COMMON_SELECTORS.paneModalCrossIcon).click();
|
|
25562
|
+
await Promise.all([
|
|
25563
|
+
test$1.expect(this.page.getByTestId(COMMON_SELECTORS.paneBody)).toBeHidden(),
|
|
25564
|
+
test$1.expect(addCustomDomainButton).toBeDisabled(),
|
|
25565
|
+
test$1.expect(this.page.getByTestId(COMMON_SELECTORS.pendingTagContainer)).toBeVisible(),
|
|
25566
|
+
test$1.expect(this.page.getByTestId(COMMON_SELECTORS.paneBody).getByText(domainName)).toBeVisible(),
|
|
25567
|
+
]);
|
|
25568
|
+
};
|
|
25569
|
+
this.deleteCustomDomainViaUI = async () => {
|
|
25570
|
+
await this.page.getByTestId(COMMON_SELECTORS.dropdownIcon).click();
|
|
25571
|
+
await this.page
|
|
25572
|
+
.getByTestId(CUSTOM_DOMAIN_SELECTORS.deleteCustomDomainButton)
|
|
25573
|
+
.click();
|
|
25574
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.alertTitle)).toHaveText(this.t("neetoCustomDomains.delete"));
|
|
25575
|
+
await this.page
|
|
25576
|
+
.getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
|
|
25577
|
+
.click();
|
|
25578
|
+
await this.neetoPlaywrightUtilities.verifyToast();
|
|
25579
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible();
|
|
25580
|
+
};
|
|
25581
|
+
this.page = page;
|
|
25582
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
25583
|
+
this.t = playwrightI18nextFixture.getI18nInstance().t;
|
|
25584
|
+
}
|
|
25585
|
+
}
|
|
25586
|
+
|
|
25519
25587
|
class RoleApis {
|
|
25520
25588
|
constructor(neetoPlaywrightUtilities) {
|
|
25521
25589
|
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
@@ -25875,6 +25943,11 @@ const verifyFreezeColumnAction = async (page, t) => {
|
|
|
25875
25943
|
columnHeader.getByRole("checkbox").isVisible(),
|
|
25876
25944
|
]);
|
|
25877
25945
|
const columnOffset = checkboxVisible ? 1 : 0;
|
|
25946
|
+
const moreThanFiveColumns = columnHeaders.length > 5;
|
|
25947
|
+
moreThanFiveColumns &&
|
|
25948
|
+
(await page.evaluate(() => {
|
|
25949
|
+
document.body.style.zoom = "0.25";
|
|
25950
|
+
}));
|
|
25878
25951
|
await unFreezeAllColumns({ columnHeaders, columnOffset, page, t });
|
|
25879
25952
|
await toggleColumnState({ columnHeaders, columnOffset, page });
|
|
25880
25953
|
await validateColumnNames(columnHeaders, columnOffset, originalColumnNames);
|
|
@@ -25885,6 +25958,10 @@ const verifyFreezeColumnAction = async (page, t) => {
|
|
|
25885
25958
|
page,
|
|
25886
25959
|
});
|
|
25887
25960
|
await test$1.expect(columnHeader).toHaveText(originalColumnNames);
|
|
25961
|
+
moreThanFiveColumns &&
|
|
25962
|
+
(await page.evaluate(() => {
|
|
25963
|
+
document.body.style.zoom = "1";
|
|
25964
|
+
}));
|
|
25888
25965
|
};
|
|
25889
25966
|
const unFreezeAllColumns = async ({ columnHeaders, columnOffset, page, t, }) => {
|
|
25890
25967
|
const unFreezeColumnButton = page
|
|
@@ -25912,7 +25989,7 @@ const toggleColumnState = async ({ columnHeaders, columnOffset, action = "Freeze
|
|
|
25912
25989
|
for (let i = firstColumnIndex; i < lastColumnIndex; i++) {
|
|
25913
25990
|
const columnHeader = columnHeaders[targetIndex];
|
|
25914
25991
|
(await page.getByTestId(COMMON_SELECTORS.tooltip).isVisible()) &&
|
|
25915
|
-
(await page.
|
|
25992
|
+
(await page.mouse.move(0, 0));
|
|
25916
25993
|
await columnHeader.getByTestId(TABLE_SELECTORS.columnMenuButton).click();
|
|
25917
25994
|
await toggleButton.click();
|
|
25918
25995
|
}
|
|
@@ -158967,6 +159044,7 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
158967
159044
|
|
|
158968
159045
|
exports.API_ROUTES = API_ROUTES;
|
|
158969
159046
|
exports.AUDIT_LOGS_TEXTS = AUDIT_LOGS_TEXTS;
|
|
159047
|
+
exports.AdminPanelPage = AdminPanelPage;
|
|
158970
159048
|
exports.ApiKeysPage = ApiKeysPage;
|
|
158971
159049
|
exports.AuditLogsPage = AuditLogsPage;
|
|
158972
159050
|
exports.BASE_URL = BASE_URL;
|
|
@@ -158978,6 +159056,7 @@ exports.COMMON_SELECTORS = COMMON_SELECTORS;
|
|
|
158978
159056
|
exports.COMMON_TEXTS = COMMON_TEXTS;
|
|
158979
159057
|
exports.CREDENTIALS = CREDENTIALS;
|
|
158980
159058
|
exports.CustomCommands = CustomCommands;
|
|
159059
|
+
exports.CustomDomainsPage = CustomDomainPage;
|
|
158981
159060
|
exports.DATE_TEXTS = DATE_TEXTS;
|
|
158982
159061
|
exports.DESCRIPTION_EDITOR_TEXTS = DESCRIPTION_EDITOR_TEXTS;
|
|
158983
159062
|
exports.EMBED_SELECTORS = EMBED_SELECTORS;
|