@bigbinary/neeto-playwright-commons 1.18.5 → 1.19.1
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 +72 -0
- package/index.cjs.js.map +1 -1
- package/index.d.ts +95 -5
- package/index.js +72 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import * as playwright_core from 'playwright-core';
|
|
1
2
|
import * as _playwright_test from '@playwright/test';
|
|
2
3
|
import { Page, APIRequestContext, Response, Locator, APIResponse, Fixtures, PlaywrightWorkerArgs, PlaywrightWorkerOptions, PlaywrightTestArgs, PlaywrightTestOptions, Browser, BrowserContext, FrameLocator, CDPSession } from '@playwright/test';
|
|
3
4
|
import { FastmailApi } from 'apis/fastmail';
|
|
4
5
|
import { I18nPlaywrightFixture } from 'playwright-i18next-fixture';
|
|
5
6
|
import { TFunction } from 'i18next';
|
|
6
7
|
import { TOTP, Secret } from 'otpauth';
|
|
7
|
-
import { MemberApis } from 'apis/members';
|
|
8
|
-
import * as playwright_core from 'playwright-core';
|
|
8
|
+
import { MemberApis as MemberApis$1 } from 'apis/members';
|
|
9
9
|
import { RoleApis } from 'apis/roles';
|
|
10
10
|
import { TagsApi } from 'apis/tags';
|
|
11
11
|
import { Protocol } from 'playwright-core/types/protocol';
|
|
@@ -478,6 +478,16 @@ declare class CustomCommands {
|
|
|
478
478
|
*/
|
|
479
479
|
hideTooltip: (triggerElement: Locator, customPageContext?: Page) => Promise<void>;
|
|
480
480
|
}
|
|
481
|
+
declare class MemberApis {
|
|
482
|
+
private neetoPlaywrightUtilities;
|
|
483
|
+
private readonly teamsBaseUrl;
|
|
484
|
+
constructor(neetoPlaywrightUtilities: CustomCommands);
|
|
485
|
+
create: (body: Record<string, unknown>) => Promise<playwright_core.APIResponse | undefined>;
|
|
486
|
+
jobStatus: (jobId: string) => Promise<playwright_core.APIResponse | undefined>;
|
|
487
|
+
fetch: (params: ParamProps) => Promise<playwright_core.APIResponse | undefined>;
|
|
488
|
+
update: (memberId: string, body: Record<string, unknown>) => Promise<playwright_core.APIResponse | undefined>;
|
|
489
|
+
bulkUpdate: (body: Record<string, unknown>) => Promise<playwright_core.APIResponse | undefined>;
|
|
490
|
+
}
|
|
481
491
|
type Range<N extends number, Acc extends number[] = []> = Acc["length"] extends N ? Exclude<Acc[number], 0 | Acc["length"]> | N : Range<N, [...Acc, Acc["length"]]>;
|
|
482
492
|
interface MessageSearchCriteria {
|
|
483
493
|
from: string;
|
|
@@ -990,6 +1000,7 @@ declare class ThankYouPage {
|
|
|
990
1000
|
addRedirectUrl: (customRedirectUrl: string) => Promise<void>;
|
|
991
1001
|
}
|
|
992
1002
|
type EmbedType = "inline" | "floatingPopup" | "elementClick";
|
|
1003
|
+
type EmbedTypeV2 = "inline" | "floatingPopup" | "elementPopup";
|
|
993
1004
|
type GetByRoleOptions = {
|
|
994
1005
|
checked?: boolean;
|
|
995
1006
|
disabled?: boolean;
|
|
@@ -1029,6 +1040,11 @@ type initializeEmbedPageParams = {
|
|
|
1029
1040
|
embedCode: string;
|
|
1030
1041
|
customElementText?: string;
|
|
1031
1042
|
};
|
|
1043
|
+
type InitializeEmbedPageParamsV2 = {
|
|
1044
|
+
embedType: EmbedTypeV2;
|
|
1045
|
+
embedCode: string;
|
|
1046
|
+
customElementText?: string;
|
|
1047
|
+
};
|
|
1032
1048
|
type EmbedBasePageConstructorParams = {
|
|
1033
1049
|
context: BrowserContext;
|
|
1034
1050
|
page: Page;
|
|
@@ -1042,7 +1058,7 @@ declare class EmbedBase {
|
|
|
1042
1058
|
appName: string;
|
|
1043
1059
|
t: TFunction;
|
|
1044
1060
|
embedTestPage: Page;
|
|
1045
|
-
embedTestPageType: EmbedType;
|
|
1061
|
+
embedTestPageType: EmbedType | EmbedTypeV2;
|
|
1046
1062
|
embeddedFrame: FrameLocator;
|
|
1047
1063
|
filePath: string;
|
|
1048
1064
|
codeBlock: Locator;
|
|
@@ -1053,6 +1069,9 @@ declare class EmbedBase {
|
|
|
1053
1069
|
neetoPlaywrightUtilities,
|
|
1054
1070
|
appName
|
|
1055
1071
|
}: EmbedBasePageConstructorParams);
|
|
1072
|
+
/**
|
|
1073
|
+
* @deprecated This method is deprecated. Use initializeEmbedPageV2 instead.
|
|
1074
|
+
*/
|
|
1056
1075
|
/**
|
|
1057
1076
|
*
|
|
1058
1077
|
* Initializes the embed test page. It takes the following parameters:
|
|
@@ -1083,6 +1102,36 @@ declare class EmbedBase {
|
|
|
1083
1102
|
embedCode,
|
|
1084
1103
|
customElementText
|
|
1085
1104
|
}: initializeEmbedPageParams) => Promise<Page>;
|
|
1105
|
+
/**
|
|
1106
|
+
*
|
|
1107
|
+
* Initializes the embed test page. It takes the following parameters:
|
|
1108
|
+
*
|
|
1109
|
+
* embedType: Type of embedded content (inline, floatingPopup, elementPopup).
|
|
1110
|
+
*
|
|
1111
|
+
* embedCode: Embed code.
|
|
1112
|
+
*
|
|
1113
|
+
* customElementText: Custom text for element click type (default: "Click here").
|
|
1114
|
+
*
|
|
1115
|
+
* @example
|
|
1116
|
+
*
|
|
1117
|
+
* await embedBase.initializeEmbedPageV2({
|
|
1118
|
+
* embedType: "inline",
|
|
1119
|
+
* embedCode: "<iframe src='example.com'></iframe>"
|
|
1120
|
+
* });
|
|
1121
|
+
* // OR
|
|
1122
|
+
*
|
|
1123
|
+
* await embedBase.initializeEmbedPageV2({
|
|
1124
|
+
* embedType: "inline",
|
|
1125
|
+
* embedCode: "<iframe src='example.com'></iframe>",
|
|
1126
|
+
* customElementText:"Click here"
|
|
1127
|
+
* });
|
|
1128
|
+
* @endexample
|
|
1129
|
+
*/
|
|
1130
|
+
initializeEmbedPageV2: ({
|
|
1131
|
+
embedType,
|
|
1132
|
+
embedCode,
|
|
1133
|
+
customElementText
|
|
1134
|
+
}: InitializeEmbedPageParamsV2) => Promise<Page>;
|
|
1086
1135
|
/**
|
|
1087
1136
|
*
|
|
1088
1137
|
* Closes the embed modal and page.
|
|
@@ -1133,8 +1182,13 @@ declare class EmbedBase {
|
|
|
1133
1182
|
* selected: true
|
|
1134
1183
|
* });
|
|
1135
1184
|
* @endexample
|
|
1185
|
+
* /**
|
|
1186
|
+
*
|
|
1136
1187
|
*/
|
|
1137
1188
|
clickOnPopupButton: (popUpButtonSelectorOptions: GetByRoleOptions) => Promise<void>;
|
|
1189
|
+
/**
|
|
1190
|
+
* @deprecated This method is deprecated. Use copyEmbedScriptV2 instead.
|
|
1191
|
+
*/
|
|
1138
1192
|
/**
|
|
1139
1193
|
*
|
|
1140
1194
|
* Copies the embed script. It takes the following parameters:
|
|
@@ -1151,6 +1205,23 @@ declare class EmbedBase {
|
|
|
1151
1205
|
}: {
|
|
1152
1206
|
embedLabel: string;
|
|
1153
1207
|
}) => Promise<string>;
|
|
1208
|
+
/**
|
|
1209
|
+
*
|
|
1210
|
+
* Copies the embed script. It takes the following parameters:
|
|
1211
|
+
*
|
|
1212
|
+
* embedType: Type of embedded content (inline, floatingPopup, elementPopup).
|
|
1213
|
+
*
|
|
1214
|
+
* @example
|
|
1215
|
+
*
|
|
1216
|
+
* const embedScript = await embedBase.copyEmbedScript("inline");
|
|
1217
|
+
* @endexample
|
|
1218
|
+
* /**
|
|
1219
|
+
*
|
|
1220
|
+
*/
|
|
1221
|
+
copyEmbedScriptV2: (embedType: EmbedTypeV2) => Promise<string>;
|
|
1222
|
+
/**
|
|
1223
|
+
* @deprecated This method is deprecated. Use selectEmbedTypeV2 instead.
|
|
1224
|
+
*/
|
|
1154
1225
|
/**
|
|
1155
1226
|
*
|
|
1156
1227
|
* Selects the embed type. It takes the following parameters:
|
|
@@ -1163,6 +1234,18 @@ declare class EmbedBase {
|
|
|
1163
1234
|
* @endexample
|
|
1164
1235
|
*/
|
|
1165
1236
|
selectEmbedType: (embedLabel: string) => Promise<void>;
|
|
1237
|
+
/**
|
|
1238
|
+
*
|
|
1239
|
+
* Selects the embed type. It takes the following parameters:
|
|
1240
|
+
*
|
|
1241
|
+
* embedType: Type of embedded content (inline, floatingPopup, elementPopup).
|
|
1242
|
+
*
|
|
1243
|
+
* @example
|
|
1244
|
+
*
|
|
1245
|
+
* await embedBase.selectEmbedType("inline");
|
|
1246
|
+
* @endexample
|
|
1247
|
+
*/
|
|
1248
|
+
selectEmbedTypeV2: (embedType: EmbedTypeV2) => Promise<void>;
|
|
1166
1249
|
/**
|
|
1167
1250
|
*
|
|
1168
1251
|
* Verifies inline customization of embedded content. It takes the following parameters:
|
|
@@ -1187,6 +1270,7 @@ declare class EmbedBase {
|
|
|
1187
1270
|
inlineEmbedInterceptParams,
|
|
1188
1271
|
customizationOptions
|
|
1189
1272
|
}: VerifyInlineCustomizationParams) => Promise<void>;
|
|
1273
|
+
backToEmbedSelection: () => Promise<void>;
|
|
1190
1274
|
/**
|
|
1191
1275
|
*
|
|
1192
1276
|
* Verifies floating popup customization of embedded content. It takes the following parameters:
|
|
@@ -2035,7 +2119,7 @@ interface EditMemberProps$1 {
|
|
|
2035
2119
|
}
|
|
2036
2120
|
declare class Member {
|
|
2037
2121
|
private neetoPlaywrightUtilities;
|
|
2038
|
-
memberApis: MemberApis;
|
|
2122
|
+
memberApis: MemberApis$1;
|
|
2039
2123
|
constructor(neetoPlaywrightUtilities: CustomCommands);
|
|
2040
2124
|
addMemberViaRequest: ({
|
|
2041
2125
|
email,
|
|
@@ -4754,6 +4838,10 @@ declare const FONT_SIZE_SELECTORS: {
|
|
|
4754
4838
|
*
|
|
4755
4839
|
* previewElementPopupButton: Selector for the preview element popup button.
|
|
4756
4840
|
*
|
|
4841
|
+
* embedSelector: Selector for the embed card to select embed type.
|
|
4842
|
+
*
|
|
4843
|
+
* backToEmbedSelectionButton: Selector for the back button to select embed type.
|
|
4844
|
+
*
|
|
4757
4845
|
*/
|
|
4758
4846
|
declare const EMBED_SELECTORS: {
|
|
4759
4847
|
iframe: (appName: string) => string;
|
|
@@ -4777,6 +4865,8 @@ declare const EMBED_SELECTORS: {
|
|
|
4777
4865
|
showIconCheckbox: string;
|
|
4778
4866
|
elementIdInput: string;
|
|
4779
4867
|
previewElementPopupButton: string;
|
|
4868
|
+
embedSelector: (embedType: string) => string;
|
|
4869
|
+
backToEmbedSelectionButton: string;
|
|
4780
4870
|
};
|
|
4781
4871
|
/**
|
|
4782
4872
|
*
|
|
@@ -6595,4 +6685,4 @@ interface Overrides {
|
|
|
6595
6685
|
* @endexample
|
|
6596
6686
|
*/
|
|
6597
6687
|
declare const definePlaywrightConfig: (overrides: Overrides) => _playwright_test.PlaywrightTestConfig<{}, {}>;
|
|
6598
|
-
export { ADMIN_PANEL_SELECTORS, API_KEYS_SELECTORS, API_ROUTES, AUDIT_LOGS_TEXTS, AdminPanelPage, ApiKeysPage, AuditLogsPage, BASE_URL, type BaseThemeStyle, type BaseThemeStyleType, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, CREDENTIALS, CUSTOM_DOMAIN_SELECTORS, CustomCommands, CustomDomainPage as CustomDomainsPage, type CustomFixture, DATE_TEXTS, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_LABEL, EMPTY_STORAGE_STATE, ENGAGE_TEXTS, ENVIRONMENT, EXPANDED_FONT_SIZE, EditorPage, EmbedBase, FONT_SIZE_SELECTORS, GLOBAL_TRANSLATIONS_PATTERN, GOOGLE_CALENDAR_DATE_FORMAT, GOOGLE_LOGIN_SELECTORS, GOOGLE_LOGIN_TEXTS, GooglePage, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, ImageUploader, IntegrationBase, type IntroPageThemeStyle, type IntroPageThemeStyleType, KEYBOARD_SHORTCUTS_SELECTORS, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailerUtils, Member, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_TEXT_MODIFIER_SELECTORS, ORGANIZATION_TEXTS, OTP_EMAIL_PATTERN, OrganizationPage, PLURAL, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, RolesPage, SELECT_COUNTRY, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TABLE_SELECTORS, TAB_SELECTORS, TAGS_SELECTORS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THANK_YOU_SELECTORS, THEMES_SELECTORS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, TagsPage, TeamMembers, ThankYouPage, type ThemeCategory, USER_AGENTS, WEBHOOK_SELECTORS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, currencyUtils, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, getListCount, headerUtils, hexToRGB, hexToRGBA, hyphenize, i18nFixture, initializeCredentials, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
|
|
6688
|
+
export { ADMIN_PANEL_SELECTORS, API_KEYS_SELECTORS, API_ROUTES, AUDIT_LOGS_TEXTS, AdminPanelPage, ApiKeysPage, AuditLogsPage, BASE_URL, type BaseThemeStyle, type BaseThemeStyleType, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, CREDENTIALS, CUSTOM_DOMAIN_SELECTORS, CustomCommands, CustomDomainPage as CustomDomainsPage, type CustomFixture, DATE_TEXTS, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_LABEL, EMPTY_STORAGE_STATE, ENGAGE_TEXTS, ENVIRONMENT, EXPANDED_FONT_SIZE, EditorPage, EmbedBase, FONT_SIZE_SELECTORS, GLOBAL_TRANSLATIONS_PATTERN, GOOGLE_CALENDAR_DATE_FORMAT, GOOGLE_LOGIN_SELECTORS, GOOGLE_LOGIN_TEXTS, GooglePage, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, ImageUploader, IntegrationBase, type IntroPageThemeStyle, type IntroPageThemeStyleType, KEYBOARD_SHORTCUTS_SELECTORS, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailerUtils, Member, MemberApis, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_TEXT_MODIFIER_SELECTORS, ORGANIZATION_TEXTS, OTP_EMAIL_PATTERN, OrganizationPage, PLURAL, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, RolesPage, SELECT_COUNTRY, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TABLE_SELECTORS, TAB_SELECTORS, TAGS_SELECTORS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THANK_YOU_SELECTORS, THEMES_SELECTORS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, TagsPage, TeamMembers, ThankYouPage, type ThemeCategory, USER_AGENTS, WEBHOOK_SELECTORS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, currencyUtils, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, getListCount, headerUtils, hexToRGB, hexToRGBA, hyphenize, i18nFixture, initializeCredentials, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
|
package/index.js
CHANGED
|
@@ -29,6 +29,36 @@ import require$$0$a from 'assert';
|
|
|
29
29
|
import require$$3$1 from 'querystring';
|
|
30
30
|
import require$$4$3 from 'timers';
|
|
31
31
|
|
|
32
|
+
let MemberApis$1 = class MemberApis {
|
|
33
|
+
constructor(neetoPlaywrightUtilities) {
|
|
34
|
+
this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
|
|
35
|
+
this.create = (body) => this.neetoPlaywrightUtilities.apiRequest({
|
|
36
|
+
method: "post",
|
|
37
|
+
url: this.teamsBaseUrl,
|
|
38
|
+
body: { user: body },
|
|
39
|
+
});
|
|
40
|
+
this.jobStatus = (jobId) => this.neetoPlaywrightUtilities.apiRequest({
|
|
41
|
+
url: `${this.teamsBaseUrl}/creation_status/${jobId}`,
|
|
42
|
+
});
|
|
43
|
+
this.fetch = (params) => this.neetoPlaywrightUtilities.apiRequest({
|
|
44
|
+
method: "get",
|
|
45
|
+
url: this.teamsBaseUrl,
|
|
46
|
+
params,
|
|
47
|
+
});
|
|
48
|
+
this.update = (memberId, body) => this.neetoPlaywrightUtilities.apiRequest({
|
|
49
|
+
method: "put",
|
|
50
|
+
url: `${this.teamsBaseUrl}/${memberId}`,
|
|
51
|
+
body: { team: body },
|
|
52
|
+
});
|
|
53
|
+
this.bulkUpdate = (body) => this.neetoPlaywrightUtilities.apiRequest({
|
|
54
|
+
method: "patch",
|
|
55
|
+
url: `${this.teamsBaseUrl}/bulk_update`,
|
|
56
|
+
body: { users: body },
|
|
57
|
+
});
|
|
58
|
+
this.teamsBaseUrl = "/team_members/teams";
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
32
62
|
const ENVIRONMENT = {
|
|
33
63
|
development: "development",
|
|
34
64
|
staging: "staging",
|
|
@@ -389,6 +419,8 @@ const EMBED_SELECTORS = {
|
|
|
389
419
|
showIconCheckbox: "show-icon-checkbox",
|
|
390
420
|
elementIdInput: "element-id-input-field",
|
|
391
421
|
previewElementPopupButton: "preview-element-popup-button",
|
|
422
|
+
embedSelector: (embedType) => `[data-testid="embed-selector-card-${hyphenize(embedType)}"]`,
|
|
423
|
+
backToEmbedSelectionButton: "back-to-embed-selection-button",
|
|
392
424
|
};
|
|
393
425
|
|
|
394
426
|
const NEETO_FILTERS_SELECTORS = {
|
|
@@ -56992,6 +57024,9 @@ class ThankYouPage {
|
|
|
56992
57024
|
|
|
56993
57025
|
class EmbedBase {
|
|
56994
57026
|
constructor({ context, page, neetoPlaywrightUtilities, appName, }) {
|
|
57027
|
+
/**
|
|
57028
|
+
* @deprecated This method is deprecated. Use initializeEmbedPageV2 instead.
|
|
57029
|
+
*/
|
|
56995
57030
|
this.initializeEmbedPage = async ({ embedType, embedCode, customElementText = "Click here", }) => {
|
|
56996
57031
|
this.embedTestPage = await this.context.newPage();
|
|
56997
57032
|
this.embedTestPageType = embedType;
|
|
@@ -57009,6 +57044,23 @@ class EmbedBase {
|
|
|
57009
57044
|
: EMBED_SELECTORS.iframe(this.appName));
|
|
57010
57045
|
return this.embedTestPage;
|
|
57011
57046
|
};
|
|
57047
|
+
this.initializeEmbedPageV2 = async ({ embedType, embedCode, customElementText = "Click here", }) => {
|
|
57048
|
+
this.embedTestPage = await this.context.newPage();
|
|
57049
|
+
this.embedTestPageType = embedType;
|
|
57050
|
+
const fileContent = basicHTMLContent(this.embedTestPageType === "elementPopup"
|
|
57051
|
+
? `${embedCode}<a href='#' id='open-popup-button'>${customElementText}</a>`
|
|
57052
|
+
: embedCode);
|
|
57053
|
+
this.filePath = `tmp/${faker.word.noun()}.html`;
|
|
57054
|
+
writeFileSync$1(this.filePath, fileContent, "utf8");
|
|
57055
|
+
await this.embedTestPage.goto(`file://${Path__default.resolve(this.filePath)}`, {
|
|
57056
|
+
timeout: 20000,
|
|
57057
|
+
});
|
|
57058
|
+
await this.embedTestPage.waitForLoadState("load");
|
|
57059
|
+
this.embeddedFrame = this.embedTestPage.frameLocator(this.embedTestPageType === "inline"
|
|
57060
|
+
? "iframe"
|
|
57061
|
+
: EMBED_SELECTORS.iframe(this.appName));
|
|
57062
|
+
return this.embedTestPage;
|
|
57063
|
+
};
|
|
57012
57064
|
this.closeEmbedModalAndPage = async () => {
|
|
57013
57065
|
if (this.embedTestPageType !== "inline") {
|
|
57014
57066
|
await this.embedTestPage
|
|
@@ -57033,6 +57085,9 @@ class EmbedBase {
|
|
|
57033
57085
|
});
|
|
57034
57086
|
}).toPass({ timeout: 2 * 60 * 1000 });
|
|
57035
57087
|
};
|
|
57088
|
+
/**
|
|
57089
|
+
* @deprecated This method is deprecated. Use copyEmbedScriptV2 instead.
|
|
57090
|
+
*/
|
|
57036
57091
|
this.copyEmbedScript = async ({ embedLabel }) => {
|
|
57037
57092
|
await this.page
|
|
57038
57093
|
.getByTestId(COMMON_SELECTORS.radioLabel(embedLabel))
|
|
@@ -57040,12 +57095,24 @@ class EmbedBase {
|
|
|
57040
57095
|
await this.page.getByTestId(COMMON_SELECTORS.copyButton).click();
|
|
57041
57096
|
return await this.page.evaluate(() => navigator.clipboard.readText());
|
|
57042
57097
|
};
|
|
57098
|
+
this.copyEmbedScriptV2 = async (embedType) => {
|
|
57099
|
+
await this.selectEmbedTypeV2(embedType);
|
|
57100
|
+
await this.page.getByTestId(COMMON_SELECTORS.copyButton).click();
|
|
57101
|
+
return await this.page.evaluate(() => navigator.clipboard.readText());
|
|
57102
|
+
};
|
|
57103
|
+
/**
|
|
57104
|
+
* @deprecated This method is deprecated. Use selectEmbedTypeV2 instead.
|
|
57105
|
+
*/
|
|
57043
57106
|
this.selectEmbedType = async (embedLabel) => {
|
|
57044
57107
|
await this.page.getByTestId(EMBED_SELECTORS.htmlTab).click();
|
|
57045
57108
|
await this.page
|
|
57046
57109
|
.getByTestId(COMMON_SELECTORS.radioLabel(embedLabel))
|
|
57047
57110
|
.check();
|
|
57048
57111
|
};
|
|
57112
|
+
this.selectEmbedTypeV2 = async (embedType) => {
|
|
57113
|
+
await this.page.locator(EMBED_SELECTORS.embedSelector(embedType)).click();
|
|
57114
|
+
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
57115
|
+
};
|
|
57049
57116
|
this.verifyInlineCustomization = async ({ headingTestId,
|
|
57050
57117
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
57051
57118
|
inlineEmbedInterceptParams, customizationOptions, }) => {
|
|
@@ -57078,7 +57145,9 @@ class EmbedBase {
|
|
|
57078
57145
|
expect(iframeHeight).toStrictEqual(embedHeightPercentage);
|
|
57079
57146
|
// eslint-disable-next-line playwright/no-standalone-expect
|
|
57080
57147
|
expect(iframeWidth).toStrictEqual(embedWidthPercentage);
|
|
57148
|
+
await this.backToEmbedSelection();
|
|
57081
57149
|
};
|
|
57150
|
+
this.backToEmbedSelection = () => this.page.getByTestId(EMBED_SELECTORS.backToEmbedSelectionButton).click();
|
|
57082
57151
|
this.verifyFloatingPopupCustomization = async (customizationOptions) => {
|
|
57083
57152
|
await this.page
|
|
57084
57153
|
.getByTestId(EMBED_SELECTORS.buttonTextInput)
|
|
@@ -57145,6 +57214,7 @@ class EmbedBase {
|
|
|
57145
57214
|
else if (customizationOptions.showIcon === false) {
|
|
57146
57215
|
await expect(floatingButtonIcon).toBeHidden();
|
|
57147
57216
|
}
|
|
57217
|
+
await this.backToEmbedSelection();
|
|
57148
57218
|
};
|
|
57149
57219
|
this.verifyElementClickCustomization = async (customizationOptions) => {
|
|
57150
57220
|
await this.page
|
|
@@ -57156,6 +57226,7 @@ class EmbedBase {
|
|
|
57156
57226
|
expect(this.page.getByTestId(EMBED_SELECTORS.previewElementPopupButton)).toBeVisible(),
|
|
57157
57227
|
await expect(this.page.locator(`#${customizationOptions.customId}`)).toBeVisible(),
|
|
57158
57228
|
]);
|
|
57229
|
+
await this.backToEmbedSelection();
|
|
57159
57230
|
};
|
|
57160
57231
|
this.expectMultipleTextsInCodeblock = async (containTextOptions) => {
|
|
57161
57232
|
const codeBlock = this.page.getByTestId(EMBED_SELECTORS.codeBlock);
|
|
@@ -194677,5 +194748,5 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
194677
194748
|
});
|
|
194678
194749
|
};
|
|
194679
194750
|
|
|
194680
|
-
export { ADMIN_PANEL_SELECTORS, API_KEYS_SELECTORS, API_ROUTES, AUDIT_LOGS_TEXTS, AdminPanelPage, ApiKeysPage, AuditLogsPage, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, CREDENTIALS, CUSTOM_DOMAIN_SELECTORS, CustomCommands, CustomDomainPage as CustomDomainsPage, DATE_TEXTS, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_LABEL, EMPTY_STORAGE_STATE, ENGAGE_TEXTS, ENVIRONMENT, EXPANDED_FONT_SIZE, EditorPage, EmbedBase, FONT_SIZE_SELECTORS, GLOBAL_TRANSLATIONS_PATTERN, GOOGLE_CALENDAR_DATE_FORMAT, GOOGLE_LOGIN_SELECTORS, GOOGLE_LOGIN_TEXTS, GooglePage, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, ImageUploader, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailerUtils, Member, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_TEXT_MODIFIER_SELECTORS, ORGANIZATION_TEXTS, OTP_EMAIL_PATTERN, OrganizationPage, PLURAL, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, RolesPage, SELECT_COUNTRY, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TABLE_SELECTORS, TAB_SELECTORS, TAGS_SELECTORS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THANK_YOU_SELECTORS, THEMES_SELECTORS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, TagsPage, TeamMembers, ThankYouPage, USER_AGENTS, WEBHOOK_SELECTORS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, currencyUtils, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, getListCount, headerUtils, hexToRGB, hexToRGBA, hyphenize, i18nFixture, initializeCredentials, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, stealth as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
|
|
194751
|
+
export { ADMIN_PANEL_SELECTORS, API_KEYS_SELECTORS, API_ROUTES, AUDIT_LOGS_TEXTS, AdminPanelPage, ApiKeysPage, AuditLogsPage, BASE_URL, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, CREDENTIALS, CUSTOM_DOMAIN_SELECTORS, CustomCommands, CustomDomainPage as CustomDomainsPage, DATE_TEXTS, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_LABEL, EMPTY_STORAGE_STATE, ENGAGE_TEXTS, ENVIRONMENT, EXPANDED_FONT_SIZE, EditorPage, EmbedBase, FONT_SIZE_SELECTORS, GLOBAL_TRANSLATIONS_PATTERN, GOOGLE_CALENDAR_DATE_FORMAT, GOOGLE_LOGIN_SELECTORS, GOOGLE_LOGIN_TEXTS, GooglePage, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IS_STAGING_ENV, ImageUploader, IntegrationBase, KEYBOARD_SHORTCUTS_SELECTORS, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MailerUtils, Member, MemberApis$1 as MemberApis, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_TEXT_MODIFIER_SELECTORS, ORGANIZATION_TEXTS, OTP_EMAIL_PATTERN, OrganizationPage, PLURAL, PROFILE_SECTION_SELECTORS, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, RolesPage, SELECT_COUNTRY, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STORAGE_STATE, SidebarSection, SlackPage, TABLE_SELECTORS, TAB_SELECTORS, TAGS_SELECTORS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THANK_YOU_SELECTORS, THEMES_SELECTORS, THIRD_PARTY_ROUTES, TOASTR_MESSAGES, TagsPage, TeamMembers, ThankYouPage, USER_AGENTS, WEBHOOK_SELECTORS, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, currencyUtils, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, filterUtils, generateRandomBypassEmail, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, getListCount, headerUtils, hexToRGB, hexToRGBA, hyphenize, i18nFixture, initializeCredentials, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, stealth as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
|
|
194681
194752
|
//# sourceMappingURL=index.js.map
|