@bigbinary/neeto-playwright-commons 1.16.2 → 1.16.4

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
@@ -3914,8 +3914,14 @@ class CustomCommands {
3914
3914
  await test$1.expect(customPageContext.locator(COMMON_SELECTORS.toastIcon)).toContainText("👍", { timeout });
3915
3915
  }
3916
3916
  if (closeAfterVerification && (await toastrCloseButton.isVisible())) {
3917
- await toastrCloseButton.click();
3918
- await test$1.expect(toastrCloseButton).toBeHidden();
3917
+ const buttonHandle = await toastrCloseButton.elementHandle();
3918
+ if (buttonHandle) {
3919
+ await customPageContext.evaluate(button => {
3920
+ button.dispatchEvent(new Event("click", { bubbles: true }));
3921
+ }, buttonHandle);
3922
+ // eslint-disable-next-line playwright/no-standalone-expect
3923
+ await test$1.expect(toastrCloseButton).toBeHidden();
3924
+ }
3919
3925
  }
3920
3926
  };
3921
3927
  this.reloadAndWait = async (requestCount, customPageContext, interceptMultipleResponsesProps = {}) => {
@@ -4027,8 +4033,12 @@ class CustomCommands {
4027
4033
  }, { buffer, fileNameWithType });
4028
4034
  await droppableZone.dispatchEvent(dispatchEvent, { dataTransfer });
4029
4035
  };
4030
- this.verifyTooltip = async ({ triggerElement, content, customPageContext = this.page, }) => {
4036
+ this.hoverOnElement = (triggerElement, customPageContext = this.page) => test$1.expect(async () => {
4031
4037
  await triggerElement.hover();
4038
+ await test$1.expect(customPageContext.getByTestId(COMMON_SELECTORS.tooltip)).toBeVisible({ timeout: 3000 });
4039
+ }).toPass({ timeout: 10000 });
4040
+ this.verifyTooltip = async ({ triggerElement, content, customPageContext = this.page, }) => {
4041
+ await this.hoverOnElement(triggerElement, customPageContext);
4032
4042
  await test$1.expect(customPageContext.getByTestId(COMMON_SELECTORS.tooltip)).toContainText(content);
4033
4043
  await this.hideTooltip(triggerElement, customPageContext);
4034
4044
  };
@@ -21560,25 +21570,9 @@ class HelpAndProfilePage {
21560
21570
  await this.page.getByTestId(CHAT_WIDGET_SELECTORS.closeChat).click();
21561
21571
  await test$1.expect(this.neetoChatWidget).toBeHidden({ timeout: 35000 });
21562
21572
  await this.openLiveChatAndVerify();
21563
- });
21564
- await test$1.test.step("Step 3: Start new conversation", async () => {
21565
- const newConversationButton = this.neetoChatFrame.getByRole("button", {
21573
+ await test$1.expect(this.neetoChatFrame.getByRole("button", {
21566
21574
  name: CHAT_WIDGET_TEXTS.newConversation,
21567
- });
21568
- await test$1.expect(newConversationButton).toBeVisible({ timeout: 35000 }); // Adding additional toBeVisible to take advantage of the auto-retrying web-first assertion
21569
- await newConversationButton.click();
21570
- await test$1.expect(this.neetoChatSpinner).toBeHidden({ timeout: 35000 });
21571
- (await this.neetoChatFrame
21572
- .getByTestId(CHAT_WIDGET_SELECTORS.chatQuestionHeader)
21573
- .getByText(CHAT_WIDGET_TEXTS.preChatQuestions)
21574
- .isVisible()) &&
21575
- (await this.neetoChatFrame
21576
- .getByTestId(CHAT_WIDGET_SELECTORS.preChatSubmitButton)
21577
- .click());
21578
- await test$1.expect(this.neetoChatSpinner).toBeHidden({ timeout: 35000 });
21579
- });
21580
- await test$1.test.step("Step 4: Verify conversation window", async () => {
21581
- await test$1.expect(this.neetoChatFrame.getByTestId(CHAT_WIDGET_SELECTORS.chatBubble)).toHaveText(CHAT_WIDGET_TEXTS.welcomeChatBubble);
21575
+ })).toBeVisible({ timeout: 35000 });
21582
21576
  });
21583
21577
  };
21584
21578
  this.openAndVerifyHelpArticlesV2 = async () => {