def confirm_prompt(page, cancel=False, require_notification=None):
 page.wait_for_element_visibility('.prompt', 'Prompt is visible')
 confirmation_button_css = ('.prompt .action-' + ('secondary' if cancel else 'primary'))
 page.wait_for_element_visibility(confirmation_button_css, 'Confirmation button is visible')
 require_notification = ((not cancel) if (require_notification is None) else require_notification)
 click_css(page, confirmation_button_css, require_notification=require_notification)

def confirm_prompt ( page , cancel = False , require_notification = None ) : page . wait_for_element_visibility ( '.prompt' , 'Prompt is visible' ) confirmation_button_css = ( '.prompt .action-' + ( 'secondary' if cancel else 'primary' ) ) page . wait_for_element_visibility ( confirmation_button_css , 'Confirmation button is visible' ) require_notification = ( ( not cancel ) if ( require_notification is None ) else require_notification ) click_css ( page , confirmation_button_css , require_notification = require_notification )
ensures that a modal prompt and confirmation button are visible .