@bigbinary/neeto-playwright-commons 1.19.0 → 1.19.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.cjs.js +111 -9
- package/index.cjs.js.map +1 -1
- package/index.d.ts +148 -4
- package/index.js +109 -10
- 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';
|
|
@@ -49,6 +49,11 @@ type ParamFilters = FilterProps[];
|
|
|
49
49
|
type BasicTypesInterface = Record<string, number | string | boolean>;
|
|
50
50
|
type ParamProps = Record<string, number | string | boolean | ParamFilters>;
|
|
51
51
|
type HttpMethods = "get" | "patch" | "post" | "put" | "delete";
|
|
52
|
+
type FileType = "csv" | "avi" | "doc" | "docx" | "flv" | "html" | "mp3" | "mp4" | "mpg" | "pdf" | "rtf" | "txt" | "webm" | "xls" | "xlsx" | "wma" | "zip" | "jpg" | "jpeg" | "png" | "gif";
|
|
53
|
+
interface BreadcrumbTitleAndRoute$1 {
|
|
54
|
+
title: string;
|
|
55
|
+
route: string;
|
|
56
|
+
}
|
|
52
57
|
interface ApiRequestProps {
|
|
53
58
|
url: string;
|
|
54
59
|
failOnStatusCode?: boolean;
|
|
@@ -477,6 +482,75 @@ declare class CustomCommands {
|
|
|
477
482
|
* @endexample
|
|
478
483
|
*/
|
|
479
484
|
hideTooltip: (triggerElement: Locator, customPageContext?: Page) => Promise<void>;
|
|
485
|
+
/**
|
|
486
|
+
*
|
|
487
|
+
* Verifies the breadcrumbs in the header of a web page. It takes the following parameters:
|
|
488
|
+
*
|
|
489
|
+
* page: An instance of the Playwright Page class representing the web page where the breadcrumbs are located.
|
|
490
|
+
*
|
|
491
|
+
* titlesAndRoutes: An array of objects containing the titles and routes of the breadcrumbs to verify.
|
|
492
|
+
*
|
|
493
|
+
* @example
|
|
494
|
+
*
|
|
495
|
+
* import { Page } from "@playwright/test";
|
|
496
|
+
* import { headerUtils } from "@bigbinary/neeto-playwright-commons";
|
|
497
|
+
*
|
|
498
|
+
* const breadcrumbs = [
|
|
499
|
+
* { title: "Home", route: "/" },
|
|
500
|
+
* { title: "Category", route: "/category" },
|
|
501
|
+
* { title: "Subcategory", route: "/category/subcategory" }
|
|
502
|
+
* ];
|
|
503
|
+
*
|
|
504
|
+
* await headerUtils.verifyBreadcrumbs({
|
|
505
|
+
* page,
|
|
506
|
+
* titlesAndRoutes: breadcrumbs
|
|
507
|
+
* });
|
|
508
|
+
* @endexample
|
|
509
|
+
*/
|
|
510
|
+
verifyBreadcrumbs: (titlesAndRoutes: BreadcrumbTitleAndRoute$1[]) => Promise<void>;
|
|
511
|
+
/**
|
|
512
|
+
*
|
|
513
|
+
* Function to upload a file by simulating a drop event on a droppable zone using the DataTransfer API.
|
|
514
|
+
*
|
|
515
|
+
* Note: React-dropzone, by default, uses File System API to upload files. Due to this we cannot use directly use waitForEvent("filechooser"). Ref: https://github.com/microsoft/playwright/issues/8850
|
|
516
|
+
*
|
|
517
|
+
* file: The File object to be uploaded. (e.g., using generateRandomFile()).
|
|
518
|
+
*
|
|
519
|
+
* dispatchEvent (optional): The DOM event to dispatch. Defaults to "drop".
|
|
520
|
+
*
|
|
521
|
+
* droppableZone (optional): A Playwright Locator representing the area to drop the file. Defaults to this.page.getByTestId("file-upload-body")
|
|
522
|
+
*
|
|
523
|
+
* @example
|
|
524
|
+
*
|
|
525
|
+
* import { generateRandomFile } from "@utils/fileUtils";
|
|
526
|
+
*
|
|
527
|
+
* const { file } = generateRandomFile({
|
|
528
|
+
* sizeInKB: 1024,
|
|
529
|
+
* fileType: "pdf",
|
|
530
|
+
* });
|
|
531
|
+
*
|
|
532
|
+
* await neetoPlaywrightUtilities.uploadFileViaDispatchV2({ file });
|
|
533
|
+
* @endexample
|
|
534
|
+
*/
|
|
535
|
+
uploadFileViaDispatchV2: ({
|
|
536
|
+
droppableZone,
|
|
537
|
+
dispatchEvent,
|
|
538
|
+
file
|
|
539
|
+
}: {
|
|
540
|
+
file: File;
|
|
541
|
+
dispatchEvent?: string;
|
|
542
|
+
droppableZone?: Locator;
|
|
543
|
+
}) => Promise<void>;
|
|
544
|
+
}
|
|
545
|
+
declare class MemberApis {
|
|
546
|
+
private neetoPlaywrightUtilities;
|
|
547
|
+
private readonly teamsBaseUrl;
|
|
548
|
+
constructor(neetoPlaywrightUtilities: CustomCommands);
|
|
549
|
+
create: (body: Record<string, unknown>) => Promise<playwright_core.APIResponse | undefined>;
|
|
550
|
+
jobStatus: (jobId: string) => Promise<playwright_core.APIResponse | undefined>;
|
|
551
|
+
fetch: (params: ParamProps) => Promise<playwright_core.APIResponse | undefined>;
|
|
552
|
+
update: (memberId: string, body: Record<string, unknown>) => Promise<playwright_core.APIResponse | undefined>;
|
|
553
|
+
bulkUpdate: (body: Record<string, unknown>) => Promise<playwright_core.APIResponse | undefined>;
|
|
480
554
|
}
|
|
481
555
|
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
556
|
interface MessageSearchCriteria {
|
|
@@ -2109,7 +2183,7 @@ interface EditMemberProps$1 {
|
|
|
2109
2183
|
}
|
|
2110
2184
|
declare class Member {
|
|
2111
2185
|
private neetoPlaywrightUtilities;
|
|
2112
|
-
memberApis: MemberApis;
|
|
2186
|
+
memberApis: MemberApis$1;
|
|
2113
2187
|
constructor(neetoPlaywrightUtilities: CustomCommands);
|
|
2114
2188
|
addMemberViaRequest: ({
|
|
2115
2189
|
email,
|
|
@@ -6648,6 +6722,76 @@ declare const simulateClickWithDelay: ({
|
|
|
6648
6722
|
element: Locator;
|
|
6649
6723
|
page: Page;
|
|
6650
6724
|
}) => Promise<void>;
|
|
6725
|
+
interface GenerateRandomFileProps {
|
|
6726
|
+
sizeInKB: number;
|
|
6727
|
+
fileType: FileType;
|
|
6728
|
+
fileName?: string;
|
|
6729
|
+
}
|
|
6730
|
+
/**
|
|
6731
|
+
*
|
|
6732
|
+
* Used to serialize a File object into a format that can be passed into the browser context using Playwright’s evaluateHandle.
|
|
6733
|
+
*
|
|
6734
|
+
* This is required because DOM File instances can't be transferred directly between Node and browser contexts.
|
|
6735
|
+
*
|
|
6736
|
+
* file: A File object generated in the Node/test context.
|
|
6737
|
+
*
|
|
6738
|
+
* Returns a plain object containing:
|
|
6739
|
+
*
|
|
6740
|
+
* name: File name.
|
|
6741
|
+
*
|
|
6742
|
+
* type: MIME type.
|
|
6743
|
+
*
|
|
6744
|
+
* lastModified: Last modified timestamp.
|
|
6745
|
+
*
|
|
6746
|
+
* buffer: Byte array representing file contents (as a regular array).
|
|
6747
|
+
*
|
|
6748
|
+
* @example
|
|
6749
|
+
*
|
|
6750
|
+
* import { serializeFileForBrowser } from "@utils/fileUtils";
|
|
6751
|
+
*
|
|
6752
|
+
* const serializedFile = await serializeFileForBrowser(file);
|
|
6753
|
+
* @endexample
|
|
6754
|
+
*/
|
|
6755
|
+
declare const serializeFileForBrowser: (file: File) => Promise<{
|
|
6756
|
+
name: string;
|
|
6757
|
+
type: string;
|
|
6758
|
+
lastModified: number;
|
|
6759
|
+
buffer: number[];
|
|
6760
|
+
}>;
|
|
6761
|
+
/**
|
|
6762
|
+
*
|
|
6763
|
+
* Used to generate a random File object of a specific size and type.
|
|
6764
|
+
*
|
|
6765
|
+
* sizeInKB: Size of the file in KB.
|
|
6766
|
+
*
|
|
6767
|
+
* fileType: Type/extension of the file (e.g., 'png', 'pdf', 'jpg').
|
|
6768
|
+
*
|
|
6769
|
+
* fileName (optional): Custom name for the generated file. Defaults to sample.{fileType}.
|
|
6770
|
+
*
|
|
6771
|
+
* Returns an object containing:
|
|
6772
|
+
*
|
|
6773
|
+
* file: The generated File object.
|
|
6774
|
+
*
|
|
6775
|
+
* fileName: The file name as a string.
|
|
6776
|
+
*
|
|
6777
|
+
* @example
|
|
6778
|
+
*
|
|
6779
|
+
* import { generateRandomFile } from "@utils/fileUtils";
|
|
6780
|
+
*
|
|
6781
|
+
* const { file, fileName } = generateRandomFile({
|
|
6782
|
+
* sizeInKB: 1024,
|
|
6783
|
+
* fileType: "png",
|
|
6784
|
+
* });
|
|
6785
|
+
* @endexample
|
|
6786
|
+
*/
|
|
6787
|
+
declare const generateRandomFile: ({
|
|
6788
|
+
sizeInKB,
|
|
6789
|
+
fileType,
|
|
6790
|
+
fileName
|
|
6791
|
+
}: GenerateRandomFileProps) => {
|
|
6792
|
+
file: File;
|
|
6793
|
+
fileName: string;
|
|
6794
|
+
};
|
|
6651
6795
|
interface PlaydashOverrides {
|
|
6652
6796
|
projectKey: string;
|
|
6653
6797
|
}
|
|
@@ -6675,4 +6819,4 @@ interface Overrides {
|
|
|
6675
6819
|
* @endexample
|
|
6676
6820
|
*/
|
|
6677
6821
|
declare const definePlaywrightConfig: (overrides: Overrides) => _playwright_test.PlaywrightTestConfig<{}, {}>;
|
|
6678
|
-
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 };
|
|
6822
|
+
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, generateRandomFile, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, getListCount, headerUtils, hexToRGB, hexToRGBA, hyphenize, i18nFixture, initializeCredentials, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, serializeFileForBrowser, 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",
|
|
@@ -741,6 +771,53 @@ const API_KEYS_SELECTORS = {
|
|
|
741
771
|
addApiKeyButton: "add-api-key-button",
|
|
742
772
|
};
|
|
743
773
|
|
|
774
|
+
const mimeTypeMap = {
|
|
775
|
+
csv: "text/csv",
|
|
776
|
+
avi: "video/x-msvideo",
|
|
777
|
+
doc: "application/msword",
|
|
778
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
779
|
+
flv: "video/x-flv",
|
|
780
|
+
html: "text/html",
|
|
781
|
+
mp3: "audio/mpeg",
|
|
782
|
+
mp4: "video/mp4",
|
|
783
|
+
mpg: "video/mpeg",
|
|
784
|
+
pdf: "application/pdf",
|
|
785
|
+
rtf: "application/rtf",
|
|
786
|
+
txt: "text/plain",
|
|
787
|
+
webm: "video/webm",
|
|
788
|
+
xls: "application/vnd.ms-excel",
|
|
789
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
790
|
+
wma: "audio/x-ms-wma",
|
|
791
|
+
zip: "application/zip",
|
|
792
|
+
jpg: "image/jpeg",
|
|
793
|
+
jpeg: "image/jpeg",
|
|
794
|
+
png: "image/png",
|
|
795
|
+
gif: "image/gif",
|
|
796
|
+
};
|
|
797
|
+
const fillRandomBytes = (byteArray) => {
|
|
798
|
+
const CHUNK_SIZE = 65536; //Maximum allowed per call by crypto.getRandomValues.
|
|
799
|
+
for (let i = 0; i < byteArray.length; i += CHUNK_SIZE) {
|
|
800
|
+
crypto.getRandomValues(byteArray.subarray(i, i + CHUNK_SIZE));
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
const serializeFileForBrowser = async (file) => {
|
|
804
|
+
const buffer = await file.arrayBuffer();
|
|
805
|
+
return {
|
|
806
|
+
name: file.name,
|
|
807
|
+
type: file.type,
|
|
808
|
+
lastModified: file.lastModified,
|
|
809
|
+
buffer: Array.from(new Uint8Array(buffer)),
|
|
810
|
+
};
|
|
811
|
+
};
|
|
812
|
+
const generateRandomFile = ({ sizeInKB, fileType, fileName = `sample.${fileType}`, }) => {
|
|
813
|
+
const mimeType = mimeTypeMap[fileType];
|
|
814
|
+
const byteArray = new Uint8Array(sizeInKB * 1024);
|
|
815
|
+
fillRandomBytes(byteArray);
|
|
816
|
+
const blob = new Blob([byteArray], { type: mimeType });
|
|
817
|
+
const file = new File([blob], fileName, { type: mimeType });
|
|
818
|
+
return { file, fileName };
|
|
819
|
+
};
|
|
820
|
+
|
|
744
821
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
745
822
|
|
|
746
823
|
function getDefaultExportFromCjs (x) {
|
|
@@ -4076,6 +4153,25 @@ class CustomCommands {
|
|
|
4076
4153
|
await expect(tooltip).toHaveCount(0);
|
|
4077
4154
|
}).toPass({ timeout: 30000 });
|
|
4078
4155
|
};
|
|
4156
|
+
this.verifyBreadcrumbs = async (titlesAndRoutes) => {
|
|
4157
|
+
const breadcrumbHeader = this.page.getByTestId(COMMON_SELECTORS.breadcrumbHeader);
|
|
4158
|
+
await expect(breadcrumbHeader).toHaveCount(titlesAndRoutes.length);
|
|
4159
|
+
await Promise.all(titlesAndRoutes.map(({ title, route }) => expect(breadcrumbHeader.getByRole("link", {
|
|
4160
|
+
name: title,
|
|
4161
|
+
exact: true,
|
|
4162
|
+
})).toHaveAttribute("href", route)));
|
|
4163
|
+
};
|
|
4164
|
+
this.uploadFileViaDispatchV2 = async ({ droppableZone = this.page.getByTestId(COMMON_SELECTORS.fileUploadBody), dispatchEvent = "drop", file, }) => {
|
|
4165
|
+
const serializedFile = await serializeFileForBrowser(file);
|
|
4166
|
+
const dataTransfer = await droppableZone.evaluateHandle(async (_, { name, type, buffer, lastModified }) => {
|
|
4167
|
+
const uint8Array = new Uint8Array(buffer);
|
|
4168
|
+
const file = new File([uint8Array], name, { type, lastModified });
|
|
4169
|
+
const dataTransfer = new DataTransfer();
|
|
4170
|
+
dataTransfer.items.add(file);
|
|
4171
|
+
return dataTransfer;
|
|
4172
|
+
}, serializedFile);
|
|
4173
|
+
await droppableZone.dispatchEvent(dispatchEvent, { dataTransfer });
|
|
4174
|
+
};
|
|
4079
4175
|
this.page = page;
|
|
4080
4176
|
this.responses = [];
|
|
4081
4177
|
this.request = request;
|
|
@@ -35506,7 +35602,7 @@ var punycode_es6 = /*#__PURE__*/Object.freeze({
|
|
|
35506
35602
|
|
|
35507
35603
|
var require$$4$1 = /*@__PURE__*/getAugmentedNamespace(punycode_es6);
|
|
35508
35604
|
|
|
35509
|
-
const crypto$
|
|
35605
|
+
const crypto$2 = require$$0$5;
|
|
35510
35606
|
const Transform$1 = Stream$4.Transform;
|
|
35511
35607
|
|
|
35512
35608
|
let StreamHash$1 = class StreamHash extends Transform$1 {
|
|
@@ -35514,7 +35610,7 @@ let StreamHash$1 = class StreamHash extends Transform$1 {
|
|
|
35514
35610
|
super();
|
|
35515
35611
|
this.attachment = attachment;
|
|
35516
35612
|
this.algo = (algo || 'md5').toLowerCase();
|
|
35517
|
-
this.hash = crypto$
|
|
35613
|
+
this.hash = crypto$2.createHash(algo);
|
|
35518
35614
|
this.byteCount = 0;
|
|
35519
35615
|
}
|
|
35520
35616
|
|
|
@@ -61672,6 +61768,9 @@ const tableUtils = {
|
|
|
61672
61768
|
verifyFreezeColumnAction,
|
|
61673
61769
|
};
|
|
61674
61770
|
|
|
61771
|
+
/**
|
|
61772
|
+
* @deprecated This method is deprecated. Use verifyBreadcrumbs from neetoPlaywrightUtilities instead.
|
|
61773
|
+
*/
|
|
61675
61774
|
const verifyBreadcrumbs = async ({ page, titlesAndRoutes, }) => {
|
|
61676
61775
|
await expect(page.getByTestId(COMMON_SELECTORS.breadcrumbHeader)).toHaveCount(titlesAndRoutes.length);
|
|
61677
61776
|
await Promise.all(titlesAndRoutes.map(({ title, route }) => expect(page.getByTestId(COMMON_SELECTORS.breadcrumbHeader).getByRole("link", {
|
|
@@ -143129,7 +143228,7 @@ const Readable = Stream$4.Readable;
|
|
|
143129
143228
|
const BUFFER = Symbol('buffer');
|
|
143130
143229
|
const TYPE = Symbol('type');
|
|
143131
143230
|
|
|
143132
|
-
class Blob {
|
|
143231
|
+
let Blob$1 = class Blob {
|
|
143133
143232
|
constructor() {
|
|
143134
143233
|
this[TYPE] = '';
|
|
143135
143234
|
|
|
@@ -143220,15 +143319,15 @@ class Blob {
|
|
|
143220
143319
|
blob[BUFFER] = slicedBuffer;
|
|
143221
143320
|
return blob;
|
|
143222
143321
|
}
|
|
143223
|
-
}
|
|
143322
|
+
};
|
|
143224
143323
|
|
|
143225
|
-
Object.defineProperties(Blob.prototype, {
|
|
143324
|
+
Object.defineProperties(Blob$1.prototype, {
|
|
143226
143325
|
size: { enumerable: true },
|
|
143227
143326
|
type: { enumerable: true },
|
|
143228
143327
|
slice: { enumerable: true }
|
|
143229
143328
|
});
|
|
143230
143329
|
|
|
143231
|
-
Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
|
|
143330
|
+
Object.defineProperty(Blob$1.prototype, Symbol.toStringTag, {
|
|
143232
143331
|
value: 'Blob',
|
|
143233
143332
|
writable: false,
|
|
143234
143333
|
enumerable: false,
|
|
@@ -143360,7 +143459,7 @@ Body.prototype = {
|
|
|
143360
143459
|
return consumeBody.call(this).then(function (buf) {
|
|
143361
143460
|
return Object.assign(
|
|
143362
143461
|
// Prevent copying
|
|
143363
|
-
new Blob([], {
|
|
143462
|
+
new Blob$1([], {
|
|
143364
143463
|
type: ct.toLowerCase()
|
|
143365
143464
|
}), {
|
|
143366
143465
|
[BUFFER]: buf
|
|
@@ -194177,7 +194276,7 @@ var require$$4 = {
|
|
|
194177
194276
|
const fs = fs__default;
|
|
194178
194277
|
const path = Path__default;
|
|
194179
194278
|
const os = require$$0$6;
|
|
194180
|
-
const crypto = require$$0$5;
|
|
194279
|
+
const crypto$1 = require$$0$5;
|
|
194181
194280
|
const packageJson = require$$4;
|
|
194182
194281
|
|
|
194183
194282
|
const version = packageJson.version;
|
|
@@ -194463,7 +194562,7 @@ function decrypt (encrypted, keyStr) {
|
|
|
194463
194562
|
ciphertext = ciphertext.subarray(12, -16);
|
|
194464
194563
|
|
|
194465
194564
|
try {
|
|
194466
|
-
const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce);
|
|
194565
|
+
const aesgcm = crypto$1.createDecipheriv('aes-256-gcm', key, nonce);
|
|
194467
194566
|
aesgcm.setAuthTag(authTag);
|
|
194468
194567
|
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`
|
|
194469
194568
|
} catch (error) {
|
|
@@ -194718,5 +194817,5 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
194718
194817
|
});
|
|
194719
194818
|
};
|
|
194720
194819
|
|
|
194721
|
-
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 };
|
|
194820
|
+
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, generateRandomFile, generateStagingData, getByDataQA, getGlobalUserState, getImagePathAndName, getListCount, headerUtils, hexToRGB, hexToRGBA, hyphenize, i18nFixture, initializeCredentials, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, serializeFileForBrowser, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, stealth as stealthTest, tableUtils, toCamelCase, updateCredentials, writeDataToFile };
|
|
194722
194821
|
//# sourceMappingURL=index.js.map
|