@bigbinary/neeto-playwright-commons 1.8.26 → 1.8.28

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
@@ -2539,6 +2539,21 @@ class CustomCommands {
2539
2539
  })}`;
2540
2540
  return await this.request[method](formattedUrl, requestOptions);
2541
2541
  };
2542
+ this.selectOptionFromDropdown = async ({ selectValueContainer, selectMenu, value, options = {}, }) => {
2543
+ Object.assign({
2544
+ visiblityTimeout: 2000,
2545
+ textAssertionTimeout: 1000,
2546
+ retryTimeout: 20000,
2547
+ }, options);
2548
+ await test$1.expect(async () => {
2549
+ await this.page.getByTestId(selectValueContainer).click();
2550
+ await test$1.expect(this.page.getByTestId(selectMenu)).toBeVisible({
2551
+ timeout: options.visiblityTimeout,
2552
+ });
2553
+ await this.page.getByTestId(selectMenu).getByText(value).click();
2554
+ await test$1.expect(this.page.getByTestId(selectValueContainer)).toContainText(value, { timeout: options.textAssertionTimeout });
2555
+ }).toPass({ timeout: options.retryTimeout });
2556
+ };
2542
2557
  this.verifyFieldValue = values => {
2543
2558
  const verifyEachFieldValue = ({ field, value, }) => test$1.expect(this.page.getByTestId(field)).toHaveValue(value);
2544
2559
  return Array.isArray(values)
@@ -12383,18 +12398,7 @@ class HelpAndProfilePage {
12383
12398
  await newConversationButton.click();
12384
12399
  await test$1.expect(this.neetoChatSpinner).toBeHidden({ timeout: 35000 });
12385
12400
  });
12386
- await test$1.test.step("Step 4: Fill and submit email", async () => {
12387
- var _a, _b;
12388
- await this.neetoChatFrame
12389
- .getByTestId(CHAT_WIDGET_SELECTORS.preChatEmailInput)
12390
- .fill((_b = (_a = readFileSyncIfExists()) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.email);
12391
- await this.neetoChatFrame
12392
- .getByTestId(CHAT_WIDGET_SELECTORS.preChatSubmitButton)
12393
- .getByRole("button")
12394
- .click();
12395
- await test$1.expect(this.neetoChatSpinner).toBeHidden({ timeout: 35000 });
12396
- });
12397
- await test$1.test.step("Step 5: Verify conversation window", async () => {
12401
+ await test$1.test.step("Step 4: Verify conversation window", async () => {
12398
12402
  await test$1.expect(this.neetoChatFrame.getByTestId(CHAT_WIDGET_SELECTORS.chatBubble)).toHaveText(CHAT_WIDGET_TEXTS.welcomeChatBubble);
12399
12403
  });
12400
12404
  };