In one of my functional GEB tests we have a situation where we are opening a new window by using
withNewWindow({ button.click() }, "close": true, "wait": true) {
//Other things
}
Now when that window is being closed a confirm dialog is opening which says whether you want to leave this page or not. How to close that confirm dialog?
I know that there is a method withConfirm
for closing confirm dialogs but I am not doing anything to open/close it but instead withNewWindow
is opening/closing that.
I tried various options but couldn't figure out how to do that. I looked at the docs but couldn't find any examples for this.
You will need to pass
false
for theclose
option ofwithNewWindow()
and then wrap closing the newly opened window in awithConfirm()
call in such case: