@bigbinary/neeto-playwright-commons 1.8.4 → 1.8.6

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
@@ -322,7 +322,8 @@ const commands = {
322
322
  };
323
323
 
324
324
  const generateStagingData = (product = "invoice") => {
325
- const timestamp = dayjs__default["default"]().format("YYYYMMDDHH");
325
+ var _a;
326
+ const timestamp = `${dayjs__default["default"]().format("YYYYMMDDHH")}${(_a = process.env.JOB_COMPLETION_INDEX) !== null && _a !== void 0 ? _a : ""}`;
326
327
  const firstName = "André";
327
328
  const lastName = "O'Reilly";
328
329
  const otpBypassKey = process.env.OTP_BYPASS_KEY;
@@ -7702,7 +7703,11 @@ class OrganizationPage {
7702
7703
  await this.page
7703
7704
  .getByTestId(SIGNUP_SELECTORS.organizationNameTextField)
7704
7705
  .fill(businessName);
7705
- const fetchSubdomainAvailability = this.page.waitForResponse(response => response.url().includes(ROUTES.subdomainAvailability));
7706
+ const fetchSubdomainAvailability = this.neetoPlaywrightUtilities.interceptMultipleResponses({
7707
+ responseUrl: ROUTES.subdomainAvailability,
7708
+ timeout: 60 * 1000,
7709
+ baseUrl: NEETO_AUTH_BASE_URL(),
7710
+ });
7706
7711
  await this.page
7707
7712
  .getByTestId(SIGNUP_SELECTORS.subdomainNameTextField)
7708
7713
  .fill(subdomainName);
@@ -7712,13 +7717,15 @@ class OrganizationPage {
7712
7717
  if (subdomainErrorCount !== 0) {
7713
7718
  await this.updateSubdomainIfExists(appNameInLowerCase);
7714
7719
  }
7720
+ const fetchProfile = this.neetoPlaywrightUtilities.interceptMultipleResponses({
7721
+ times: 2,
7722
+ timeout: 60 * 1000,
7723
+ baseUrl: NEETO_AUTH_BASE_URL(),
7724
+ });
7715
7725
  await this.page
7716
7726
  .getByTestId(SIGNUP_SELECTORS.organizationSubmitButton)
7717
7727
  .click();
7718
- await Promise.all([
7719
- this.page.waitForResponse(response => response.url().includes(ROUTES.signup)),
7720
- this.page.waitForResponse(response => response.url().includes(ROUTES.countries)),
7721
- ]);
7728
+ await fetchProfile;
7722
7729
  await this.page.waitForURL(`**${ROUTES.profile}`, { timeout: 60 * 1000 });
7723
7730
  await this.page
7724
7731
  .getByTestId(SIGNUP_SELECTORS.firstNameTextField)
@@ -7769,10 +7776,15 @@ class OrganizationPage {
7769
7776
  if (subdomainErrorCount !== 0) {
7770
7777
  const subdomainErrorText = await subdomainError.innerText();
7771
7778
  const newOrganizationName = extractSubdomainFromError(subdomainErrorText);
7779
+ const subdomainAvailability = this.neetoPlaywrightUtilities.interceptMultipleResponses({
7780
+ responseUrl: ROUTES.subdomainAvailability,
7781
+ timeout: 60 * 1000,
7782
+ baseUrl: NEETO_AUTH_BASE_URL(),
7783
+ });
7772
7784
  await this.page
7773
7785
  .getByTestId(SIGNUP_SELECTORS.subdomainNameTextField)
7774
7786
  .fill(newOrganizationName);
7775
- await this.page.waitForResponse(response => response.url().includes(ROUTES.subdomainAvailability));
7787
+ await subdomainAvailability;
7776
7788
  subdomainErrorCount = await subdomainError.count();
7777
7789
  if (subdomainErrorCount === 0) {
7778
7790
  updateCredentials({