@bigbinary/neeto-playwright-commons 2.1.5 → 2.2.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/README.md +1 -0
- package/index.cjs.js +332 -146
- package/index.cjs.js.map +1 -1
- package/index.d.ts +43 -22
- package/index.js +332 -149
- package/index.js.map +1 -1
- package/package.json +3 -2
- package/scripts/neeto-auth/playwright_email_capture.rb.template +59 -0
- package/scripts/neeto-auth/setup.sh +24 -0
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as playwright_core from 'playwright-core';
|
|
2
2
|
import * as _playwright_test from '@playwright/test';
|
|
3
|
-
import { Page, APIRequestContext, Response, APIResponse, Locator, Fixtures, PlaywrightWorkerArgs, PlaywrightWorkerOptions, PlaywrightTestArgs, PlaywrightTestOptions, Browser,
|
|
3
|
+
import { Page, APIRequestContext, Response, APIResponse, Locator, BrowserContext, Fixtures, PlaywrightWorkerArgs, PlaywrightWorkerOptions, PlaywrightTestArgs, PlaywrightTestOptions, Browser, FrameLocator, CDPSession, PlaywrightTestConfig, LaunchOptions } from '@playwright/test';
|
|
4
4
|
import { TFunction } from 'i18next';
|
|
5
5
|
import { I18nPlaywrightFixture } from 'playwright-i18next-fixture';
|
|
6
6
|
import { TOTP, Secret } from 'otpauth';
|
|
@@ -805,16 +805,18 @@ interface BaseRailsEmailSearchParams {
|
|
|
805
805
|
receivedAfter: string;
|
|
806
806
|
}
|
|
807
807
|
type RailsEmailSearchParams = Partial<BaseRailsEmailSearchParams>;
|
|
808
|
-
declare class
|
|
809
|
-
private
|
|
808
|
+
declare class RailsEmailApiClient {
|
|
809
|
+
private readonly port;
|
|
810
|
+
private readonly subdomain;
|
|
811
|
+
private readonly baseUrl;
|
|
812
|
+
private readonly emailsEndpoint;
|
|
810
813
|
constructor();
|
|
811
814
|
private convertRawEmail;
|
|
812
|
-
private
|
|
813
|
-
private
|
|
815
|
+
private buildQueryString;
|
|
816
|
+
private fetchJson;
|
|
814
817
|
listEmails: (searchParams?: RailsEmailSearchParams) => Promise<RailsEmail[]>;
|
|
815
|
-
private buildSearchArgs;
|
|
816
818
|
getLatestEmail: (searchParams?: RailsEmailSearchParams) => Promise<RailsEmail | null>;
|
|
817
|
-
clearEmails: () => Promise<
|
|
819
|
+
clearEmails: () => Promise<unknown>;
|
|
818
820
|
}
|
|
819
821
|
declare class RoleApis {
|
|
820
822
|
private neetoPlaywrightUtilities;
|
|
@@ -1144,10 +1146,10 @@ interface AttachmentDetails$1 {
|
|
|
1144
1146
|
}
|
|
1145
1147
|
declare class RailsEmailUtils {
|
|
1146
1148
|
private neetoPlaywrightUtilities;
|
|
1147
|
-
private
|
|
1149
|
+
private railsEmailClient;
|
|
1148
1150
|
constructor(neetoPlaywrightUtilities: CustomCommands);
|
|
1149
1151
|
private convertRailsEmailToFormattedList;
|
|
1150
|
-
clearEmails: () => Promise<
|
|
1152
|
+
clearEmails: () => Promise<unknown>;
|
|
1151
1153
|
getLatestEmail: (searchParams: RailsEmailSearchParams) => Promise<RailsEmail | null>;
|
|
1152
1154
|
listEmails: (searchParams?: RailsEmailSearchParams) => Promise<RailsEmail[]>;
|
|
1153
1155
|
/**
|
|
@@ -1223,7 +1225,7 @@ declare class RailsEmailUtils {
|
|
|
1223
1225
|
*
|
|
1224
1226
|
* This method is used to find a first email matching the search criteria. On top of the listMessage method, this method waits until a specific mail is received or the timeout is exceeded. This method is useful for fetching an email once an action is triggered since it waits for the message delivery and can be customized according to delays in email deliveries.
|
|
1225
1227
|
*
|
|
1226
|
-
* Note: In development environment, this method uses Rails
|
|
1228
|
+
* Note: In development environment, this method uses the Rails testing HTTP API to find messages. In other environments, it uses Fastmail APIs.
|
|
1227
1229
|
*
|
|
1228
1230
|
* 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:
|
|
1229
1231
|
*
|
|
@@ -1292,7 +1294,7 @@ declare class RailsEmailUtils {
|
|
|
1292
1294
|
*
|
|
1293
1295
|
* A helper method that is used to find the first code value from the matching email body. This method has been built to match the Neeto OTP emails.
|
|
1294
1296
|
*
|
|
1295
|
-
* Note: In development environment, this method uses Rails
|
|
1297
|
+
* Note: In development environment, this method uses the Rails testing HTTP API to find OTP. In other environments, it uses Fastmail APIs.
|
|
1296
1298
|
*
|
|
1297
1299
|
* The method accepts the following named arguments:
|
|
1298
1300
|
*
|
|
@@ -1320,7 +1322,7 @@ declare class RailsEmailUtils {
|
|
|
1320
1322
|
*
|
|
1321
1323
|
* 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.
|
|
1322
1324
|
*
|
|
1323
|
-
* Note: In development environment, this method uses Rails
|
|
1325
|
+
* Note: In development environment, this method uses the Rails testing HTTP API to fetch attachments. In other environments, it uses Fastmail APIs.
|
|
1324
1326
|
*
|
|
1325
1327
|
* attachmentName: A substring matching the attachment file name. It can be both with or without extension.
|
|
1326
1328
|
*
|
|
@@ -1554,7 +1556,7 @@ declare class MailerUtils {
|
|
|
1554
1556
|
*
|
|
1555
1557
|
* This method is used to find a first email matching the search criteria. On top of the listMessage method, this method waits until a specific mail is received or the timeout is exceeded. This method is useful for fetching an email once an action is triggered since it waits for the message delivery and can be customized according to delays in email deliveries.
|
|
1556
1558
|
*
|
|
1557
|
-
* Note: In development environment, this method uses Rails
|
|
1559
|
+
* Note: In development environment, this method uses the Rails testing HTTP API to find messages. In other environments, it uses Fastmail APIs.
|
|
1558
1560
|
*
|
|
1559
1561
|
* 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:
|
|
1560
1562
|
*
|
|
@@ -1623,7 +1625,7 @@ declare class MailerUtils {
|
|
|
1623
1625
|
*
|
|
1624
1626
|
* A helper method that is used to find the first code value from the matching email body. This method has been built to match the Neeto OTP emails.
|
|
1625
1627
|
*
|
|
1626
|
-
* Note: In development environment, this method uses Rails
|
|
1628
|
+
* Note: In development environment, this method uses the Rails testing HTTP API to find OTP. In other environments, it uses Fastmail APIs.
|
|
1627
1629
|
*
|
|
1628
1630
|
* The method accepts the following named arguments:
|
|
1629
1631
|
*
|
|
@@ -1651,19 +1653,15 @@ declare class MailerUtils {
|
|
|
1651
1653
|
*
|
|
1652
1654
|
* Generates a random Fastmail email based on the value of the FASTMAIL_DOMAIN_NAME environment variable.
|
|
1653
1655
|
*
|
|
1654
|
-
*
|
|
1655
|
-
*
|
|
1656
|
-
* Returns a random mixed-cased email ending with the FASTMAIL_DOMAIN_NAME. If shouldUseBypassEmail is true, it returns a random email to bypass OTP verification and log into
|
|
1657
|
-
*
|
|
1658
|
-
* neeto products.
|
|
1656
|
+
* Returns a random mixed-cased email ending with the FASTMAIL_DOMAIN_NAME.
|
|
1659
1657
|
*
|
|
1660
1658
|
*/
|
|
1661
|
-
generateRandomEmail: (
|
|
1659
|
+
generateRandomEmail: () => string;
|
|
1662
1660
|
/**
|
|
1663
1661
|
*
|
|
1664
1662
|
* 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.
|
|
1665
1663
|
*
|
|
1666
|
-
* Note: In development environment, this method uses Rails
|
|
1664
|
+
* Note: In development environment, this method uses the Rails testing HTTP API to fetch attachments. In other environments, it uses Fastmail APIs.
|
|
1667
1665
|
*
|
|
1668
1666
|
* attachmentName: A substring matching the attachment file name. It can be both with or without extension.
|
|
1669
1667
|
*
|
|
@@ -1831,6 +1829,7 @@ declare class ColorPickerUtils {
|
|
|
1831
1829
|
}
|
|
1832
1830
|
interface CustomFixture {
|
|
1833
1831
|
neetoPlaywrightUtilities: CustomCommands;
|
|
1832
|
+
context: BrowserContext;
|
|
1834
1833
|
page: Page;
|
|
1835
1834
|
health: Health;
|
|
1836
1835
|
mailerUtils: MailerUtils;
|
|
@@ -8892,6 +8891,28 @@ declare const getFormattedPhoneNumber: (countryName: string, phoneNumber: string
|
|
|
8892
8891
|
* @endexample
|
|
8893
8892
|
*/
|
|
8894
8893
|
declare const generatePhoneNumberDetails: () => CountryProps;
|
|
8894
|
+
interface WarmupOptions {
|
|
8895
|
+
urls?: string[];
|
|
8896
|
+
timeout?: number;
|
|
8897
|
+
}
|
|
8898
|
+
declare function warmup({
|
|
8899
|
+
urls,
|
|
8900
|
+
timeout
|
|
8901
|
+
}?: WarmupOptions): Promise<void>;
|
|
8902
|
+
declare class NeetoAuthServer {
|
|
8903
|
+
private process;
|
|
8904
|
+
private targetApp;
|
|
8905
|
+
constructor(appName: NeetoProducts);
|
|
8906
|
+
private get serverEnv();
|
|
8907
|
+
private waitForProcessExit;
|
|
8908
|
+
private killServerOnPort;
|
|
8909
|
+
private ensureSetup;
|
|
8910
|
+
private waitForServer;
|
|
8911
|
+
private injectEmailCaptureInitializer;
|
|
8912
|
+
private isRunningForCurrentApp;
|
|
8913
|
+
start: () => Promise<void>;
|
|
8914
|
+
stop: () => Promise<void>;
|
|
8915
|
+
}
|
|
8895
8916
|
declare const PROJECT_NAMES: {
|
|
8896
8917
|
readonly setup: "setup";
|
|
8897
8918
|
readonly chromium: "chromium";
|
|
@@ -8937,5 +8958,5 @@ interface Overrides {
|
|
|
8937
8958
|
* @endexample
|
|
8938
8959
|
*/
|
|
8939
8960
|
declare const definePlaywrightConfig: (overrides: Overrides) => PlaywrightTestConfig<{}, {}>;
|
|
8940
|
-
export { ACTIONS, ADMIN_PANEL_SELECTORS, API_KEYS_SELECTORS, API_ROUTES, 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, EmbedBase, FILE_FORMATS, FONT_SIZE_SELECTORS, 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_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, 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,
|
|
8961
|
+
export { ACTIONS, ADMIN_PANEL_SELECTORS, API_KEYS_SELECTORS, API_ROUTES, 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, EmbedBase, FILE_FORMATS, FONT_SIZE_SELECTORS, 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_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, 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_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 };
|
|
8941
8962
|
export type { BaseThemeStyle, BaseThemeStyleType, ColumnMenuAction, CountryProps, CustomFixture, IntroPageThemeStyle, IntroPageThemeStyleType, ProjectName, ThemeCategory, ValueOf };
|