Need to send a command to the console '$gui.dispatch('callBarcodeHandler', '98783083')' from test. For example, in the test I log in and I need to send a command to scan the barcode.
Using page.evaluate function you can execute an arbitrary code inside the Browser context a.k.a console
Example:
const windowHeight = await page.evaluate('window.innerHeight');
More info: https://playwright.dev/docs/evaluating
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With