@bigbinary/neeto-playwright-commons 1.26.24 → 1.26.25

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
@@ -133,7 +133,7 @@ const NEETO_ROUTES = {
133
133
  imageUploader: "/neeto_image_uploader_engine",
134
134
  };
135
135
  const PROFILE_LINKS = {
136
- neetoStatus: "https://neetostatus.com/",
136
+ neetoStatus: "https://www.neetostatus.com/",
137
137
  neetoCommunity: "https://www.launchpass.com/neetohq",
138
138
  };
139
139
 
@@ -57511,7 +57511,7 @@ class RailsEmailUtils {
57511
57511
  .map(email => this.convertRailsEmailToFormattedList(email))
57512
57512
  .filter((email) => email !== null);
57513
57513
  };
57514
- this.findMessage = async (messageSearchCriteria = {}, { timeout = 2 * 60 * 1000, receivedAfter = new Date(new Date().valueOf() - 60 * 60 * 1000), expectedEmailCount = 1, } = {}, shouldThrowErrorOnTimeout = true) => {
57514
+ this.findMessage = async (messageSearchCriteria = {}, { timeout = 10000, receivedAfter = new Date(new Date().valueOf() - 60 * 60 * 1000), expectedEmailCount = 1, } = {}, shouldThrowErrorOnTimeout = true) => {
57515
57515
  const email = (await this.neetoPlaywrightUtilities.executeRecursively({
57516
57516
  callback: async () => {
57517
57517
  const railsEmail = await this.railsEmailRakeClient.getLatestEmail({
@@ -57532,14 +57532,14 @@ class RailsEmailUtils {
57532
57532
  timeout,
57533
57533
  }));
57534
57534
  if (!email) {
57535
- if (shouldThrowErrorOnTimeout) {
57535
+ if (shouldThrowErrorOnTimeout && expectedEmailCount > 0) {
57536
57536
  throw new Error("Timed out waiting for matching message");
57537
57537
  }
57538
57538
  return {};
57539
57539
  }
57540
57540
  return email;
57541
57541
  };
57542
- this.findOtpFromEmail = async ({ email, subjectSubstring = OTP_EMAIL_PATTERN, timeout = 2 * 60 * 1000, receivedAfter = new Date(), expectedEmailCount = 1, }) => {
57542
+ this.findOtpFromEmail = async ({ email, subjectSubstring = OTP_EMAIL_PATTERN, timeout = 10000, receivedAfter = new Date(), expectedEmailCount = 1, }) => {
57543
57543
  const otp = await this.neetoPlaywrightUtilities.executeRecursively({
57544
57544
  callback: async () => {
57545
57545
  var _a, _b;
@@ -57567,7 +57567,7 @@ class RailsEmailUtils {
57567
57567
  });
57568
57568
  return otp || undefined;
57569
57569
  };
57570
- this.getEmailAttachment = async (attachmentName, messageSearchCriteria = {}, { receivedAfter = new Date(new Date().valueOf() - 60 * 60 * 1000), expectedEmailCount = 1, } = {}, shouldThrowErrorOnTimeout = true) => {
57570
+ this.getEmailAttachment = async (attachmentName, messageSearchCriteria = {}, { receivedAfter = new Date(new Date().valueOf() - 60 * 60 * 1000), expectedEmailCount = 1, timeout = 10000, } = {}, shouldThrowErrorOnTimeout = true) => {
57571
57571
  const attachmentDetails = (await this.neetoPlaywrightUtilities.executeRecursively({
57572
57572
  callback: async () => {
57573
57573
  var _a;
@@ -57594,7 +57594,7 @@ class RailsEmailUtils {
57594
57594
  });
57595
57595
  return emails.length >= expectedEmailCount;
57596
57596
  },
57597
- timeout: 2 * 60 * 1000,
57597
+ timeout,
57598
57598
  }));
57599
57599
  if (!attachmentDetails) {
57600
57600
  if (shouldThrowErrorOnTimeout) {
@@ -57713,7 +57713,7 @@ class MailerUtils {
57713
57713
  };
57714
57714
  this.findMessage = async (messageSearchCriteria = {}, { timeout = 10000, receivedAfter = dateTimeOneHourAgo(), expectedEmailCount = 1, } = {}, shouldThrowErrorOnTimeout = true) => {
57715
57715
  if (IS_DEV_ENV) {
57716
- return this.railsEmailUtils.findMessage(messageSearchCriteria, { receivedAfter, timeout, expectedEmailCount }, shouldThrowErrorOnTimeout);
57716
+ return this.railsEmailUtils.findMessage(messageSearchCriteria, { receivedAfter, expectedEmailCount, timeout: timeout / 3 }, shouldThrowErrorOnTimeout);
57717
57717
  }
57718
57718
  const ids = await this.getEmailIds(messageSearchCriteria, { expectedEmailCount, receivedAfter, timeout }, shouldThrowErrorOnTimeout);
57719
57719
  const emails = await this.getEmails(ids);
@@ -57725,9 +57725,9 @@ class MailerUtils {
57725
57725
  return this.railsEmailUtils.findOtpFromEmail({
57726
57726
  email,
57727
57727
  subjectSubstring,
57728
- timeout,
57729
57728
  receivedAfter,
57730
57729
  expectedEmailCount,
57730
+ timeout: timeout / 3,
57731
57731
  });
57732
57732
  }
57733
57733
  if (!this.accountId) {
@@ -57739,7 +57739,7 @@ class MailerUtils {
57739
57739
  this.generateRandomEmail = () => faker.faker.internet.email({ provider: process.env.FASTMAIL_DOMAIN_NAME });
57740
57740
  this.getEmailAttachment = async (attachmentName, messageSearchCriteria = {}, { timeout = 10000, receivedAfter = dateTimeOneHourAgo(), expectedEmailCount = 1, } = {}, shouldThrowErrorOnTimeout = true) => {
57741
57741
  if (IS_DEV_ENV) {
57742
- return this.railsEmailUtils.getEmailAttachment(attachmentName, messageSearchCriteria, { receivedAfter, expectedEmailCount }, shouldThrowErrorOnTimeout);
57742
+ return this.railsEmailUtils.getEmailAttachment(attachmentName, messageSearchCriteria, { receivedAfter, expectedEmailCount, timeout: timeout / 3 }, shouldThrowErrorOnTimeout);
57743
57743
  }
57744
57744
  const { blobId, attachments: attachmentNameAndTypes } = await this.findMessage(messageSearchCriteria, { expectedEmailCount, receivedAfter, timeout }, shouldThrowErrorOnTimeout);
57745
57745
  const attachment = attachmentNameAndTypes.find(attachment => attachment.name.includes(attachmentName));
@@ -114299,7 +114299,7 @@ const GOOGLE_LOGIN_TEXTS = {
114299
114299
  const ENGAGE_TEXTS = { subscribe: "Subscribe" };
114300
114300
  const COMMUNITY_TEXTS = { joinNow: "Join Now" };
114301
114301
  const STATUS_TEXTS = {
114302
- application: (appName) => `Neeto${appName} Application`,
114302
+ appName: (appName) => `Neeto${appName}`,
114303
114303
  };
114304
114304
  const COMMON_TEXTS = {
114305
114305
  skipCleanup: "@SKIP_CLEANUP",
@@ -114692,9 +114692,7 @@ class HelpAndProfilePage {
114692
114692
  await statusPage.waitForLoadState();
114693
114693
  await Promise.all([
114694
114694
  test.expect(statusPage).toHaveURL(PROFILE_LINKS.neetoStatus),
114695
- test.expect(statusPage.getByText(STATUS_TEXTS.application(appName), {
114696
- exact: true,
114697
- })).toBeVisible(),
114695
+ test.expect(statusPage.getByRole("link", { name: STATUS_TEXTS.appName(appName) })).toBeVisible(),
114698
114696
  ]);
114699
114697
  });
114700
114698
  };
@@ -114728,7 +114726,7 @@ class HelpAndProfilePage {
114728
114726
  return;
114729
114727
  const actionName = plan === "Free" ? "Upgrade" : "Downgrade";
114730
114728
  const productRow = this.page.getByRole("row", {
114731
- name: `Neeto${product}`,
114729
+ name: STATUS_TEXTS.appName(product),
114732
114730
  });
114733
114731
  await Promise.all([
114734
114732
  test.expect(productRow.getByRole("cell", { name: plan })).toBeVisible(),