@bigbinary/neeto-playwright-commons 3.0.8 → 3.1.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.d.ts CHANGED
@@ -1136,6 +1136,13 @@ interface BaseMessageSearchCriteria {
1136
1136
  body: string;
1137
1137
  }
1138
1138
  type MessageSearchCriteria$1 = Partial<BaseMessageSearchCriteria>;
1139
+ type AttachmentFilter$1 = {
1140
+ name: string;
1141
+ type?: string;
1142
+ } | {
1143
+ name?: string;
1144
+ type: string;
1145
+ };
1139
1146
  interface FindMessageFilterOptions$1 {
1140
1147
  receivedAfter: Date;
1141
1148
  timeout: number;
@@ -1158,7 +1165,7 @@ interface MessageInferredData$1 {
1158
1165
  body: string;
1159
1166
  }
1160
1167
  interface Attachment$1 {
1161
- name: string;
1168
+ name: string | null;
1162
1169
  type: string;
1163
1170
  }
1164
1171
  interface FormattedList$1 {
@@ -1176,7 +1183,7 @@ interface FormattedList$1 {
1176
1183
  blobId: string;
1177
1184
  }
1178
1185
  interface AttachmentDetails$1 {
1179
- filename: string;
1186
+ filename: string | null;
1180
1187
  type: string;
1181
1188
  content: Buffer;
1182
1189
  contentType: string;
@@ -1358,11 +1365,15 @@ declare class RailsEmailUtils {
1358
1365
  }: FindOtpFromEmailParams$1) => Promise<string | undefined>;
1359
1366
  /**
1360
1367
  *
1361
- * This method is used to return the attachment based on the attachmentName of first email matching the search criteria. On top of the findMessage method, this method matches the attachment name with the attachments associated to the email. If any attachment matches then it will fetch the attachment details and return. If any attachment file name doesn't contain the substring attachmentName then it will throw an error saying No such attachment exists.
1368
+ * This method is used to return an attachment from the first email matching the search criteria. It supports filtering attachments by name, by MIME content-type, or both. If no matching attachment is found, an error is thrown.
1362
1369
  *
1363
1370
  * Note: In development environment, this method uses the Rails testing HTTP API to fetch attachments. In other environments, it uses Fastmail APIs.
1364
1371
  *
1365
- * attachmentName: A substring matching the attachment file name. It can be both with or without extension.
1372
+ * attachmentFilter: An object used to identify the attachment. At least one of the following keys should be provided:
1373
+ *
1374
+ * name (optional): A substring matched against the attachment file name.
1375
+ *
1376
+ * type (optional): A prefix matched against the attachment MIME content-type (e.g. "text/calendar"). Useful when the attachment has no filename, such as calendar invite (.ics) parts that omit Content-Disposition: attachment.
1366
1377
  *
1367
1378
  * messageSearchCriteria: An object containing the search criteria for matching the messages. The object can contain the keys, from, to, subject and body. All the keys of the object are optional. The values of the object are of string type and are case-insensitive. The following key-value pairs can be used:
1368
1379
  *
@@ -1396,22 +1407,41 @@ declare class RailsEmailUtils {
1396
1407
  *
1397
1408
  * @example
1398
1409
  *
1410
+ * // Match attachment by name
1399
1411
  * test("sample test", async ({ mailerUtils }) => {
1400
- * const message = await mailerUtils.getEmailAttachment(
1401
- * "invite",
1412
+ * const attachment = await mailerUtils.getEmailAttachment(
1413
+ * { name: "invite" },
1402
1414
  * {
1403
- * to: fastmailEmailId,
1404
- * from: senderEmailId,
1405
- * subject: "Event details",
1406
- * }, {
1407
- * receivedAfter: new Date(),
1408
- * timeout: 60 * 1000,
1409
- * expectedEmailCount: 1,
1410
- * }, false);
1415
+ * to: fastmailEmailId,
1416
+ * from: senderEmailId,
1417
+ * subject: "Event details",
1418
+ * },
1419
+ * {
1420
+ * receivedAfter: new Date(),
1421
+ * timeout: 60 * 1000,
1422
+ * expectedEmailCount: 1,
1423
+ * },
1424
+ * false
1425
+ * );
1426
+ * });
1427
+ *
1428
+ * // Match attachment by MIME type (e.g. calendar invite with no filename)
1429
+ * test("sample test", async ({ mailerUtils }) => {
1430
+ * const attachment = await mailerUtils.getEmailAttachment(
1431
+ * { type: "text/calendar" },
1432
+ * {
1433
+ * to: fastmailEmailId,
1434
+ * from: senderEmailId,
1435
+ * subject: "Event details",
1436
+ * }
1437
+ * );
1411
1438
  * });
1412
1439
  * @endexample
1413
1440
  */
1414
- getEmailAttachment: (attachmentName: string, messageSearchCriteria?: MessageSearchCriteria$1, {
1441
+ getEmailAttachment: ({
1442
+ name,
1443
+ type
1444
+ }: AttachmentFilter$1, messageSearchCriteria?: MessageSearchCriteria$1, {
1415
1445
  receivedAfter,
1416
1446
  expectedEmailCount,
1417
1447
  timeout
@@ -1461,6 +1491,13 @@ interface MessageSearchCriteria {
1461
1491
  subject: string;
1462
1492
  body: string;
1463
1493
  }
1494
+ type AttachmentFilter = {
1495
+ name: string;
1496
+ type?: string;
1497
+ } | {
1498
+ name?: string;
1499
+ type: string;
1500
+ };
1464
1501
  interface FindMessageFilterOptions {
1465
1502
  receivedAfter: Date;
1466
1503
  timeout: number;
@@ -1471,7 +1508,7 @@ interface Identifier {
1471
1508
  email: string;
1472
1509
  }
1473
1510
  interface Attachment {
1474
- name: string;
1511
+ name: string | null;
1475
1512
  type: string;
1476
1513
  }
1477
1514
  interface FindOtpFromEmailParams {
@@ -1492,7 +1529,7 @@ interface MessageInferredData {
1492
1529
  body: string;
1493
1530
  }
1494
1531
  interface AttachmentDetails {
1495
- filename: string;
1532
+ filename: string | null;
1496
1533
  type: string;
1497
1534
  content: Buffer;
1498
1535
  contentType: string;
@@ -1697,11 +1734,15 @@ declare class MailerUtils {
1697
1734
  generateRandomEmail: () => string;
1698
1735
  /**
1699
1736
  *
1700
- * This method is used to return the attachment based on the attachmentName of first email matching the search criteria. On top of the findMessage method, this method matches the attachment name with the attachments associated to the email. If any attachment matches then it will fetch the attachment details and return. If any attachment file name doesn't contain the substring attachmentName then it will throw an error saying No such attachment exists.
1737
+ * This method is used to return an attachment from the first email matching the search criteria. It supports filtering attachments by name, by MIME content-type, or both. If no matching attachment is found, an error is thrown.
1701
1738
  *
1702
1739
  * Note: In development environment, this method uses the Rails testing HTTP API to fetch attachments. In other environments, it uses Fastmail APIs.
1703
1740
  *
1704
- * attachmentName: A substring matching the attachment file name. It can be both with or without extension.
1741
+ * attachmentFilter: An object used to identify the attachment. At least one of the following keys should be provided:
1742
+ *
1743
+ * name (optional): A substring matched against the attachment file name.
1744
+ *
1745
+ * type (optional): A prefix matched against the attachment MIME content-type (e.g. "text/calendar"). Useful when the attachment has no filename, such as calendar invite (.ics) parts that omit Content-Disposition: attachment.
1705
1746
  *
1706
1747
  * messageSearchCriteria: An object containing the search criteria for matching the messages. The object can contain the keys, from, to, subject and body. All the keys of the object are optional. The values of the object are of string type and are case-insensitive. The following key-value pairs can be used:
1707
1748
  *
@@ -1735,22 +1776,41 @@ declare class MailerUtils {
1735
1776
  *
1736
1777
  * @example
1737
1778
  *
1779
+ * // Match attachment by name
1738
1780
  * test("sample test", async ({ mailerUtils }) => {
1739
- * const message = await mailerUtils.getEmailAttachment(
1740
- * "invite",
1781
+ * const attachment = await mailerUtils.getEmailAttachment(
1782
+ * { name: "invite" },
1741
1783
  * {
1742
- * to: fastmailEmailId,
1743
- * from: senderEmailId,
1744
- * subject: "Event details",
1745
- * }, {
1746
- * receivedAfter: new Date(),
1747
- * timeout: 60 * 1000,
1748
- * expectedEmailCount: 1,
1749
- * }, false);
1784
+ * to: fastmailEmailId,
1785
+ * from: senderEmailId,
1786
+ * subject: "Event details",
1787
+ * },
1788
+ * {
1789
+ * receivedAfter: new Date(),
1790
+ * timeout: 60 * 1000,
1791
+ * expectedEmailCount: 1,
1792
+ * },
1793
+ * false
1794
+ * );
1795
+ * });
1796
+ *
1797
+ * // Match attachment by MIME type (e.g. calendar invite with no filename)
1798
+ * test("sample test", async ({ mailerUtils }) => {
1799
+ * const attachment = await mailerUtils.getEmailAttachment(
1800
+ * { type: "text/calendar" },
1801
+ * {
1802
+ * to: fastmailEmailId,
1803
+ * from: senderEmailId,
1804
+ * subject: "Event details",
1805
+ * }
1806
+ * );
1750
1807
  * });
1751
1808
  * @endexample
1752
1809
  */
1753
- getEmailAttachment: (attachmentName: string, messageSearchCriteria?: Partial<MessageSearchCriteria>, {
1810
+ getEmailAttachment: ({
1811
+ name,
1812
+ type
1813
+ }: AttachmentFilter, messageSearchCriteria?: Partial<MessageSearchCriteria>, {
1754
1814
  timeout,
1755
1815
  receivedAfter,
1756
1816
  expectedEmailCount
@@ -8960,6 +9020,27 @@ declare class NeetoAuthServer {
8960
9020
  start: () => Promise<void>;
8961
9021
  stop: () => Promise<void>;
8962
9022
  }
9023
+ declare class NeetoChatWidget {
9024
+ private process;
9025
+ private hasLease;
9026
+ private logStream;
9027
+ private get serverEnv();
9028
+ private withLock;
9029
+ private parseState;
9030
+ private readState;
9031
+ private writeState;
9032
+ private clearState;
9033
+ private getLogContent;
9034
+ private ensureSetup;
9035
+ private patchWebpackPublicPath;
9036
+ private closeLogStream;
9037
+ private waitForProcessExit;
9038
+ private killServer;
9039
+ private killProcessOnWidgetPort;
9040
+ private waitForServer;
9041
+ start: () => Promise<void>;
9042
+ stop: () => Promise<void>;
9043
+ }
8963
9044
  type EmailDeliveryProvider = "gmail" | "outlook" | "sparkpost";
8964
9045
  type OAuthEmailDeliveryProvider = Exclude<EmailDeliveryProvider, "sparkpost">;
8965
9046
  type EmailDeliveryConnectParams = {
@@ -9094,5 +9175,5 @@ interface Overrides {
9094
9175
  * @endexample
9095
9176
  */
9096
9177
  declare const definePlaywrightConfig: (overrides: Overrides) => PlaywrightTestConfig<{}, {}>;
9097
- export { ACTIONS, ADMIN_PANEL_SELECTORS, ALL_RESOURCES, ANALYTICS_RESOURCES, API_KEYS_SELECTORS, API_ROUTES, APP_RESOURCES, AUDIT_LOGS_SELECTORS, ApiKeysApi, ApiKeysPage, AuditLogsPage, BASE_URL, CALENDAR_LABELS, CERTIFICATE_LIMIT_EXCEEDED_MESSAGE, CERTIFICATE_LIMIT_EXCEEDED_REGEXP, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, COMMUNITY_TEXTS, CREDENTIALS, CURRENT_TIME_RANGES, CUSTOM_DOMAIN_SELECTORS, CUSTOM_DOMAIN_SUFFIX, CustomCommands, CustomDomainApi, CustomDomainPage, DATE_FORMATS, DATE_PICKER_SELECTORS, DATE_RANGES, DATE_TEXTS, DEFAULT_WEBHOOKS_RESPONSE_TEXT, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_LABEL, EMPTY_STORAGE_STATE, ENGAGE_TEXTS, ENVIRONMENT, EXAMPLE_URL, EXPANDED_FONT_SIZE, EXPORT_FILE_TYPES, EditorPage, EmailDeliveryUtils, EmbedBase, FILE_FORMATS, FONTS_RESOURCES, FONT_SIZE_SELECTORS, FROM_EMAIL_ENV_KEYS, GLOBAL_TRANSLATIONS_PATTERN, GOOGLE_ANALYTICS_SELECTORS, GOOGLE_CALENDAR_DATE_FORMAT, GOOGLE_LOGIN_SELECTORS, GOOGLE_LOGIN_TEXTS, GOOGLE_SHEETS_SELECTORS, GooglePage, HELP_CENTER_ROUTES, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IPRestrictionsPage, IP_RESTRICTIONS_SELECTORS, IS_CI, IS_DEV_ENV, IS_STAGING_ENV, ImageUploader, IntegrationBase, IpRestrictionsApi, KEYBOARD_SHORTCUTS_SELECTORS, KEYBOARD_SHORTCUT_TEST_CASES, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MICROSOFT_LOGIN_SELECTORS, MICROSOFT_LOGIN_TEXTS, MailerUtils, Member, MemberApis, MicrosoftPage, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_SEO_SELECTORS, NEETO_TEXT_MODIFIER_SELECTORS, NeetoAuthServer, NeetoEmailDeliveryApi, NeetoTowerApi, ONBOARDING_SELECTORS, ORGANIZATION_TEXTS, OTP_EMAIL_PATTERN, OrganizationPage, PAST_TIME_RANGES, PHONE_NUMBER_FORMATS, PLURAL, PROFILE_LINKS, PROFILE_SECTION_SELECTORS, PROJECT_NAMES, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, RailsEmailApiClient, RailsEmailUtils, RoleApis, RolesPage, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STATUS_TEXTS, STORAGE_STATE, SecurityApi, SidebarSection, SlackApi, SlackPage, TABLE_SELECTORS, TAB_SELECTORS, TAGS_SELECTORS, TEAM_MEMBER_TEXTS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THANK_YOU_SELECTORS, THEMES_SELECTORS, THEMES_TEXTS, THIRD_PARTY_RESOURCES, THIRD_PARTY_ROUTES, TIME_RANGES, TOASTR_MESSAGES, TWILIO_SELECTORS, TagsApi, TagsPage, TeamMembers, ThankYouApi, ThankYouPage, TwilioApi, USER_AGENTS, WEBHOOK_SELECTORS, WebhookSiteApi, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, baseURLGenerator, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, createOrganizationViaRake, currencyUtils, dataQa, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, fillCredentialsAndSubmit, filterUtils, generatePhoneNumber, generatePhoneNumberDetails, generateRandomBypassEmail, generateRandomFile, generateStagingData, getByDataQA, getClipboardContent, getFormattedPhoneNumber, getFullUrl, getGlobalUserProps, getGlobalUserState, getImagePathAndName, getIsoCodeFromPhoneCode, getListCount, globalShortcuts, grantClipboardPermissions, hexToRGB, hexToRGBA, i18nFixture, imageRegex, initializeCredentials, initializeTestData, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, serializeFileForBrowser, shouldSkipCustomDomainSetup, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, warmup, writeDataToFile };
9178
+ export { ACTIONS, ADMIN_PANEL_SELECTORS, ALL_RESOURCES, ANALYTICS_RESOURCES, API_KEYS_SELECTORS, API_ROUTES, APP_RESOURCES, AUDIT_LOGS_SELECTORS, ApiKeysApi, ApiKeysPage, AuditLogsPage, BASE_URL, CALENDAR_LABELS, CERTIFICATE_LIMIT_EXCEEDED_MESSAGE, CERTIFICATE_LIMIT_EXCEEDED_REGEXP, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, COMMUNITY_TEXTS, CREDENTIALS, CURRENT_TIME_RANGES, CUSTOM_DOMAIN_SELECTORS, CUSTOM_DOMAIN_SUFFIX, ColorPickerUtils, CustomCommands, CustomDomainApi, CustomDomainPage, DATE_FORMATS, DATE_PICKER_SELECTORS, DATE_RANGES, DATE_TEXTS, DEFAULT_WEBHOOKS_RESPONSE_TEXT, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_LABEL, EMPTY_STORAGE_STATE, ENGAGE_TEXTS, ENVIRONMENT, EXAMPLE_URL, EXPANDED_FONT_SIZE, EXPORT_FILE_TYPES, EditorPage, EmailDeliveryUtils, EmbedBase, FILE_FORMATS, FONTS_RESOURCES, FONT_SIZE_SELECTORS, FROM_EMAIL_ENV_KEYS, GLOBAL_TRANSLATIONS_PATTERN, GOOGLE_ANALYTICS_SELECTORS, GOOGLE_CALENDAR_DATE_FORMAT, GOOGLE_LOGIN_SELECTORS, GOOGLE_LOGIN_TEXTS, GOOGLE_SHEETS_SELECTORS, GooglePage, HELP_CENTER_ROUTES, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IPRestrictionsPage, IP_RESTRICTIONS_SELECTORS, IS_CI, IS_DEV_ENV, IS_STAGING_ENV, ImageUploader, IntegrationBase, IpRestrictionsApi, KEYBOARD_SHORTCUTS_SELECTORS, KEYBOARD_SHORTCUT_TEST_CASES, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MICROSOFT_LOGIN_SELECTORS, MICROSOFT_LOGIN_TEXTS, MailerUtils, Member, MemberApis, MicrosoftPage, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_SEO_SELECTORS, NEETO_TEXT_MODIFIER_SELECTORS, NeetoAuthServer, NeetoChatWidget, NeetoEmailDeliveryApi, NeetoTowerApi, ONBOARDING_SELECTORS, ORGANIZATION_TEXTS, OTP_EMAIL_PATTERN, OrganizationPage, PAST_TIME_RANGES, PHONE_NUMBER_FORMATS, PLURAL, PROFILE_LINKS, PROFILE_SECTION_SELECTORS, PROJECT_NAMES, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, RailsEmailApiClient, RailsEmailUtils, RoleApis, RolesPage, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STATUS_TEXTS, STORAGE_STATE, SecurityApi, SidebarSection, SlackApi, SlackPage, TABLE_SELECTORS, TAB_SELECTORS, TAGS_SELECTORS, TEAM_MEMBER_TEXTS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THANK_YOU_SELECTORS, THEMES_SELECTORS, THEMES_TEXTS, THIRD_PARTY_RESOURCES, THIRD_PARTY_ROUTES, TIME_RANGES, TOASTR_MESSAGES, TWILIO_SELECTORS, TagsApi, TagsPage, TeamMembers, ThankYouApi, ThankYouPage, TwilioApi, USER_AGENTS, WEBHOOK_SELECTORS, WebhookSiteApi, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, baseURLGenerator, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, createOrganizationViaRake, currencyUtils, dataQa, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, fillCredentialsAndSubmit, filterUtils, generatePhoneNumber, generatePhoneNumberDetails, generateRandomBypassEmail, generateRandomFile, generateStagingData, getByDataQA, getClipboardContent, getFormattedPhoneNumber, getFullUrl, getGlobalUserProps, getGlobalUserState, getImagePathAndName, getIsoCodeFromPhoneCode, getListCount, globalShortcuts, grantClipboardPermissions, hexToRGB, hexToRGBA, i18nFixture, imageRegex, initializeCredentials, initializeTestData, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, serializeFileForBrowser, shouldSkipCustomDomainSetup, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, warmup, writeDataToFile };
9098
9179
  export type { BaseThemeStyle, BaseThemeStyleType, ColumnMenuAction, CountryProps, CustomFixture, EmailDeliveryConnectParams, EmailDeliveryProvider, EmailDeliveryVerifiedEmail, EmailDeliveryVerifyEmailParams, EmailDeliveryVerifyEmailResponse, EmailMatchCriteria, IntroPageThemeStyle, IntroPageThemeStyleType, OAuthEmailDeliveryProvider, ProjectName, ThemeCategory, ValueOf };