Using GEB, how can I very text and click OK in an alert box

Multi tool use


Using GEB, how can I very text and click OK in an alert box
I have a basic alert box with OK or Cancel options
Using selenium, it was easy to use alert.getText()
and alert.accept
. How can I handle this same scenario using GEB?
alert.getText()
alert.accept
It looks like I can verify the text using withConfirm, but I can't figure out how to click the OK button.
assert withConfirm(true) { $("input", name: "showConfirm").click() } == "Do you like Geb?"
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.