@bigbinary/neeto-playwright-commons 1.8.41 → 1.8.43
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 +23 -3
- package/index.cjs.js.map +1 -1
- package/index.d.ts +29 -1
- package/index.js +20 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -147,6 +147,7 @@ type FloatingPopupCustomizationOptions = {
|
|
|
147
147
|
buttonColorHex: string;
|
|
148
148
|
buttonTextColorHex: string;
|
|
149
149
|
buttonPosition: "Bottom left" | "Bottom right";
|
|
150
|
+
showIcon?: boolean;
|
|
150
151
|
};
|
|
151
152
|
type ElementClickCustomizationOptions = {
|
|
152
153
|
customId: string;
|
|
@@ -715,6 +716,29 @@ declare const INTEGRATION_SELECTORS: {
|
|
|
715
716
|
manageButton: string;
|
|
716
717
|
};
|
|
717
718
|
|
|
719
|
+
declare const EMBED_SELECTORS: {
|
|
720
|
+
iframe: (appName: string) => string;
|
|
721
|
+
modal: (appName: string) => string;
|
|
722
|
+
close: (appName: string) => string;
|
|
723
|
+
loader: (appName: string) => string;
|
|
724
|
+
inlineHeightInput: string;
|
|
725
|
+
inlineWidthInput: string;
|
|
726
|
+
inlineElementIdInput: string;
|
|
727
|
+
codeBlock: string;
|
|
728
|
+
previewTab: string;
|
|
729
|
+
htmlTab: string;
|
|
730
|
+
buttonTextInput: string;
|
|
731
|
+
buttonPositionSelectContainer: string;
|
|
732
|
+
buttonPositionSelectMenu: string;
|
|
733
|
+
buttonColorLabel: string;
|
|
734
|
+
buttonTextColorLabel: string;
|
|
735
|
+
colorPickerTarget: string;
|
|
736
|
+
colorpickerEditableInput: string;
|
|
737
|
+
showIconCheckbox: string;
|
|
738
|
+
elementIdInput: string;
|
|
739
|
+
previewElementPopupButton: string;
|
|
740
|
+
};
|
|
741
|
+
|
|
718
742
|
declare const CHAT_WIDGET_TEXTS: {
|
|
719
743
|
newConversation: string;
|
|
720
744
|
welcomeChatBubble: string;
|
|
@@ -784,6 +808,7 @@ interface LoginProps {
|
|
|
784
808
|
}
|
|
785
809
|
declare const loginWithoutSSO: ({ page, neetoPlaywrightUtilities, loginPath, }: LoginProps) => Promise<void>;
|
|
786
810
|
declare const login: ({ page, neetoPlaywrightUtilities, loginPath, }: LoginProps) => Promise<false | void>;
|
|
811
|
+
declare const generateRandomBypassEmail: () => string;
|
|
787
812
|
|
|
788
813
|
declare const extractSubdomainFromError: (errorString: string) => string;
|
|
789
814
|
|
|
@@ -871,6 +896,9 @@ interface ExecuteWithThrottledResourcesParams {
|
|
|
871
896
|
}
|
|
872
897
|
declare const executeWithThrottledResources: ({ code: emulatedCode, kind, networkCondition, cpuThrottlingRate, cdpSession, }: ExecuteWithThrottledResourcesParams) => Promise<void>;
|
|
873
898
|
|
|
899
|
+
declare const basicHTMLContent: (content: string) => string;
|
|
900
|
+
declare const hexToRGB: (hex: string) => string;
|
|
901
|
+
|
|
874
902
|
interface CurrentsOverrides {
|
|
875
903
|
projectId: string;
|
|
876
904
|
}
|
|
@@ -883,4 +911,4 @@ interface Overrides {
|
|
|
883
911
|
}
|
|
884
912
|
declare const definePlaywrightConfig: (overrides: Overrides) => _playwright_test.PlaywrightTestConfig<{}, {}>;
|
|
885
913
|
|
|
886
|
-
export { API_ROUTES, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, type CustomFixture, ENVIRONMENT, EmbedBase, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailosaurUtils, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TAGS_SELECTORS, THIRD_PARTY_ROUTES, USER_AGENTS, WebhooksPage, clearCredentials, commands, cpuThrottlingUsingCDP, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, generateStagingData, getByDataQA, getGlobalUserState, headerUtils, hyphenize, i18nFixture, initializeCredentials, initializeTotp, joinHyphenCase, joinString, login, loginWithoutSSO, memberUtils, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
|
|
914
|
+
export { API_ROUTES, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, type CustomFixture, EMBED_SELECTORS, ENVIRONMENT, EmbedBase, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailosaurUtils, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TAGS_SELECTORS, THIRD_PARTY_ROUTES, USER_AGENTS, WebhooksPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, headerUtils, hexToRGB, hyphenize, i18nFixture, initializeCredentials, initializeTotp, joinHyphenCase, joinString, login, loginWithoutSSO, memberUtils, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
|
package/index.js
CHANGED
|
@@ -12419,7 +12419,9 @@ class EmbedBase {
|
|
|
12419
12419
|
await expect(this.page.frameLocator("iframe").getByTestId(headingTestId)).toBeVisible({ timeout: 10000 });
|
|
12420
12420
|
const iframeHeight = await iframe.evaluate(node => node.getAttribute("height"));
|
|
12421
12421
|
const iframeWidth = await iframe.evaluate(node => node.getAttribute("width"));
|
|
12422
|
+
// eslint-disable-next-line playwright/no-standalone-expect
|
|
12422
12423
|
expect(iframeHeight).toStrictEqual(embedHeightPercentage);
|
|
12424
|
+
// eslint-disable-next-line playwright/no-standalone-expect
|
|
12423
12425
|
expect(iframeWidth).toStrictEqual(embedWidthPercentage);
|
|
12424
12426
|
};
|
|
12425
12427
|
this.verifyFloatingPopupCustomization = async (customizationOptions) => {
|
|
@@ -12454,13 +12456,20 @@ class EmbedBase {
|
|
|
12454
12456
|
.getByTestId(EMBED_SELECTORS.colorpickerEditableInput)
|
|
12455
12457
|
.getByRole("textbox")
|
|
12456
12458
|
.fill(customizationOptions.buttonTextColorHex);
|
|
12457
|
-
|
|
12459
|
+
const showIconCheckbox = this.page.getByTestId(EMBED_SELECTORS.showIconCheckbox);
|
|
12460
|
+
if (customizationOptions.showIcon === true) {
|
|
12461
|
+
await showIconCheckbox.check();
|
|
12462
|
+
await expect(this.codeBlock).toContainText("showIcon: true");
|
|
12463
|
+
}
|
|
12464
|
+
else if (customizationOptions.showIcon === false) {
|
|
12465
|
+
await showIconCheckbox.uncheck();
|
|
12466
|
+
await expect(this.codeBlock).toContainText("showIcon: false");
|
|
12467
|
+
}
|
|
12458
12468
|
await this.expectMultipleTextsInCodeblock([
|
|
12459
12469
|
`btnColor: "${customizationOptions.buttonColorHex}"`,
|
|
12460
12470
|
`btnTextColor: "${customizationOptions.buttonTextColorHex}"`,
|
|
12461
12471
|
`btnPosition: "${toCamelCase(customizationOptions.buttonPosition)}"`,
|
|
12462
12472
|
`btnText: "${customizationOptions.buttonText}"`,
|
|
12463
|
-
"showIcon: false",
|
|
12464
12473
|
]);
|
|
12465
12474
|
await this.previewTab.click();
|
|
12466
12475
|
const floatingButton = this.page.getByRole("button", {
|
|
@@ -12472,7 +12481,13 @@ class EmbedBase {
|
|
|
12472
12481
|
.toLocaleLowerCase()
|
|
12473
12482
|
.replace(" ", ".*");
|
|
12474
12483
|
await expect(floatingButton).toHaveClass(RegExp(classRegExp));
|
|
12475
|
-
|
|
12484
|
+
const floatingButtonIcon = floatingButton.locator("svg");
|
|
12485
|
+
if (customizationOptions.showIcon === true) {
|
|
12486
|
+
await expect(floatingButtonIcon).toBeVisible();
|
|
12487
|
+
}
|
|
12488
|
+
else if (customizationOptions.showIcon === false) {
|
|
12489
|
+
await expect(floatingButtonIcon).toBeHidden();
|
|
12490
|
+
}
|
|
12476
12491
|
};
|
|
12477
12492
|
this.verifyElementClickCustomization = async (customizationOptions) => {
|
|
12478
12493
|
await this.page
|
|
@@ -13544,6 +13559,7 @@ const loginWithoutSSO = async ({ page, neetoPlaywrightUtilities, loginPath = "/"
|
|
|
13544
13559
|
};
|
|
13545
13560
|
const login = async ({ page, neetoPlaywrightUtilities, loginPath, }) => !IS_STAGING_ENV &&
|
|
13546
13561
|
(await loginWithoutSSO({ page, neetoPlaywrightUtilities, loginPath }));
|
|
13562
|
+
const generateRandomBypassEmail = () => `cpt${process.env.OTP_BYPASS_KEY}+${faker.number.int()}@bigbinary.com`;
|
|
13547
13563
|
|
|
13548
13564
|
const addMemberViaRequest = ({ email, role = MEMBER_TEXTS.agent, appName, neetoPlaywrightUtilities, }) => neetoPlaywrightUtilities.apiRequest({
|
|
13549
13565
|
method: "post",
|
|
@@ -147112,5 +147128,5 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
147112
147128
|
});
|
|
147113
147129
|
};
|
|
147114
147130
|
|
|
147115
|
-
export { API_ROUTES, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, ENVIRONMENT, EmbedBase, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailosaurUtils, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TAGS_SELECTORS, THIRD_PARTY_ROUTES, USER_AGENTS, WebhooksPage, clearCredentials, commands, cpuThrottlingUsingCDP, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, generateStagingData, getByDataQA, getGlobalUserState, headerUtils, hyphenize, i18nFixture, initializeCredentials, initializeTotp, joinHyphenCase, joinString, login, loginWithoutSSO, memberUtils, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, skipTest, squish, stealth as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
|
|
147131
|
+
export { API_ROUTES, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, EMBED_SELECTORS, ENVIRONMENT, EmbedBase, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailosaurUtils, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, OTP_EMAIL_PATTERN, OrganizationPage, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TAGS_SELECTORS, THIRD_PARTY_ROUTES, USER_AGENTS, WebhooksPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, headerUtils, hexToRGB, hyphenize, i18nFixture, initializeCredentials, initializeTotp, joinHyphenCase, joinString, login, loginWithoutSSO, memberUtils, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, skipTest, squish, stealth as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
|
|
147116
147132
|
//# sourceMappingURL=index.js.map
|