@bigbinary/neeto-playwright-commons 6.1.5 → 7.0.0

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 CHANGED
@@ -53,15 +53,6 @@ Run linters against staged git files.
53
53
  yarn add nano-staged
54
54
  ```
55
55
 
56
- ### `dotenv-webpack`
57
-
58
- `dotenv-webpack` is a secure webpack plugin that supports [dotenv](https://www.npmjs.com/package/dotenv) and other
59
- environment variables.
60
-
61
- ```
62
- yarn add dotenv-webpack
63
- ```
64
-
65
56
  ### `dayjs`
66
57
 
67
58
  Dayjs is a JavaScript library that parses, validates, manipulates, and displays dates and times.
@@ -79,18 +70,20 @@ functions that operate on data.
79
70
  yarn add ramda
80
71
  ```
81
72
 
82
- ### `playwright-i18next-fixture`
73
+ ### `i18next`
83
74
 
84
- Use your `i18next` translations in Playwright to create multi-language selectors.
75
+ Use i18next 27.1.5 translations in Playwright to create multi-language selectors.
76
+ Import `i18nFixture`, `railsTFixture`, and `getI18nInstance` from
77
+ `@bigbinary/neeto-playwright-commons`.
85
78
 
86
79
  ```
87
- yarn add playwright-i18next-fixture
80
+ yarn add i18next@27.1.5
88
81
  ```
89
82
 
90
83
  We can install all the above peer dependencies by running a single command.
91
84
 
92
85
  ```
93
- yarn add @bigbinary/neeto-cist @faker-js/faker @playwright/test nano-staged dotenv-webpack dayjs ramda playwright-i18next-fixture
86
+ yarn add @bigbinary/neeto-cist @faker-js/faker @playwright/test nano-staged dayjs ramda i18next
94
87
  ```
95
88
 
96
89
  ## External dependencies
@@ -32,7 +32,7 @@ const commonEslintConfig = ({
32
32
  },
33
33
  globals: {
34
34
  ...globals.browser,
35
- ...globals.es2021,
35
+ ...globals.es2025,
36
36
  ...globals.node,
37
37
  },
38
38
  },
@@ -1,7 +1,15 @@
1
+ import { createRequire } from "node:module";
1
2
  import path from "path";
3
+
2
4
  import eslintConfig from "./common.js";
3
5
 
4
6
  const hostEslintConfig = ({ rules = {}, tsconfigRootDir = "", ignores }) => {
7
+ const frontendDir = path.dirname(
8
+ createRequire(path.resolve(tsconfigRootDir, "package.json")).resolve(
9
+ "@bigbinary/neeto-commons-frontend/constants"
10
+ )
11
+ );
12
+
5
13
  return eslintConfig({
6
14
  tsconfigRootDir,
7
15
  overrideRules: {
@@ -11,17 +19,13 @@ const hostEslintConfig = ({ rules = {}, tsconfigRootDir = "", ignores }) => {
11
19
  "warn",
12
20
  {
13
21
  translationsDir: path.resolve(
14
- import.meta.dirname,
15
- "../../../../../..",
22
+ tsconfigRootDir,
23
+ "..",
16
24
  "app/javascript/src/translations"
17
25
  ),
18
26
  languages: ["en"],
19
27
  nanosTranslationDir: [
20
- path.resolve(
21
- import.meta.dirname,
22
- "../../../../../..",
23
- "node_modules/@bigbinary/neeto-commons-frontend/translations"
24
- ),
28
+ path.resolve(frontendDir, "../../translations"),
25
29
  ],
26
30
  },
27
31
  ],
package/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import * as playwright_core from 'playwright-core';
2
2
  import * as _playwright_test from '@playwright/test';
3
3
  import { Page, APIRequestContext, Response, APIResponse, Locator, BrowserContext, Fixtures, PlaywrightWorkerArgs, PlaywrightWorkerOptions, PlaywrightTestArgs, PlaywrightTestOptions, Browser, FrameLocator, CDPSession, PlaywrightTestConfig, LaunchOptions } from '@playwright/test';
4
- import { TFunction } from 'i18next';
5
- import { I18nPlaywrightFixture, getI18nInstance } from 'playwright-i18next-fixture';
4
+ import { TFunction, i18n } from 'i18next';
6
5
  import { TOTP, Secret } from 'otpauth';
7
6
  import * as ts_toolbelt_out_Function_Curry_js from 'ts-toolbelt/out/Function/Curry.js';
8
7
  interface InterceptMultipleResponsesParams {
@@ -1330,6 +1329,7 @@ declare class RailsEmailUtils {
1330
1329
  }?: {
1331
1330
  receivedAfter?: Date;
1332
1331
  }) => Promise<FormattedList$1[]>;
1332
+ private waitForLatestEmail;
1333
1333
  /**
1334
1334
  *
1335
1335
  * 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.
@@ -2156,6 +2156,11 @@ declare const generateStagingData: (product?: string) => {
2156
2156
  */
2157
2157
  declare const isStagingOrganizationExpired: (subdomainName?: string) => boolean;
2158
2158
  declare const _default: _playwright_test.TestType<_playwright_test.PlaywrightTestArgs & _playwright_test.PlaywrightTestOptions & Browser, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions>;
2159
+ interface I18nPlaywrightFixture {
2160
+ i18n: i18n;
2161
+ t: TFunction;
2162
+ }
2163
+ declare const getI18nInstance: () => i18n;
2159
2164
  interface RailsTranslationsFixture {
2160
2165
  railsT: TFunction;
2161
2166
  }
@@ -3028,6 +3033,20 @@ declare const initializeTotp: ({
3028
3033
  issuer: string;
3029
3034
  secret: string | Secret;
3030
3035
  }) => TOTP;
3036
+ interface FillTotpWhenReadyOptions {
3037
+ codeInput: Locator;
3038
+ totp: TOTP;
3039
+ submitButton?: Locator;
3040
+ successLocators?: Locator[];
3041
+ hideCodeInput?: boolean;
3042
+ }
3043
+ declare const fillTotpWhenReady: ({
3044
+ codeInput,
3045
+ totp,
3046
+ submitButton,
3047
+ successLocators,
3048
+ hideCodeInput
3049
+ }: FillTotpWhenReadyOptions) => Promise<void>;
3031
3050
  type MicrosoftPageParams = {
3032
3051
  page: Page;
3033
3052
  neetoPlaywrightUtilities: CustomCommands;
@@ -8539,7 +8558,7 @@ type LocalServerProductSettings = {
8539
8558
  type LocalServerProduct = LocalServerProductSettings & {
8540
8559
  name: string;
8541
8560
  };
8542
- type LocalServerName = keyof typeof LOCAL_SERVER_PRODUCTS | (typeof CHAT_WIDGET)["name"];
8561
+ type LocalServerName = keyof typeof LOCAL_SERVER_PRODUCTS | typeof CHAT_WIDGET["name"];
8543
8562
  type LocalServerTarget = LocalServerName | LocalServerProduct;
8544
8563
  declare class LocalServer {
8545
8564
  private servers;
@@ -8736,5 +8755,5 @@ declare class InboundEmailApis {
8736
8755
  private deliverSource;
8737
8756
  private deliverViaMailgunIngress;
8738
8757
  }
8739
- export { ACME_SUBDOMAIN, ACTIONS, ADMIN_PANEL_SELECTORS, ALL_RESOURCES, ANALYTICS_RESOURCES, API_ROUTES, APP_RESOURCES, AUDIT_LOGS_SELECTORS, AuditLogsPage, BASE_URL, CALENDAR_LABELS, CERTIFICATE_LIMIT_EXCEEDED_MESSAGE, CERTIFICATE_LIMIT_EXCEEDED_REGEXP, CERTIFICATE_PROVISION_FAILED_MESSAGE, CERTIFICATE_PROVISION_FAILED_REGEXP, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, COMMUNITY_TEXTS, CREDENTIALS, CURRENT_TIME_RANGES, CUSTOM_DOMAIN_EDGE_CERTIFICATE_SUFFIX, CUSTOM_DOMAIN_SELECTORS, CUSTOM_DOMAIN_SUFFIX, ColorPickerUtils, CustomCommands, CustomDomainApi, CustomDomainPage, DATE_FORMATS, DATE_PICKER_SELECTORS, DATE_RANGES, DATE_TEXTS, DEFAULT_TIMEZONE_ID, DEFAULT_WEBHOOKS_RESPONSE_TEXT, DESCRIPTION_EDITOR_TEXTS, EDITOR_VERIFY_TEXT_COLOR, 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_CI, IS_DEV_ENV, IS_PLAYWRIGHT_RUN, IS_REVIEW_ENV, IS_STAGING_ENV, IS_WEBKIT, ImageUploader, InboundEmailApis, IntegrationBase, IpRestrictionsApi, KEYBOARD_SHORTCUTS_SELECTORS, KEYBOARD_SHORTCUT_TEST_CASES, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_DEFAULTS, LOGIN_SELECTORS, LOGIN_STRATEGIES, LOGIN_TIMEOUT, LocalServer, MAILPIT_BASE_URL, MAILPIT_DOMAIN_NAME, MICROSOFT_LOGIN_SELECTORS, MICROSOFT_LOGIN_TEXTS, MailerUtils, MailpitApi, MicrosoftPage, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_SEO_SELECTORS, NEETO_TEXT_MODIFIER_SELECTORS, NeetoEmailDeliveryApi, NeetoTowerApi, ONBOARDING_SELECTORS, ORGANIZATION_TEXTS, OTP_EMAIL_PATTERN, OTP_FETCH_TIMEOUT, OrganizationPage, PAST_TIME_RANGES, PHONE_NUMBER_FORMATS, PLURAL, PROFILE_LINKS, PROFILE_SECTION_SELECTORS, PROJECT_NAMES, PROJECT_TRANSLATIONS_PATH, REVIEW_APP_CUSTOM_DOMAIN_SUFFIX, ROUTES, RailsEmailApiClient, RailsEmailUtils, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STATUS_TEXTS, STORAGE_STATE, SecurityApi, SidebarSection, SlackApi, SlackPage, SmsApi, SmsUtils, TABLE_SELECTORS, TAB_SELECTORS, 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, TRAEFIK_NOT_FOUND_TEXT, TWILIO_SELECTORS, ThankYouApi, ThankYouPage, TwilioApi, USER_AGENTS, WebhookSiteApi, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, authenticateUser, baseURLGenerator, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, createOrganizationViaApi, createOrganizationViaRake, currencyUtils, dataQa, decodeQRCodeFromFile, definePlaywrightConfig, exampleEmail, executeWithThrottledResources, extractSubdomainFromError, failTest, filterUtils, fixedMenuSelector, generatePhoneNumber, generatePhoneNumberDetails, generateRandomBypassEmail, generateRandomFile, generateStagingData, getByDataQA, getClipboardContent, getFormattedPhoneNumber, getFullUrl, getGithubToken, getGlobalUserProps, getGlobalUserState, getImagePathAndName, getIsoCodeFromPhoneCode, getListCount, getRailsT, globalShortcuts, grantClipboardPermissions, hexToRGB, hexToRGBA, i18nFixture, imageRegex, initializeCredentials, initializeReviewAppCredentials, initializeTestData, initializeTotp, isGithubIssueOpen, isStagingOrganizationExpired, joinHyphenCase, joinString, login, loginToReviewApp, mailpitDomainName, minutesAgo, networkConditions, networkThrottlingUsingCDP, optionSelector, railsTFixture, readFileAsBrowserFile, readFileSyncIfExists, removeCredentialFile, requireEnv, reviewAppBaseURL, reviewAppOrganizationOptions, saveStorageState, serializeFileForBrowser, shouldSkipCustomDomainSetup, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, waitForReviewApp, warmup, withCookieCache, writeDataToFile };
8740
- export type { BaseThemeStyle, BaseThemeStyleType, ColumnMenuAction, CountryProps, CustomFixture, EmailDeliveryConnectParams, EmailDeliveryProvider, EmailDeliveryVerifiedEmail, EmailDeliveryVerifyEmailParams, EmailDeliveryVerifyEmailResponse, EmailMatchCriteria, InboundEmailParams, IntroPageThemeStyle, IntroPageThemeStyleType, LocalServerName, LocalServerProduct, LocalServerTarget, LoginStrategy, OAuthEmailDeliveryProvider, ProjectName, RailsTranslationsFixture, ReplyInboundEmailParams, Sms, SmsFilters, SmsProvider, SmsSearchCriteria, SmsSearchParams, ThemeCategory, TranslationsConfig, ValueOf, WaitForSmsOptions };
8758
+ export { ACME_SUBDOMAIN, ACTIONS, ADMIN_PANEL_SELECTORS, ALL_RESOURCES, ANALYTICS_RESOURCES, API_ROUTES, APP_RESOURCES, AUDIT_LOGS_SELECTORS, AuditLogsPage, BASE_URL, CALENDAR_LABELS, CERTIFICATE_LIMIT_EXCEEDED_MESSAGE, CERTIFICATE_LIMIT_EXCEEDED_REGEXP, CERTIFICATE_PROVISION_FAILED_MESSAGE, CERTIFICATE_PROVISION_FAILED_REGEXP, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, COMMUNITY_TEXTS, CREDENTIALS, CURRENT_TIME_RANGES, CUSTOM_DOMAIN_EDGE_CERTIFICATE_SUFFIX, CUSTOM_DOMAIN_SELECTORS, CUSTOM_DOMAIN_SUFFIX, ColorPickerUtils, CustomCommands, CustomDomainApi, CustomDomainPage, DATE_FORMATS, DATE_PICKER_SELECTORS, DATE_RANGES, DATE_TEXTS, DEFAULT_TIMEZONE_ID, DEFAULT_WEBHOOKS_RESPONSE_TEXT, DESCRIPTION_EDITOR_TEXTS, EDITOR_VERIFY_TEXT_COLOR, 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_CI, IS_DEV_ENV, IS_PLAYWRIGHT_RUN, IS_REVIEW_ENV, IS_STAGING_ENV, IS_WEBKIT, ImageUploader, InboundEmailApis, IntegrationBase, IpRestrictionsApi, KEYBOARD_SHORTCUTS_SELECTORS, KEYBOARD_SHORTCUT_TEST_CASES, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_DEFAULTS, LOGIN_SELECTORS, LOGIN_STRATEGIES, LOGIN_TIMEOUT, LocalServer, MAILPIT_BASE_URL, MAILPIT_DOMAIN_NAME, MICROSOFT_LOGIN_SELECTORS, MICROSOFT_LOGIN_TEXTS, MailerUtils, MailpitApi, MicrosoftPage, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_SEO_SELECTORS, NEETO_TEXT_MODIFIER_SELECTORS, NeetoEmailDeliveryApi, NeetoTowerApi, ONBOARDING_SELECTORS, ORGANIZATION_TEXTS, OTP_EMAIL_PATTERN, OTP_FETCH_TIMEOUT, OrganizationPage, PAST_TIME_RANGES, PHONE_NUMBER_FORMATS, PLURAL, PROFILE_LINKS, PROFILE_SECTION_SELECTORS, PROJECT_NAMES, PROJECT_TRANSLATIONS_PATH, REVIEW_APP_CUSTOM_DOMAIN_SUFFIX, ROUTES, RailsEmailApiClient, RailsEmailUtils, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STATUS_TEXTS, STORAGE_STATE, SecurityApi, SidebarSection, SlackApi, SlackPage, SmsApi, SmsUtils, TABLE_SELECTORS, TAB_SELECTORS, 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, TRAEFIK_NOT_FOUND_TEXT, TWILIO_SELECTORS, ThankYouApi, ThankYouPage, TwilioApi, USER_AGENTS, WebhookSiteApi, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, authenticateUser, baseURLGenerator, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, createOrganizationViaApi, createOrganizationViaRake, currencyUtils, dataQa, decodeQRCodeFromFile, definePlaywrightConfig, exampleEmail, executeWithThrottledResources, extractSubdomainFromError, failTest, fillTotpWhenReady, filterUtils, fixedMenuSelector, generatePhoneNumber, generatePhoneNumberDetails, generateRandomBypassEmail, generateRandomFile, generateStagingData, getByDataQA, getClipboardContent, getFormattedPhoneNumber, getFullUrl, getGithubToken, getGlobalUserProps, getGlobalUserState, getI18nInstance, getImagePathAndName, getIsoCodeFromPhoneCode, getListCount, getRailsT, globalShortcuts, grantClipboardPermissions, hexToRGB, hexToRGBA, i18nFixture, imageRegex, initializeCredentials, initializeReviewAppCredentials, initializeTestData, initializeTotp, isGithubIssueOpen, isStagingOrganizationExpired, joinHyphenCase, joinString, login, loginToReviewApp, mailpitDomainName, minutesAgo, networkConditions, networkThrottlingUsingCDP, optionSelector, railsTFixture, readFileAsBrowserFile, readFileSyncIfExists, removeCredentialFile, requireEnv, reviewAppBaseURL, reviewAppOrganizationOptions, saveStorageState, serializeFileForBrowser, shouldSkipCustomDomainSetup, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, _default as stealthTest, tableUtils, toCamelCase, updateCredentials, waitForReviewApp, warmup, withCookieCache, writeDataToFile };
8759
+ export type { BaseThemeStyle, BaseThemeStyleType, ColumnMenuAction, CountryProps, CustomFixture, EmailDeliveryConnectParams, EmailDeliveryProvider, EmailDeliveryVerifiedEmail, EmailDeliveryVerifyEmailParams, EmailDeliveryVerifyEmailResponse, EmailMatchCriteria, I18nPlaywrightFixture, InboundEmailParams, IntroPageThemeStyle, IntroPageThemeStyleType, LocalServerName, LocalServerProduct, LocalServerTarget, LoginStrategy, OAuthEmailDeliveryProvider, ProjectName, RailsTranslationsFixture, ReplyInboundEmailParams, Sms, SmsFilters, SmsProvider, SmsSearchCriteria, SmsSearchParams, ThemeCategory, TranslationsConfig, ValueOf, WaitForSmsOptions };