@bigbinary/neeto-playwright-commons 1.8.13 → 1.8.15

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
@@ -7283,15 +7283,6 @@ const KEYBOARD_SHORTCUTS_SELECTORS = {
7283
7283
  class HelpAndProfilePage {
7284
7284
  constructor({ page, neetoPlaywrightUtilities, chatApiBaseURL, kbDocsBaseURL, changelogBaseURL, }) {
7285
7285
  this.hoverOnBody = () => this.page.locator("body").hover();
7286
- this.openHelpCenter = async () => {
7287
- await test.expect(async () => {
7288
- await this.hoverOnBody();
7289
- const helpButton = this.page.getByTestId(CHAT_WIDGET_SELECTORS.helpButton);
7290
- await helpButton.scrollIntoViewIfNeeded();
7291
- await helpButton.hover();
7292
- await test.expect(this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton)).toBeVisible();
7293
- }).toPass({ timeout: 15000 });
7294
- };
7295
7286
  this.openHelpCenterV2 = async () => {
7296
7287
  await test.expect(async () => {
7297
7288
  await this.hoverOnBody();
@@ -7302,74 +7293,36 @@ class HelpAndProfilePage {
7302
7293
  }).toPass({ timeout: 15000 });
7303
7294
  };
7304
7295
  this.openLiveChatAndVerify = async () => {
7305
- await this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton).click();
7306
- await test.expect(this.neetoChatWidget).toBeVisible();
7307
- await test.expect(this.neetoChatSpinner).toBeHidden();
7308
- };
7309
- this.openAndVerifyChatWidget = async () => {
7310
- const chatInitializationApis = this.neetoPlaywrightUtilities.interceptMultipleResponses({
7311
- baseUrl: this.chatApiBaseURL,
7312
- times: 3,
7313
- timeout: 20 * 1000, // Increased timeout accounting delays in page load
7314
- });
7315
- await this.page.reload();
7316
- await chatInitializationApis;
7317
- await test.test.step("Step 1: Open Help Center links", this.openHelpCenter);
7318
- await test.test.step("Step 2: Open live chat and verify iframe", this.openLiveChatAndVerify);
7319
- await test.test.step("Step 3: Close and reopen live chat frame", async () => {
7320
- await this.page.getByTestId(CHAT_WIDGET_SELECTORS.closeChat).click();
7321
- await test.expect(this.neetoChatWidget).toBeHidden();
7322
- await this.openHelpCenter();
7323
- await this.openLiveChatAndVerify();
7324
- });
7325
- await test.test.step("Step 4: Start new conversation", async () => {
7326
- const newConversationButton = this.neetoChatFrame.getByRole("button", {
7327
- name: CHAT_WIDGET_TEXTS.newConversation,
7328
- });
7329
- await test.expect(newConversationButton).toBeVisible(); // Adding additional toBeVisible to take advantage of the auto-retrying web-first assertion
7330
- await newConversationButton.click();
7331
- await test.expect(this.neetoChatSpinner).toBeHidden();
7332
- });
7333
- await test.test.step("Step 5: Fill and submit email", async () => {
7334
- var _a, _b;
7335
- await this.neetoChatFrame
7336
- .getByTestId(CHAT_WIDGET_SELECTORS.preChatEmailInput)
7337
- .fill((_b = (_a = readFileSyncIfExists()) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.email);
7338
- await this.neetoChatFrame
7339
- .getByTestId(CHAT_WIDGET_SELECTORS.preChatSubmitButton)
7340
- .getByRole("button")
7341
- .click();
7342
- await test.expect(this.neetoChatSpinner).toBeHidden();
7343
- });
7344
- await test.test.step("Step 6: Verify conversation window", async () => {
7345
- await test.expect(this.neetoChatFrame.getByTestId(CHAT_WIDGET_SELECTORS.chatBubble)).toHaveText(CHAT_WIDGET_TEXTS.welcomeChatBubble);
7346
- });
7296
+ await test.expect(async () => {
7297
+ await this.openHelpCenterV2();
7298
+ await this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton).click();
7299
+ await test.expect(this.neetoChatWidget).toBeVisible();
7300
+ await test.expect(this.neetoChatSpinner).toBeHidden({ timeout: 20 * 1000 });
7301
+ await test.expect(this.neetoChatWidget).toBeVisible();
7302
+ }).toPass({ timeout: 45000 });
7347
7303
  };
7348
7304
  this.openAndVerifyChatWidgetV2 = async () => {
7349
7305
  const chatInitializationApis = this.neetoPlaywrightUtilities.interceptMultipleResponses({
7350
7306
  baseUrl: this.chatApiBaseURL,
7351
7307
  times: 3,
7352
- timeout: 20 * 1000, // Increased timeout accounting delays in page load
7353
7308
  });
7354
7309
  await this.page.reload();
7355
7310
  await chatInitializationApis;
7356
- await test.test.step("Step 1: Open Help Center links", this.openHelpCenterV2);
7357
- await test.test.step("Step 2: Open live chat and verify iframe", this.openLiveChatAndVerify);
7358
- await test.test.step("Step 3: Close and reopen live chat frame", async () => {
7311
+ await test.test.step("Step 1: Open live chat and verify iframe", this.openLiveChatAndVerify);
7312
+ await test.test.step("Step 2: Close and reopen live chat frame", async () => {
7359
7313
  await this.page.getByTestId(CHAT_WIDGET_SELECTORS.closeChat).click();
7360
- await test.expect(this.neetoChatWidget).toBeHidden();
7361
- await this.openHelpCenterV2();
7314
+ await test.expect(this.neetoChatWidget).toBeHidden({ timeout: 20000 });
7362
7315
  await this.openLiveChatAndVerify();
7363
7316
  });
7364
- await test.test.step("Step 4: Start new conversation", async () => {
7317
+ await test.test.step("Step 3: Start new conversation", async () => {
7365
7318
  const newConversationButton = this.neetoChatFrame.getByRole("button", {
7366
7319
  name: CHAT_WIDGET_TEXTS.newConversation,
7367
7320
  });
7368
- await test.expect(newConversationButton).toBeVisible(); // Adding additional toBeVisible to take advantage of the auto-retrying web-first assertion
7321
+ await test.expect(newConversationButton).toBeVisible({ timeout: 20000 }); // Adding additional toBeVisible to take advantage of the auto-retrying web-first assertion
7369
7322
  await newConversationButton.click();
7370
- await test.expect(this.neetoChatSpinner).toBeHidden();
7323
+ await test.expect(this.neetoChatSpinner).toBeHidden({ timeout: 20000 });
7371
7324
  });
7372
- await test.test.step("Step 5: Fill and submit email", async () => {
7325
+ await test.test.step("Step 4: Fill and submit email", async () => {
7373
7326
  var _a, _b;
7374
7327
  await this.neetoChatFrame
7375
7328
  .getByTestId(CHAT_WIDGET_SELECTORS.preChatEmailInput)
@@ -7378,9 +7331,9 @@ class HelpAndProfilePage {
7378
7331
  .getByTestId(CHAT_WIDGET_SELECTORS.preChatSubmitButton)
7379
7332
  .getByRole("button")
7380
7333
  .click();
7381
- await test.expect(this.neetoChatSpinner).toBeHidden();
7334
+ await test.expect(this.neetoChatSpinner).toBeHidden({ timeout: 20000 });
7382
7335
  });
7383
- await test.test.step("Step 6: Verify conversation window", async () => {
7336
+ await test.test.step("Step 5: Verify conversation window", async () => {
7384
7337
  await test.expect(this.neetoChatFrame.getByTestId(CHAT_WIDGET_SELECTORS.chatBubble)).toHaveText(CHAT_WIDGET_TEXTS.welcomeChatBubble);
7385
7338
  });
7386
7339
  };
@@ -7520,9 +7473,10 @@ class HelpAndProfilePage {
7520
7473
  await this.page
7521
7474
  .getByTestId(PROFILE_SECTION_SELECTORS.logoutButton)
7522
7475
  .click();
7523
- await test.expect(this.page).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL()), {
7524
- timeout: 15000,
7525
- });
7476
+ process.env.TEST_ENV === ENVIRONMENT.staging &&
7477
+ (await test.expect(this.page).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL()), {
7478
+ timeout: 15000,
7479
+ }));
7526
7480
  await test.expect(this.page).toHaveURL(new RegExp(ROUTES.loginLink), {
7527
7481
  timeout: 15000,
7528
7482
  });
@@ -8064,6 +8018,7 @@ const ROLES_SELECTORS = {
8064
8018
  permissionCheckbox: "ntm-roles-permission-checkbox",
8065
8019
  editRoleButton: "ntm-roles-table-edit-role-button",
8066
8020
  deleteRoleButton: " ntm-roles-table-delete-role-button",
8021
+ permissionCard: "ntm-roles-permission-card",
8067
8022
  };
8068
8023
 
8069
8024
  const TAGS_SELECTORS = {