@bigbinary/neeto-playwright-commons 1.8.26 → 1.8.27

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)