@bigbinary/neeto-playwright-commons 1.8.11 → 1.8.13
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 +43 -139
- package/index.cjs.js.map +1 -1
- package/index.d.ts +18 -12
- package/index.js +43 -140
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -187,6 +187,8 @@ const COMMON_SELECTORS = {
|
|
|
187
187
|
homeButton: "home-button",
|
|
188
188
|
neetoUiSwitch: "nui-switch",
|
|
189
189
|
floatingActionMenuButton: "floating-action-menu-container",
|
|
190
|
+
columnsDropdownContainer: "columns-dropdown-container",
|
|
191
|
+
columnsDropdownButton: "columns-dropdown-button",
|
|
190
192
|
};
|
|
191
193
|
|
|
192
194
|
class CustomCommands {
|
|
@@ -7382,20 +7384,6 @@ class HelpAndProfilePage {
|
|
|
7382
7384
|
await test.expect(this.neetoChatFrame.getByTestId(CHAT_WIDGET_SELECTORS.chatBubble)).toHaveText(CHAT_WIDGET_TEXTS.welcomeChatBubble);
|
|
7383
7385
|
});
|
|
7384
7386
|
};
|
|
7385
|
-
// TODO Remove when all apps have migrated to the new navbar style
|
|
7386
|
-
this.openAndVerifyHelpArticles = async () => {
|
|
7387
|
-
await test.test.step("Step 1: Open Help Center links", this.openHelpCenter);
|
|
7388
|
-
await test.test.step("Step 2: Open and verify help articles link", async () => {
|
|
7389
|
-
const helpArticlesPromise = this.page.waitForEvent("popup");
|
|
7390
|
-
await this.page
|
|
7391
|
-
.getByTestId(HELP_CENTER_SELECTORS.documentationButton)
|
|
7392
|
-
.click();
|
|
7393
|
-
const helpArticlesPage = await helpArticlesPromise;
|
|
7394
|
-
await helpArticlesPage.waitForLoadState();
|
|
7395
|
-
await test.expect(helpArticlesPage).toHaveURL(this.kbDocsBaseURL);
|
|
7396
|
-
await helpArticlesPage.close();
|
|
7397
|
-
});
|
|
7398
|
-
};
|
|
7399
7387
|
this.openAndVerifyHelpArticlesV2 = async () => {
|
|
7400
7388
|
await test.test.step("Step 1: Open Help Center links", this.openHelpCenterV2);
|
|
7401
7389
|
await test.test.step("Step 2: Open and verify help articles link", async () => {
|
|
@@ -7409,13 +7397,6 @@ class HelpAndProfilePage {
|
|
|
7409
7397
|
await helpArticlesPage.close();
|
|
7410
7398
|
});
|
|
7411
7399
|
};
|
|
7412
|
-
// TODO Remove when all apps have migrated to the new navbar style
|
|
7413
|
-
this.openChangelogPane = async () => {
|
|
7414
|
-
await test.expect(async () => {
|
|
7415
|
-
await this.page.getByTestId(HELP_CENTER_SELECTORS.whatsNewButton).click();
|
|
7416
|
-
await test.expect(this.page.locator(CHANGELOG_WIDGET_SELECTORS.changelogWrapper)).toBeVisible();
|
|
7417
|
-
}).toPass({ timeout: 15000 });
|
|
7418
|
-
};
|
|
7419
7400
|
this.openChangelogPaneV2 = async () => {
|
|
7420
7401
|
await test.expect(async () => {
|
|
7421
7402
|
await this.openHelpCenterV2();
|
|
@@ -7423,33 +7404,6 @@ class HelpAndProfilePage {
|
|
|
7423
7404
|
await test.expect(this.page.locator(CHANGELOG_WIDGET_SELECTORS.changelogWrapper)).toBeVisible();
|
|
7424
7405
|
}).toPass({ timeout: 45000 });
|
|
7425
7406
|
};
|
|
7426
|
-
// TODO Remove when all apps have migrated to the new navbar style
|
|
7427
|
-
this.openAndVerifyChangelog = async () => {
|
|
7428
|
-
await test.test.step("Step 1: Open Help Center links", this.openHelpCenter);
|
|
7429
|
-
await test.test.step("Step 2: Open and verify changelog pane", this.openChangelogPane);
|
|
7430
|
-
await test.test.step("Step 3: Close and reopen changelog pane", async () => {
|
|
7431
|
-
await this.page
|
|
7432
|
-
.getByTestId(CHANGELOG_WIDGET_SELECTORS.closeButton)
|
|
7433
|
-
.click();
|
|
7434
|
-
await test.expect(this.page.locator(CHANGELOG_WIDGET_SELECTORS.changelogWrapper)).toBeHidden();
|
|
7435
|
-
await this.openHelpCenter();
|
|
7436
|
-
await this.openChangelogPane();
|
|
7437
|
-
});
|
|
7438
|
-
await test.test.step("Step 4: Open and verify public URL", async () => {
|
|
7439
|
-
const changelogPagePromise = this.page.waitForEvent("popup");
|
|
7440
|
-
await this.page
|
|
7441
|
-
.getByTestId(CHANGELOG_WIDGET_SELECTORS.publicUrlLink)
|
|
7442
|
-
.click();
|
|
7443
|
-
const changelogPage = await changelogPagePromise;
|
|
7444
|
-
await this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
7445
|
-
customPageContext: changelogPage,
|
|
7446
|
-
baseUrl: this.changelogBaseURL.split("/site")[0],
|
|
7447
|
-
times: 3,
|
|
7448
|
-
});
|
|
7449
|
-
await test.expect(changelogPage).toHaveURL(this.changelogBaseURL);
|
|
7450
|
-
await changelogPage.close();
|
|
7451
|
-
});
|
|
7452
|
-
};
|
|
7453
7407
|
this.openAndVerifyChangelogV2 = async () => {
|
|
7454
7408
|
await test.test.step("Step 1: Open Help Center links and changelog", this.openChangelogPaneV2);
|
|
7455
7409
|
await test.test.step("Step 2: Close and reopen changelog pane", async () => {
|
|
@@ -7482,52 +7436,6 @@ class HelpAndProfilePage {
|
|
|
7482
7436
|
? formattedShortcut.replace(/ctrl/g, "⌘").replace(/alt/g, "opt")
|
|
7483
7437
|
: formattedShortcut;
|
|
7484
7438
|
};
|
|
7485
|
-
this.openAndVerifyKeyboardShortcutsPane = async (productShortcuts, osPlatform = "windows") => {
|
|
7486
|
-
const globalShortcuts = [
|
|
7487
|
-
{
|
|
7488
|
-
description: this.t("neetoMolecules.keyboardShortcuts.global.openKeyboardShortcutsPane"),
|
|
7489
|
-
sequence: "shift+/",
|
|
7490
|
-
},
|
|
7491
|
-
{
|
|
7492
|
-
description: this.t("neetoMolecules.keyboardShortcuts.global.close"),
|
|
7493
|
-
sequence: "esc",
|
|
7494
|
-
},
|
|
7495
|
-
{
|
|
7496
|
-
description: this.t("neetoMolecules.keyboardShortcuts.global.submitForm"),
|
|
7497
|
-
sequence: "ctrl+enter",
|
|
7498
|
-
},
|
|
7499
|
-
];
|
|
7500
|
-
const shortcuts = [...globalShortcuts, ...productShortcuts];
|
|
7501
|
-
await test.test.step("Step 1: Open Help Center", this.openHelpCenter);
|
|
7502
|
-
await test.test.step("Step 2: Open and close keyboard shortcuts from UI", async () => {
|
|
7503
|
-
await this.page
|
|
7504
|
-
.getByTestId(HELP_CENTER_SELECTORS.keyboardShortcutButton)
|
|
7505
|
-
.click();
|
|
7506
|
-
await test.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
|
|
7507
|
-
await this.page
|
|
7508
|
-
.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.closePaneButton)
|
|
7509
|
-
.click();
|
|
7510
|
-
await test.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).toHaveCSS("width", "1px");
|
|
7511
|
-
});
|
|
7512
|
-
await test.test.step("Step 3: Open and close keyboard shortcuts through shortcut", async () => {
|
|
7513
|
-
await this.page.keyboard.press("Shift+/");
|
|
7514
|
-
await test.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
|
|
7515
|
-
await this.page.keyboard.press("Escape");
|
|
7516
|
-
await test.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).toHaveCSS("width", "1px");
|
|
7517
|
-
});
|
|
7518
|
-
await test.test.step("Step 4: Verify all displayed keyboard shortcuts", async () => {
|
|
7519
|
-
await this.page.keyboard.press("Shift+/");
|
|
7520
|
-
await test.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
|
|
7521
|
-
await test.expect(this.page
|
|
7522
|
-
.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.hotKeyItem)
|
|
7523
|
-
.locator("p")).toHaveText(shortcuts.map(shortcut => shortcut.description));
|
|
7524
|
-
const formattedSequences = shortcuts.map(shortcut => this.formatKeyboardShortcut(shortcut.sequence, osPlatform));
|
|
7525
|
-
await test.expect(this.page
|
|
7526
|
-
.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.hotKeyItem)
|
|
7527
|
-
.locator("div")).toHaveText(formattedSequences);
|
|
7528
|
-
});
|
|
7529
|
-
};
|
|
7530
|
-
// TODO Remove when all apps have migrated to the new navbar style
|
|
7531
7439
|
this.openAndVerifyKeyboardShortcutsPaneV2 = async (productShortcuts, osPlatform = "windows") => {
|
|
7532
7440
|
const globalShortcuts = [
|
|
7533
7441
|
{
|
|
@@ -7573,16 +7481,6 @@ class HelpAndProfilePage {
|
|
|
7573
7481
|
.locator("div")).toHaveText(formattedSequences);
|
|
7574
7482
|
});
|
|
7575
7483
|
};
|
|
7576
|
-
// TODO Remove when all apps have migrated to the new navbar style
|
|
7577
|
-
this.openAppSwitcherAndVerify = async () => {
|
|
7578
|
-
const appSwitcher = this.page.getByTestId(COMMON_SELECTORS.appSwitcherButton);
|
|
7579
|
-
await test.test.step("Step 1: Verify hovering over app switcher opens the app switcher drawer", () => test.expect(async () => {
|
|
7580
|
-
await this.hoverOnBody();
|
|
7581
|
-
await appSwitcher.scrollIntoViewIfNeeded();
|
|
7582
|
-
await appSwitcher.hover();
|
|
7583
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.appSwitcherWrapper)).toBeVisible();
|
|
7584
|
-
}).toPass({ timeout: 15000 }));
|
|
7585
|
-
};
|
|
7586
7484
|
this.openAppSwitcherAndVerifyV2 = async () => {
|
|
7587
7485
|
await test.test.step("Step 1: Verify hovering over app switcher opens the app switcher drawer", () => test.expect(async () => {
|
|
7588
7486
|
await this.openHelpCenterV2();
|
|
@@ -7592,13 +7490,6 @@ class HelpAndProfilePage {
|
|
|
7592
7490
|
await test.expect(this.page.getByTestId(COMMON_SELECTORS.appSwitcherWrapper)).toBeVisible();
|
|
7593
7491
|
}).toPass({ timeout: 45000 }));
|
|
7594
7492
|
};
|
|
7595
|
-
// TODO Remove when all apps have migrated to the new navbar style
|
|
7596
|
-
this.openProfilePopup = () => test.expect(async () => {
|
|
7597
|
-
await this.hoverOnBody();
|
|
7598
|
-
await this.profileSectionButton.scrollIntoViewIfNeeded();
|
|
7599
|
-
await this.profileSectionButton.hover();
|
|
7600
|
-
await test.expect(this.page.getByTestId(PROFILE_SECTION_SELECTORS.profilePopup)).toBeVisible();
|
|
7601
|
-
}).toPass({ timeout: 15000 });
|
|
7602
7493
|
this.openAuthLinkAndVerify = async ({ linkSelector, redirectLink, }) => {
|
|
7603
7494
|
var _a, _b;
|
|
7604
7495
|
const profilePagePromise = this.page.waitForEvent("popup");
|
|
@@ -7609,19 +7500,6 @@ class HelpAndProfilePage {
|
|
|
7609
7500
|
await test.expect(profilePage).toHaveURL(new RegExp(redirectLink));
|
|
7610
7501
|
await profilePage.close();
|
|
7611
7502
|
};
|
|
7612
|
-
// TODO Remove when all apps have migrated to the new navbar style
|
|
7613
|
-
this.verifyProfileAndOrganizationLinks = async () => {
|
|
7614
|
-
await test.test.step("Step 1: Open Profile popup and verify", this.openProfilePopup);
|
|
7615
|
-
await test.test.step("Step 2: Open My profile link and verify", async () => this.openAuthLinkAndVerify({
|
|
7616
|
-
linkSelector: PROFILE_SECTION_SELECTORS.myProfileButton,
|
|
7617
|
-
redirectLink: ROUTES.myProfile,
|
|
7618
|
-
}));
|
|
7619
|
-
await test.test.step("Step 3: Open Profile popup and verify", this.openProfilePopup);
|
|
7620
|
-
await test.test.step("Step 4: Open My organization link and verify", async () => this.openAuthLinkAndVerify({
|
|
7621
|
-
linkSelector: PROFILE_SECTION_SELECTORS.profileOrganizationSettingsButton,
|
|
7622
|
-
redirectLink: ROUTES.authSettings,
|
|
7623
|
-
}));
|
|
7624
|
-
};
|
|
7625
7503
|
this.verifyProfileAndOrganizationLinksV2 = async () => {
|
|
7626
7504
|
await test.test.step("Step 1: Open Help center and verify", this.openHelpCenterV2);
|
|
7627
7505
|
await test.test.step("Step 2: Open My profile link and verify", async () => this.openAuthLinkAndVerify({
|
|
@@ -7634,19 +7512,6 @@ class HelpAndProfilePage {
|
|
|
7634
7512
|
redirectLink: ROUTES.authSettings,
|
|
7635
7513
|
}));
|
|
7636
7514
|
};
|
|
7637
|
-
// TODO Remove when all apps have migrated to the new navbar style
|
|
7638
|
-
this.verifyLogout = async () => {
|
|
7639
|
-
if (shouldSkipSetupAndTeardown())
|
|
7640
|
-
return;
|
|
7641
|
-
await test.test.step("Step 1: Open Profile popup and verify", this.openProfilePopup);
|
|
7642
|
-
await test.test.step("Step 2: Click logout and verify", async () => {
|
|
7643
|
-
await this.page
|
|
7644
|
-
.getByTestId(PROFILE_SECTION_SELECTORS.logoutButton)
|
|
7645
|
-
.click();
|
|
7646
|
-
await test.expect(this.page).toHaveURL(NEETO_AUTH_BASE_URL());
|
|
7647
|
-
await test.expect(this.page).toHaveURL(new RegExp(ROUTES.loginLink));
|
|
7648
|
-
});
|
|
7649
|
-
};
|
|
7650
7515
|
this.verifyLogoutV2 = async () => {
|
|
7651
7516
|
if (shouldSkipSetupAndTeardown())
|
|
7652
7517
|
return;
|
|
@@ -7655,8 +7520,12 @@ class HelpAndProfilePage {
|
|
|
7655
7520
|
await this.page
|
|
7656
7521
|
.getByTestId(PROFILE_SECTION_SELECTORS.logoutButton)
|
|
7657
7522
|
.click();
|
|
7658
|
-
await test.expect(this.page).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL()), {
|
|
7659
|
-
|
|
7523
|
+
await test.expect(this.page).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL()), {
|
|
7524
|
+
timeout: 15000,
|
|
7525
|
+
});
|
|
7526
|
+
await test.expect(this.page).toHaveURL(new RegExp(ROUTES.loginLink), {
|
|
7527
|
+
timeout: 15000,
|
|
7528
|
+
});
|
|
7660
7529
|
});
|
|
7661
7530
|
};
|
|
7662
7531
|
this.page = page;
|
|
@@ -8314,6 +8183,40 @@ const memberUtils = {
|
|
|
8314
8183
|
deactivateMemberViaRequest,
|
|
8315
8184
|
};
|
|
8316
8185
|
|
|
8186
|
+
const assertColumnHeaderVisibility = async ({ page, columnName, shouldBeVisible, }) => {
|
|
8187
|
+
const visibilityAssertion = shouldBeVisible ? "toBeVisible" : "toBeHidden";
|
|
8188
|
+
await test.expect(page.getByRole("columnheader", { name: columnName }))[visibilityAssertion]();
|
|
8189
|
+
};
|
|
8190
|
+
const toggleColumnCheckboxAndVerifyVisibility = async ({ page, tableColumns, shouldBeChecked, }) => {
|
|
8191
|
+
await page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
8192
|
+
for (const columnName of tableColumns) {
|
|
8193
|
+
const checkbox = page
|
|
8194
|
+
.getByTestId(COMMON_SELECTORS.columnsDropdownContainer)
|
|
8195
|
+
.getByRole("listitem")
|
|
8196
|
+
.filter({ hasText: columnName })
|
|
8197
|
+
.getByRole("checkbox");
|
|
8198
|
+
const isCheckBoxChecked = await checkbox.isChecked();
|
|
8199
|
+
if (isCheckBoxChecked !== shouldBeChecked) {
|
|
8200
|
+
await checkbox.click();
|
|
8201
|
+
}
|
|
8202
|
+
shouldBeChecked
|
|
8203
|
+
? await test.expect(checkbox).toBeChecked()
|
|
8204
|
+
: await test.expect(checkbox).not.toBeChecked();
|
|
8205
|
+
}
|
|
8206
|
+
await page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
8207
|
+
for (const columnName of tableColumns) {
|
|
8208
|
+
await assertColumnHeaderVisibility({
|
|
8209
|
+
page,
|
|
8210
|
+
columnName,
|
|
8211
|
+
shouldBeVisible: shouldBeChecked,
|
|
8212
|
+
});
|
|
8213
|
+
}
|
|
8214
|
+
};
|
|
8215
|
+
const tableUtils = {
|
|
8216
|
+
assertColumnHeaderVisibility,
|
|
8217
|
+
toggleColumnCheckboxAndVerifyVisibility,
|
|
8218
|
+
};
|
|
8219
|
+
|
|
8317
8220
|
var main$2 = {exports: {}};
|
|
8318
8221
|
|
|
8319
8222
|
var name = "dotenv";
|
|
@@ -8904,6 +8807,7 @@ exports.readFileSyncIfExists = readFileSyncIfExists;
|
|
|
8904
8807
|
exports.removeCredentialFile = removeCredentialFile;
|
|
8905
8808
|
exports.shouldSkipSetupAndTeardown = shouldSkipSetupAndTeardown;
|
|
8906
8809
|
exports.skipTest = skipTest;
|
|
8810
|
+
exports.tableUtils = tableUtils;
|
|
8907
8811
|
exports.updateCredentials = updateCredentials;
|
|
8908
8812
|
exports.writeDataToFile = writeDataToFile;
|
|
8909
8813
|
//# sourceMappingURL=index.cjs.js.map
|