@bigbinary/neeto-playwright-commons 5.0.0 → 5.0.2
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.d.ts +1 -0
- package/index.js +19 -11
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -6010,6 +6010,7 @@ declare const COMMON_SELECTORS: {
|
|
|
6010
6010
|
settingsLink: string;
|
|
6011
6011
|
ticketFieldTextInput: (label: string) => string;
|
|
6012
6012
|
appSwitcherButton: string;
|
|
6013
|
+
famAppSwitcherButton: string;
|
|
6013
6014
|
appSwitcherWrapper: string;
|
|
6014
6015
|
appLink: (appName: NeetoProducts) => string;
|
|
6015
6016
|
tableSpinner: string;
|
package/index.js
CHANGED
|
@@ -828,9 +828,10 @@ const COMMON_SELECTORS = {
|
|
|
828
828
|
subheader: "subheader",
|
|
829
829
|
settingsLink: "Settings",
|
|
830
830
|
ticketFieldTextInput: (label) => `${hyphenate(label)}-text-input`,
|
|
831
|
-
appSwitcherButton: "product-switcher-button",
|
|
832
|
-
|
|
833
|
-
|
|
831
|
+
appSwitcherButton: "sidebar-product-switcher-button",
|
|
832
|
+
famAppSwitcherButton: "fam-product-switcher-button",
|
|
833
|
+
appSwitcherWrapper: "switcher-wrapper", // Unused: neeto-molecules renders no wrapper testid around the product
|
|
834
|
+
appLink: (appName) => `${appName.toLowerCase()}-app-card`,
|
|
834
835
|
tableSpinner: ".ant-spin",
|
|
835
836
|
pageLoader: "neeto-molecules-pageloader",
|
|
836
837
|
homeButton: "home-button",
|
|
@@ -863,7 +864,7 @@ const COMMON_SELECTORS = {
|
|
|
863
864
|
badgeCloseButton: "badge-close-button",
|
|
864
865
|
nextYearButton: "next-year-button",
|
|
865
866
|
popoverTitle: "popover-title",
|
|
866
|
-
productSwitcherSearchInput: "product-switcher-search
|
|
867
|
+
productSwitcherSearchInput: "sidebar-product-switcher-search",
|
|
867
868
|
noAppsFoundTitle: "no-apps-found-title",
|
|
868
869
|
helpPopoverButton: "help-popover-button",
|
|
869
870
|
helpPopoverDesc: "help-popover-description",
|
|
@@ -2876,7 +2877,12 @@ class CustomCommands {
|
|
|
2876
2877
|
return await this.recursiveMethod(callback, condition, timeout, startTime, 1);
|
|
2877
2878
|
};
|
|
2878
2879
|
verifyToast = async ({ message = "", toastType = "success", closeAfterVerification = true, timeout = 10_000, toastCloseTimeout = 10_000, customPageContext = this.page, } = {}) => {
|
|
2879
|
-
const
|
|
2880
|
+
const toastMessageLocator = customPageContext.getByTestId(COMMON_SELECTORS.toastMessage(toastType));
|
|
2881
|
+
// Some products are still on the v1 (neetoui) Toastr, which renders the thumbs up icon and close button outside the message container.
|
|
2882
|
+
const toastLocator = customPageContext
|
|
2883
|
+
.locator(COMMON_SELECTORS.neetoUiToastr)
|
|
2884
|
+
.filter({ has: toastMessageLocator })
|
|
2885
|
+
.or(toastMessageLocator);
|
|
2880
2886
|
const filteredToastLocator = (isEmpty(message)
|
|
2881
2887
|
? toastLocator
|
|
2882
2888
|
: toastLocator.filter({ hasText: message }))
|
|
@@ -4421,16 +4427,18 @@ class HelpAndProfilePage {
|
|
|
4421
4427
|
const productName = "Cal";
|
|
4422
4428
|
const searchQueryPartial = productName.slice(0, 1).toLowerCase();
|
|
4423
4429
|
const searchQueryFull = productName.toLowerCase();
|
|
4430
|
+
const cal = this.page.getByTestId(COMMON_SELECTORS.appLink(productName));
|
|
4431
|
+
const chat = this.page.getByTestId(COMMON_SELECTORS.appLink("Chat"));
|
|
4432
|
+
const searchInput = this.page.getByTestId(COMMON_SELECTORS.productSwitcherSearchInput);
|
|
4424
4433
|
await test.step("1: Open the app switcher drawer", () => expect(async () => {
|
|
4425
|
-
await this.
|
|
4434
|
+
await this.page.reload();
|
|
4435
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
4426
4436
|
await this.openAppSwitcher();
|
|
4427
|
-
await expect(this.page.getByTestId(COMMON_SELECTORS.
|
|
4437
|
+
await expect(this.page.getByTestId(COMMON_SELECTORS.productSwitcherSearchInput)).toBeVisible();
|
|
4428
4438
|
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
4429
|
-
|
|
4439
|
+
await Promise.all([cal, chat].map(app => expect(app).toBeVisible({ timeout: 3_000 })));
|
|
4440
|
+
}).toPass({ timeout: 75_000, intervals: [3_000] }));
|
|
4430
4441
|
await test.step("2: Verify search functionality", async () => {
|
|
4431
|
-
const cal = this.page.getByTestId(COMMON_SELECTORS.appLink(productName));
|
|
4432
|
-
const chat = this.page.getByTestId(COMMON_SELECTORS.appLink("Chat"));
|
|
4433
|
-
const searchInput = this.page.getByTestId(COMMON_SELECTORS.productSwitcherSearchInput);
|
|
4434
4442
|
await searchInput.fill(faker.word.words(3));
|
|
4435
4443
|
await expect(this.page.getByTestId(COMMON_SELECTORS.noAppsFoundTitle)).toBeVisible();
|
|
4436
4444
|
await searchInput.fill(searchQueryPartial);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-playwright-commons",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "A package encapsulating common playwright code across neeto projects.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-playwright-commons.git",
|
|
6
6
|
"license": "apache-2.0",
|