microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.51k stars 3.64k forks source link

[Feature]: Ability to type in the address bar #32754

Closed mdmower closed 1 month ago

mdmower commented 1 month ago

🚀 Feature Request

I would appreciate the ability to type into the address bar.

From https://github.com/microsoft/playwright/issues/15126, I understand this is currently not possible and seems out of scope. The author of that issue never got back to the question about use case. This would help test implementations of the omnibox API in Edge, Chrome, and Firefox extensions.

Even if exposing suggest results is deemed out of scope, the ability to send keyword some text[enter], where keyword is the keyword that triggers an extension (defined in the manifest) and some text is the text to be handled by onInputEntered, would help extension developers test basic functionality.

Example

await browser.addressBar.type('doi 10.1000/182');
await browser.addressBar.press('Enter');

Motivation

This would enable more complete testing of extensions for Edge, Chrome, and Firefox. For example, in my doi-resolver project, there is currently no way to test omnibox API usage.

yury-s commented 1 month ago

As Omnibox is not a part of the web platform, Playwright does not support it and we are not planning to work on it at the moment.

Support for firefox extensions is tracked in https://github.com/microsoft/playwright/issues/7297

mdmower commented 1 month ago

@yury-s - for what it's worth, omnibox is included in w3c/webextensions interfaces: interfaces/chromium/chrome-common-extensions-api/omnibox.json. Playwright is one of the very few options extension developers have for testing extensions (the other being manual pairing of puppeteer with a testing framework like jest or mocha), so I hope the team will keep an open mind about supporting this neglected community.