@bigbinary/neeto-playwright-commons 1.8.13 → 1.8.14

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
@@ -111,10 +111,8 @@ declare class HelpAndProfilePage {
111
111
  profileSectionButton: Locator;
112
112
  constructor({ page, neetoPlaywrightUtilities, chatApiBaseURL, kbDocsBaseURL, changelogBaseURL, }: HelpAndProfilePageInitializerProps);
113
113
  private hoverOnBody;
114
- openHelpCenter: () => Promise<void>;
115
114
  openHelpCenterV2: () => Promise<void>;
116
115
  private openLiveChatAndVerify;
117
- openAndVerifyChatWidget: () => Promise<void>;
118
116
  openAndVerifyChatWidgetV2: () => Promise<void>;
119
117
  openAndVerifyHelpArticlesV2: () => Promise<void>;
120
118
  private openChangelogPaneV2;
package/index.js CHANGED
@@ -7248,15 +7248,6 @@ const KEYBOARD_SHORTCUTS_SELECTORS = {
7248
7248
  class HelpAndProfilePage {
7249
7249
  constructor({ page, neetoPlaywrightUtilities, chatApiBaseURL, kbDocsBaseURL, changelogBaseURL, }) {
7250
7250
  this.hoverOnBody = () => this.page.locator("body").hover();
7251
- this.openHelpCenter = async () => {
7252
- await expect(async () => {
7253
- await this.hoverOnBody();
7254
- const helpButton = this.page.getByTestId(CHAT_WIDGET_SELECTORS.helpButton);
7255
- await helpButton.scrollIntoViewIfNeeded();
7256
- await helpButton.hover();
7257
- await expect(this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton)).toBeVisible();
7258
- }).toPass({ timeout: 15000 });
7259
- };
7260
7251
  this.openHelpCenterV2 = async () => {
7261
7252
  await expect(async () => {
7262
7253
  await this.hoverOnBody();
@@ -7267,74 +7258,36 @@ class HelpAndProfilePage {
7267
7258
  }).toPass({ timeout: 15000 });
7268
7259
  };
7269
7260
  this.openLiveChatAndVerify = async () => {
7270
- await this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton).click();
7271
- await expect(this.neetoChatWidget).toBeVisible();
7272
- await expect(this.neetoChatSpinner).toBeHidden();
7273
- };
7274
- this.openAndVerifyChatWidget = async () => {
7275
- const chatInitializationApis = this.neetoPlaywrightUtilities.interceptMultipleResponses({
7276
- baseUrl: this.chatApiBaseURL,
7277
- times: 3,
7278
- timeout: 20 * 1000, // Increased timeout accounting delays in page load
7279
- });
7280
- await this.page.reload();
7281
- await chatInitializationApis;
7282
- await test$1.step("Step 1: Open Help Center links", this.openHelpCenter);
7283
- await test$1.step("Step 2: Open live chat and verify iframe", this.openLiveChatAndVerify);
7284
- await test$1.step("Step 3: Close and reopen live chat frame", async () => {
7285
- await this.page.getByTestId(CHAT_WIDGET_SELECTORS.closeChat).click();
7286
- await expect(this.neetoChatWidget).toBeHidden();
7287
- await this.openHelpCenter();
7288
- await this.openLiveChatAndVerify();
7289
- });
7290
- await test$1.step("Step 4: Start new conversation", async () => {
7291
- const newConversationButton = this.neetoChatFrame.getByRole("button", {
7292
- name: CHAT_WIDGET_TEXTS.newConversation,
7293
- });
7294
- await expect(newConversationButton).toBeVisible(); // Adding additional toBeVisible to take advantage of the auto-retrying web-first assertion
7295
- await newConversationButton.click();
7296
- await expect(this.neetoChatSpinner).toBeHidden();
7297
- });
7298
- await test$1.step("Step 5: Fill and submit email", async () => {
7299
- var _a, _b;
7300
- await this.neetoChatFrame
7301
- .getByTestId(CHAT_WIDGET_SELECTORS.preChatEmailInput)
7302
- .fill((_b = (_a = readFileSyncIfExists()) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.email);
7303
- await this.neetoChatFrame
7304
- .getByTestId(CHAT_WIDGET_SELECTORS.preChatSubmitButton)
7305
- .getByRole("button")
7306
- .click();
7307
- await expect(this.neetoChatSpinner).toBeHidden();
7308
- });
7309
- await test$1.step("Step 6: Verify conversation window", async () => {
7310
- await expect(this.neetoChatFrame.getByTestId(CHAT_WIDGET_SELECTORS.chatBubble)).toHaveText(CHAT_WIDGET_TEXTS.welcomeChatBubble);
7311
- });
7261
+ await expect(async () => {
7262
+ await this.openHelpCenterV2();
7263
+ await this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton).click();
7264
+ await expect(this.neetoChatWidget).toBeVisible();
7265
+ await expect(this.neetoChatSpinner).toBeHidden({ timeout: 20 * 1000 });
7266
+ await expect(this.neetoChatWidget).toBeVisible();
7267
+ }).toPass({ timeout: 45000 });
7312
7268
  };
7313
7269
  this.openAndVerifyChatWidgetV2 = async () => {
7314
7270
  const chatInitializationApis = this.neetoPlaywrightUtilities.interceptMultipleResponses({
7315
7271
  baseUrl: this.chatApiBaseURL,
7316
7272
  times: 3,
7317
- timeout: 20 * 1000, // Increased timeout accounting delays in page load
7318
7273
  });
7319
7274
  await this.page.reload();
7320
7275
  await chatInitializationApis;
7321
- await test$1.step("Step 1: Open Help Center links", this.openHelpCenterV2);
7322
- await test$1.step("Step 2: Open live chat and verify iframe", this.openLiveChatAndVerify);
7323
- await test$1.step("Step 3: Close and reopen live chat frame", async () => {
7276
+ await test$1.step("Step 1: Open live chat and verify iframe", this.openLiveChatAndVerify);
7277
+ await test$1.step("Step 2: Close and reopen live chat frame", async () => {
7324
7278
  await this.page.getByTestId(CHAT_WIDGET_SELECTORS.closeChat).click();
7325
- await expect(this.neetoChatWidget).toBeHidden();
7326
- await this.openHelpCenterV2();
7279
+ await expect(this.neetoChatWidget).toBeHidden({ timeout: 20000 });
7327
7280
  await this.openLiveChatAndVerify();
7328
7281
  });
7329
- await test$1.step("Step 4: Start new conversation", async () => {
7282
+ await test$1.step("Step 3: Start new conversation", async () => {
7330
7283
  const newConversationButton = this.neetoChatFrame.getByRole("button", {
7331
7284
  name: CHAT_WIDGET_TEXTS.newConversation,
7332
7285
  });
7333
- await expect(newConversationButton).toBeVisible(); // Adding additional toBeVisible to take advantage of the auto-retrying web-first assertion
7286
+ await expect(newConversationButton).toBeVisible({ timeout: 20000 }); // Adding additional toBeVisible to take advantage of the auto-retrying web-first assertion
7334
7287
  await newConversationButton.click();
7335
- await expect(this.neetoChatSpinner).toBeHidden();
7288
+ await expect(this.neetoChatSpinner).toBeHidden({ timeout: 20000 });
7336
7289
  });
7337
- await test$1.step("Step 5: Fill and submit email", async () => {
7290
+ await test$1.step("Step 4: Fill and submit email", async () => {
7338
7291
  var _a, _b;
7339
7292
  await this.neetoChatFrame
7340
7293
  .getByTestId(CHAT_WIDGET_SELECTORS.preChatEmailInput)
@@ -7343,9 +7296,9 @@ class HelpAndProfilePage {
7343
7296
  .getByTestId(CHAT_WIDGET_SELECTORS.preChatSubmitButton)
7344
7297
  .getByRole("button")
7345
7298
  .click();
7346
- await expect(this.neetoChatSpinner).toBeHidden();
7299
+ await expect(this.neetoChatSpinner).toBeHidden({ timeout: 20000 });
7347
7300
  });
7348
- await test$1.step("Step 6: Verify conversation window", async () => {
7301
+ await test$1.step("Step 5: Verify conversation window", async () => {
7349
7302
  await expect(this.neetoChatFrame.getByTestId(CHAT_WIDGET_SELECTORS.chatBubble)).toHaveText(CHAT_WIDGET_TEXTS.welcomeChatBubble);
7350
7303
  });
7351
7304
  };
@@ -7485,9 +7438,10 @@ class HelpAndProfilePage {
7485
7438
  await this.page
7486
7439
  .getByTestId(PROFILE_SECTION_SELECTORS.logoutButton)
7487
7440
  .click();
7488
- await expect(this.page).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL()), {
7489
- timeout: 15000,
7490
- });
7441
+ process.env.TEST_ENV === ENVIRONMENT.staging &&
7442
+ (await expect(this.page).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL()), {
7443
+ timeout: 15000,
7444
+ }));
7491
7445
  await expect(this.page).toHaveURL(new RegExp(ROUTES.loginLink), {
7492
7446
  timeout: 15000,
7493
7447
  });