And when I try it in the console in a test app, i get an error about it not being a function:
(I'm surprised it's highlighting the button when you try that call in your code, but that might be incidental or an unintended side-effect.)
I vaguely recall seeing here in the forums or other docs that this is expected, as the button is meant to be non-programmatic and only truly clicked via user action, but I couldn't find any trace of that.
I'm not familiar with Playwright directly, but is it possible to just call the button's click event handler(s) directly? (I realize that wouldn't be a true exercise of the UI/app, but it might suffice for your case!)
The click method happens on playwright, but there is something about buttons in retool that is blocking the click. That's why I wanted to know if someone has encountered this problem while trying to test an app.
Sorry for the confusion, we should do a better job adding this into our documentation to explain that the button.click method won't work as pointed out by @dguzzo.
However you can still execute tests using playwright, you will just need to replace await button.click() with
await button.focus(); await page.keyboard.press("Enter") as outlined in this forum post on a similar topic!