@bigbinary/neeto-playwright-commons 3.0.3 → 3.0.4

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 CHANGED
@@ -145,6 +145,99 @@ const HELP_CENTER_ROUTES = {
145
145
  kbDocs: (product) => `https://help.neeto${product.toLowerCase()}.com/`,
146
146
  changelog: (product) => `https://neeto${product.toLowerCase()}help.neetoengage.net/changelogs`,
147
147
  };
148
+ const ANALYTICS_RESOURCES = [
149
+ "**/analytics/**",
150
+ "**/mixpanel/**",
151
+ "**/static.cloudflareinsights.com/**",
152
+ ];
153
+ const FONTS_RESOURCES = [
154
+ "**/fonts.googleapis.com/**",
155
+ "**/fonts.gstatic.com/**",
156
+ "**/api.fontshare.com/**",
157
+ ];
158
+ const THIRD_PARTY_RESOURCES = [
159
+ ...ANALYTICS_RESOURCES,
160
+ // Advertising networks
161
+ "**amazon-adsystem.com/**",
162
+ "**paa-reporting-advertising.amazon/**",
163
+ "**adsrvr.org/**",
164
+ "**adnxs.com/**",
165
+ "**doubleclick.net/**",
166
+ "**googlesyndication.com/**",
167
+ "**googletagmanager.com/**",
168
+ "**bat.bing.com/**",
169
+ "**connect.facebook.net/**",
170
+ "**facebook.com/**",
171
+ "**ads.linkedin.com/**",
172
+ "**snap.licdn.com/**",
173
+ "**linkedin.com/**",
174
+ "**analytics.tiktok.com/**",
175
+ "**tiktokw.us/**",
176
+ "**alb.reddit.com/**",
177
+ "**redditstatic.com/**",
178
+ "**pixel-config.reddit.com/**",
179
+ "**bidswitch.net/**",
180
+ "**casalemedia.com/**",
181
+ "**pubmatic.com/**",
182
+ "**rubiconproject.com/**",
183
+ "**podscribe.com/**",
184
+ "**trkn.us/**",
185
+ "**usbrowserspeed.com/**",
186
+ // Analytics & tracking
187
+ "**amplitude.com/**",
188
+ "**segment.com/**",
189
+ "**clearbitjs.com/**",
190
+ "**clearbitscripts.com/**",
191
+ "**clearbit.com/**",
192
+ "**builder.io/**",
193
+ "**influ2.com/**",
194
+ "**axiom-vitals.com/**",
195
+ "**qualtrics.com/**",
196
+ // HubSpot
197
+ "**hubspot.com/**",
198
+ "**hs-scripts.com/**",
199
+ "**hs-analytics.net/**",
200
+ "**hsadspixel.net/**",
201
+ "**hs-banner.com/**",
202
+ "**hsforms.com/**",
203
+ "**hubapi.com/**",
204
+ // Monitoring & error tracking
205
+ "**sentry.io/**",
206
+ "**bugsnag.com/**",
207
+ "**datadoghq.com/**",
208
+ "**datadoghq-browser-agent.com/**",
209
+ "**fullstory.com/**",
210
+ // Chat & support widgets
211
+ "**intercom.io/**",
212
+ "**intercomcdn.com/**",
213
+ "**ada.support/**",
214
+ // Product research & feature flags
215
+ "**sprig.com/**",
216
+ "**split.io/**",
217
+ // Cookie consent
218
+ "**cookielaw.org/**",
219
+ "**onetrust.com/**",
220
+ // Zapier layout & marketing (non-functional)
221
+ "**cdn.zapier.com/**",
222
+ "**design-system-bff.zapier.com/**",
223
+ // Realtime messaging
224
+ "**ably.net/**",
225
+ // Microsoft telemetry
226
+ "**browser.events.data.microsoft.com/**",
227
+ ];
228
+ const APP_RESOURCES = [
229
+ ...ANALYTICS_RESOURCES,
230
+ ...FONTS_RESOURCES,
231
+ "**/neeto-widget**",
232
+ "**/neeto-engage-widget**",
233
+ "**.neetoreplay.net",
234
+ "**neeto-replay**.amazonaws.com/**",
235
+ "**/cdn-cgi/rum?",
236
+ "**.neetochat.net/**",
237
+ "**.neetoengage.net/**",
238
+ "**/sticky_ribbons",
239
+ "**/neeto_widget_tokens",
240
+ ];
148
241
 
149
242
  class ApiKeysApi {
150
243
  neetoPlaywrightUtilities;
@@ -5943,6 +6036,18 @@ class CustomCommands {
5943
6036
  .getAttribute("content");
5944
6037
  return this.csrfToken;
5945
6038
  };
6039
+ blockExternalResources = (page = this.page) => Promise.all(THIRD_PARTY_RESOURCES.map(pattern => page.context().route(pattern, route => route.abort())));
6040
+ blockInternalResources = (page = this.page) => Promise.all(APP_RESOURCES.map(pattern => page.context().route(pattern, route => route.abort())));
6041
+ blockNonEssentialResourceTypes = (page = this.page) => page
6042
+ .context()
6043
+ .route("**/*", route => ["image", "stylesheet", "font", "media"].includes(route.request().resourceType())
6044
+ ? route.abort()
6045
+ : route.continue());
6046
+ blockAllResources = (page = this.page) => Promise.all([
6047
+ this.blockExternalResources(page),
6048
+ this.blockInternalResources(page),
6049
+ this.blockNonEssentialResourceTypes(page),
6050
+ ]);
5946
6051
  waitForFloatingMenu = () => test.expect(this.page.getByTestId(COMMON_SELECTORS.floatingActionMenuButton)).toBeVisible({ timeout: 25_000 });
5947
6052
  interceptMultipleResponses = ({ responseUrl = "", responseStatus = 200, times = 1, baseUrl, customPageContext = this.page, timeout = 35_000, } = {}) => Promise.all([...new Array(times)].map(() => customPageContext.waitForResponse((response) => {
5948
6053
  if (response.request().resourceType() === "xhr" &&
@@ -8726,6 +8831,7 @@ class OrganizationPage {
8726
8831
  await fillCredentialsAndSubmit({ page: this.page, email });
8727
8832
  return;
8728
8833
  }
8834
+ await this.neetoPlaywrightUtilities.blockInternalResources();
8729
8835
  await this.fillEmailAndSubmit(email, loginTimeout);
8730
8836
  await this.fillOTP();
8731
8837
  await this.dismissAuthenticatorSetupPromptIfPresent();
@@ -8791,6 +8897,7 @@ class OrganizationPage {
8791
8897
  }
8792
8898
  else {
8793
8899
  let otp = "123456";
8900
+ await this.neetoPlaywrightUtilities.blockInternalResources();
8794
8901
  await this.page.goto(`${ROUTES.neetoAuthSignup}?redirect_uri=${credentials.domain}`, { timeout: 20_000 });
8795
8902
  await this.submitEmail(credentials.email);
8796
8903
  if (fetchOtpFromEmail !== undefined) {
@@ -126073,8 +126180,10 @@ const definePlaywrightConfig = (overrides) => {
126073
126180
 
126074
126181
  exports.ACTIONS = ACTIONS;
126075
126182
  exports.ADMIN_PANEL_SELECTORS = ADMIN_PANEL_SELECTORS;
126183
+ exports.ANALYTICS_RESOURCES = ANALYTICS_RESOURCES;
126076
126184
  exports.API_KEYS_SELECTORS = API_KEYS_SELECTORS;
126077
126185
  exports.API_ROUTES = API_ROUTES;
126186
+ exports.APP_RESOURCES = APP_RESOURCES;
126078
126187
  exports.AUDIT_LOGS_SELECTORS = AUDIT_LOGS_SELECTORS;
126079
126188
  exports.ApiKeysApi = ApiKeysApi;
126080
126189
  exports.ApiKeysPage = ApiKeysPage;
@@ -126115,6 +126224,7 @@ exports.EditorPage = EditorPage;
126115
126224
  exports.EmailDeliveryUtils = EmailDeliveryUtils;
126116
126225
  exports.EmbedBase = EmbedBase;
126117
126226
  exports.FILE_FORMATS = FILE_FORMATS;
126227
+ exports.FONTS_RESOURCES = FONTS_RESOURCES;
126118
126228
  exports.FONT_SIZE_SELECTORS = FONT_SIZE_SELECTORS;
126119
126229
  exports.FROM_EMAIL_ENV_KEYS = FROM_EMAIL_ENV_KEYS;
126120
126230
  exports.GLOBAL_TRANSLATIONS_PATTERN = GLOBAL_TRANSLATIONS_PATTERN;
@@ -126201,6 +126311,7 @@ exports.TEXT_MODIFIER_TAGS = TEXT_MODIFIER_TAGS;
126201
126311
  exports.THANK_YOU_SELECTORS = THANK_YOU_SELECTORS;
126202
126312
  exports.THEMES_SELECTORS = THEMES_SELECTORS;
126203
126313
  exports.THEMES_TEXTS = THEMES_TEXTS;
126314
+ exports.THIRD_PARTY_RESOURCES = THIRD_PARTY_RESOURCES;
126204
126315
  exports.THIRD_PARTY_ROUTES = THIRD_PARTY_ROUTES;
126205
126316
  exports.TIME_RANGES = TIME_RANGES;
126206
126317
  exports.TOASTR_MESSAGES = TOASTR_MESSAGES;