Add missing types.d.ts changes

This commit is contained in:
Evan Cahill 2024-12-19 16:09:19 -08:00
parent 278ff6e4b7
commit dc72f8f315

View file

@ -13853,18 +13853,22 @@ export interface Locator {
/** /**
* Creates a locator matching all elements that match one or both of the two locators. * Creates a locator matching all elements that match one or both of the two locators.
* *
* Note that when both locators match something, the resulting locator will have multiple matches and violate * Note that when both locators match something, the resulting locator will have multiple matches, potentially causing
* [locator strictness](https://playwright.dev/docs/locators#strictness) guidelines. * a [locator strictness](https://playwright.dev/docs/locators#strictness) violation.
* *
* **Usage** * **Usage**
* *
* Consider a scenario where you'd like to click on a "New email" button, but sometimes a security settings dialog * Consider a scenario where you'd like to click on a "New email" button, but sometimes a security settings dialog
* shows up instead. In this case, you can wait for either a "New email" button, or a dialog and act accordingly. * shows up instead. In this case, you can wait for either a "New email" button, or a dialog and act accordingly.
* *
* **NOTE** If both "New email" button and security dialog appear on screen, the "or" locator will match both of them,
* possibly throwing the ["strict mode violation" error](https://playwright.dev/docs/locators#strictness). In this case, you can use
* [locator.first()](https://playwright.dev/docs/api/class-locator#locator-first) to only match one of them.
*
* ```js * ```js
* const newEmail = page.getByRole('button', { name: 'New' }); * const newEmail = page.getByRole('button', { name: 'New' });
* const dialog = page.getByText('Confirm security settings'); * const dialog = page.getByText('Confirm security settings');
* await expect(newEmail.or(dialog)).toBeVisible(); * await expect(newEmail.or(dialog).first()).toBeVisible();
* if (await dialog.isVisible()) * if (await dialog.isVisible())
* await page.getByRole('button', { name: 'Dismiss' }).click(); * await page.getByRole('button', { name: 'Dismiss' }).click();
* await newEmail.click(); * await newEmail.click();