Click a button of the dialog on top by its text ("Ok", "Discard", "Save & Close", the action of a wizard) and wait for what it starts.
Examples
When I click the "Ok" button in the dialog
When we click the "Discard" button in the dialog
And I click the "Save & Close" button in the dialog
When I click the "Cancel" button of the dialog
And we click the "Create Draft Invoice" button of the dialog
Pattern
When(/^(I |we )*click the "([^"]*)" button (?:in|of) the dialog$/, …)
Part of @webship-js/odoo-steps (github.com/webship/odoo-steps), a step pack for Webship-js 2.0.x.