@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.js CHANGED
@@ -287,7 +287,8 @@ const commands = {
287
287
  };
288
288
 
289
289
  const generateStagingData = (product = "invoice") => {
290
- const timestamp = dayjs().format("YYYYMMDDHH");
290
+ var _a;
291
+ const timestamp = `${dayjs().format("YYYYMMDDHH")}${(_a = process.env.JOB_COMPLETION_INDEX) !== null && _a !== void 0 ? _a : ""}`;
291
292
  const firstName = "André";
292
293
  const lastName = "O'Reilly";
293
294
  const otpBypassKey = process.env.OTP_BYPASS_KEY;
@@ -7667,7 +7668,11 @@ class OrganizationPage {
7667
7668
  await this.page
7668
7669
  .getByTestId(SIGNUP_SELECTORS.organizationNameTextField)
7669
7670
  .fill(businessName);
7670
- const fetchSubdomainAvailability = this.page.waitForResponse(response => response.url().includes(ROUTES.subdomainAvailability));
7671
+ const fetchSubdomainAvailability = this.neetoPlaywrightUtilities.interceptMultipleResponses({
7672
+ responseUrl: ROUTES.subdomainAvailability,
7673
+ timeout: 60 * 1000,
7674
+ baseUrl: NEETO_AUTH_BASE_URL(),
7675
+ });
7671
7676
  await this.page
7672
7677
  .getByTestId(SIGNUP_SELECTORS.subdomainNameTextField)
7673
7678
  .fill(subdomainName);
@@ -7677,13 +7682,15 @@ class OrganizationPage {
7677
7682
  if (subdomainErrorCount !== 0) {
7678
7683
  await this.updateSubdomainIfExists(appNameInLowerCase);
7679
7684
  }
7685
+ const fetchProfile = this.neetoPlaywrightUtilities.interceptMultipleResponses({
7686
+ times: 2,
7687
+ timeout: 60 * 1000,
7688
+ baseUrl: NEETO_AUTH_BASE_URL(),
7689
+ });
7680
7690
  await this.page
7681
7691
  .getByTestId(SIGNUP_SELECTORS.organizationSubmitButton)
7682
7692
  .click();
7683
- await Promise.all([
7684
- this.page.waitForResponse(response => response.url().includes(ROUTES.signup)),
7685
- this.page.waitForResponse(response => response.url().includes(ROUTES.countries)),
7686
- ]);
7693
+ await fetchProfile;
7687
7694
  await this.page.waitForURL(`**${ROUTES.profile}`, { timeout: 60 * 1000 });
7688
7695
  await this.page
7689
7696
  .getByTestId(SIGNUP_SELECTORS.firstNameTextField)
@@ -7734,10 +7741,15 @@ class OrganizationPage {
7734
7741
  if (subdomainErrorCount !== 0) {
7735
7742
  const subdomainErrorText = await subdomainError.innerText();
7736
7743
  const newOrganizationName = extractSubdomainFromError(subdomainErrorText);
7744
+ const subdomainAvailability = this.neetoPlaywrightUtilities.interceptMultipleResponses({
7745
+ responseUrl: ROUTES.subdomainAvailability,
7746
+ timeout: 60 * 1000,
7747
+ baseUrl: NEETO_AUTH_BASE_URL(),
7748
+ });
7737
7749
  await this.page
7738
7750
  .getByTestId(SIGNUP_SELECTORS.subdomainNameTextField)
7739
7751
  .fill(newOrganizationName);
7740
- await this.page.waitForResponse(response => response.url().includes(ROUTES.subdomainAvailability));
7752
+ await subdomainAvailability;
7741
7753
  subdomainErrorCount = await subdomainError.count();
7742
7754
  if (subdomainErrorCount === 0) {
7743
7755
  updateCredentials({