@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.d.ts CHANGED
@@ -1285,7 +1285,8 @@ declare class RailsEmailUtils {
1285
1285
  */
1286
1286
  getEmailAttachment: (attachmentName: string, messageSearchCriteria?: MessageSearchCriteria$1, {
1287
1287
  receivedAfter,
1288
- expectedEmailCount
1288
+ expectedEmailCount,
1289
+ timeout
1289
1290
  }?: Partial<FindMessageFilterOptions$1> | undefined, shouldThrowErrorOnTimeout?: boolean) => Promise<AttachmentDetails$1 | undefined>;
1290
1291
  }
1291
1292
  interface FastmailHeaders {
@@ -5754,7 +5755,7 @@ declare const COMMUNITY_TEXTS: {
5754
5755
  joinNow: string;
5755
5756
  };
5756
5757
  declare const STATUS_TEXTS: {
5757
- application: (appName: NeetoProducts) => string;
5758
+ appName: (appName: NeetoProducts) => string;
5758
5759
  };
5759
5760
  /**
5760
5761
  *
package/index.js CHANGED
@@ -112,7 +112,7 @@ const NEETO_ROUTES = {
112
112
  imageUploader: "/neeto_image_uploader_engine",
113
113
  };
114
114
  const PROFILE_LINKS = {
115
- neetoStatus: "https://neetostatus.com/",
115
+ neetoStatus: "https://www.neetostatus.com/",
116
116
  neetoCommunity: "https://www.launchpass.com/neetohq",
117
117
  };
118
118
 
@@ -57490,7 +57490,7 @@ class RailsEmailUtils {
57490
57490
  .map(email => this.convertRailsEmailToFormattedList(email))
57491
57491
  .filter((email) => email !== null);
57492
57492
  };
57493
- this.findMessage = async (messageSearchCriteria = {}, { timeout = 2 * 60 * 1000, receivedAfter = new Date(new Date().valueOf() - 60 * 60 * 1000), expectedEmailCount = 1, } = {}, shouldThrowErrorOnTimeout = true) => {
57493
+ this.findMessage = async (messageSearchCriteria = {}, { timeout = 10000, receivedAfter = new Date(new Date().valueOf() - 60 * 60 * 1000), expectedEmailCount = 1, } = {}, shouldThrowErrorOnTimeout = true) => {
57494
57494
  const email = (await this.neetoPlaywrightUtilities.executeRecursively({
57495
57495
  callback: async () => {
57496
57496
  const railsEmail = await this.railsEmailRakeClient.getLatestEmail({
@@ -57511,14 +57511,14 @@ class RailsEmailUtils {
57511
57511
  timeout,
57512
57512
  }));
57513
57513
  if (!email) {
57514
- if (shouldThrowErrorOnTimeout) {
57514
+ if (shouldThrowErrorOnTimeout && expectedEmailCount > 0) {
57515
57515
  throw new Error("Timed out waiting for matching message");
57516
57516
  }
57517
57517
  return {};
57518
57518
  }
57519
57519
  return email;
57520
57520
  };
57521
- this.findOtpFromEmail = async ({ email, subjectSubstring = OTP_EMAIL_PATTERN, timeout = 2 * 60 * 1000, receivedAfter = new Date(), expectedEmailCount = 1, }) => {
57521
+ this.findOtpFromEmail = async ({ email, subjectSubstring = OTP_EMAIL_PATTERN, timeout = 10000, receivedAfter = new Date(), expectedEmailCount = 1, }) => {
57522
57522
  const otp = await this.neetoPlaywrightUtilities.executeRecursively({
57523
57523
  callback: async () => {
57524
57524
  var _a, _b;
@@ -57546,7 +57546,7 @@ class RailsEmailUtils {
57546
57546
  });
57547
57547
  return otp || undefined;
57548
57548
  };
57549
- this.getEmailAttachment = async (attachmentName, messageSearchCriteria = {}, { receivedAfter = new Date(new Date().valueOf() - 60 * 60 * 1000), expectedEmailCount = 1, } = {}, shouldThrowErrorOnTimeout = true) => {
57549
+ this.getEmailAttachment = async (attachmentName, messageSearchCriteria = {}, { receivedAfter = new Date(new Date().valueOf() - 60 * 60 * 1000), expectedEmailCount = 1, timeout = 10000, } = {}, shouldThrowErrorOnTimeout = true) => {
57550
57550
  const attachmentDetails = (await this.neetoPlaywrightUtilities.executeRecursively({
57551
57551
  callback: async () => {
57552
57552
  var _a;
@@ -57573,7 +57573,7 @@ class RailsEmailUtils {
57573
57573
  });
57574
57574
  return emails.length >= expectedEmailCount;
57575
57575
  },
57576
- timeout: 2 * 60 * 1000,
57576
+ timeout,
57577
57577
  }));
57578
57578
  if (!attachmentDetails) {
57579
57579
  if (shouldThrowErrorOnTimeout) {
@@ -57692,7 +57692,7 @@ class MailerUtils {
57692
57692
  };
57693
57693
  this.findMessage = async (messageSearchCriteria = {}, { timeout = 10000, receivedAfter = dateTimeOneHourAgo(), expectedEmailCount = 1, } = {}, shouldThrowErrorOnTimeout = true) => {
57694
57694
  if (IS_DEV_ENV) {
57695
- return this.railsEmailUtils.findMessage(messageSearchCriteria, { receivedAfter, timeout, expectedEmailCount }, shouldThrowErrorOnTimeout);
57695
+ return this.railsEmailUtils.findMessage(messageSearchCriteria, { receivedAfter, expectedEmailCount, timeout: timeout / 3 }, shouldThrowErrorOnTimeout);
57696
57696
  }
57697
57697
  const ids = await this.getEmailIds(messageSearchCriteria, { expectedEmailCount, receivedAfter, timeout }, shouldThrowErrorOnTimeout);
57698
57698
  const emails = await this.getEmails(ids);
@@ -57704,9 +57704,9 @@ class MailerUtils {
57704
57704
  return this.railsEmailUtils.findOtpFromEmail({
57705
57705
  email,
57706
57706
  subjectSubstring,
57707
- timeout,
57708
57707
  receivedAfter,
57709
57708
  expectedEmailCount,
57709
+ timeout: timeout / 3,
57710
57710
  });
57711
57711
  }
57712
57712
  if (!this.accountId) {
@@ -57718,7 +57718,7 @@ class MailerUtils {
57718
57718
  this.generateRandomEmail = () => faker.internet.email({ provider: process.env.FASTMAIL_DOMAIN_NAME });
57719
57719
  this.getEmailAttachment = async (attachmentName, messageSearchCriteria = {}, { timeout = 10000, receivedAfter = dateTimeOneHourAgo(), expectedEmailCount = 1, } = {}, shouldThrowErrorOnTimeout = true) => {
57720
57720
  if (IS_DEV_ENV) {
57721
- return this.railsEmailUtils.getEmailAttachment(attachmentName, messageSearchCriteria, { receivedAfter, expectedEmailCount }, shouldThrowErrorOnTimeout);
57721
+ return this.railsEmailUtils.getEmailAttachment(attachmentName, messageSearchCriteria, { receivedAfter, expectedEmailCount, timeout: timeout / 3 }, shouldThrowErrorOnTimeout);
57722
57722
  }
57723
57723
  const { blobId, attachments: attachmentNameAndTypes } = await this.findMessage(messageSearchCriteria, { expectedEmailCount, receivedAfter, timeout }, shouldThrowErrorOnTimeout);
57724
57724
  const attachment = attachmentNameAndTypes.find(attachment => attachment.name.includes(attachmentName));
@@ -114278,7 +114278,7 @@ const GOOGLE_LOGIN_TEXTS = {
114278
114278
  const ENGAGE_TEXTS = { subscribe: "Subscribe" };
114279
114279
  const COMMUNITY_TEXTS = { joinNow: "Join Now" };
114280
114280
  const STATUS_TEXTS = {
114281
- application: (appName) => `Neeto${appName} Application`,
114281
+ appName: (appName) => `Neeto${appName}`,
114282
114282
  };
114283
114283
  const COMMON_TEXTS = {
114284
114284
  skipCleanup: "@SKIP_CLEANUP",
@@ -114671,9 +114671,7 @@ class HelpAndProfilePage {
114671
114671
  await statusPage.waitForLoadState();
114672
114672
  await Promise.all([
114673
114673
  expect(statusPage).toHaveURL(PROFILE_LINKS.neetoStatus),
114674
- expect(statusPage.getByText(STATUS_TEXTS.application(appName), {
114675
- exact: true,
114676
- })).toBeVisible(),
114674
+ expect(statusPage.getByRole("link", { name: STATUS_TEXTS.appName(appName) })).toBeVisible(),
114677
114675
  ]);
114678
114676
  });
114679
114677
  };
@@ -114707,7 +114705,7 @@ class HelpAndProfilePage {
114707
114705
  return;
114708
114706
  const actionName = plan === "Free" ? "Upgrade" : "Downgrade";
114709
114707
  const productRow = this.page.getByRole("row", {
114710
- name: `Neeto${product}`,
114708
+ name: STATUS_TEXTS.appName(product),
114711
114709
  });
114712
114710
  await Promise.all([
114713
114711
  expect(productRow.getByRole("cell", { name: plan })).toBeVisible(),