def test_dismiss_alert_prompt(data): actions.navigate(data.env.url + 'prompt/') actions.click('#prompt-button') actions.verify_alert_present() actions.dismiss_alert() actions.verify_alert_not_present() actions.verify_element_text('#result', 'DISMISSED')
def test_dismiss_alert_confirm(data): actions.navigate(data.env.url + 'confirm/') actions.click('#confirm-button') actions.verify_alert_present() actions.dismiss_alert() actions.verify_alert_not_present() actions.verify_element_text('#result', 'NOT CONFIRMED')
def test_dismiss_alert(data): actions.navigate(data.env.url+'alert/') actions.click('#alert-button') actions.verify_alert_present() actions.dismiss_alert() golem_steps.assert_last_step_message('Dismiss alert') actions.verify_alert_not_present() actions.verify_element_text('#result', '1')
def test(data): actions.navigate(data.env.url + 'alert/') actions.verify_alert_not_present() golem_steps.assert_last_step_message('Verify an alert is not present') actions.click('#alert-button') # Temporarily disable screenshot on error # Selenium cannot take screenshots when alert is present # TODO current = execution.settings['screenshot_on_error'] execution.settings['screenshot_on_error'] = False actions.verify_alert_not_present() golem_steps.assert_last_error('an alert was present') actions.dismiss_alert() execution.settings['screenshot_on_error'] = current
def test(data): actions.navigate(data.env.url + 'alert/') actions.verify_alert_not_present() actions.click('#alert-button') try: actions.verify_alert_not_present() except Exception as e: assert 'an alert was present' in e.args[0] actions.dismiss_alert() actions.verify_alert_not_present()
def test(data): # alert actions.navigate(data.env.url + 'alert/') actions.click('#alert-button') actions.verify_alert_present() actions.dismiss_alert() actions.verify_alert_not_present() actions.verify_text_in_element('#result', '1') # confirm actions.navigate(data.env.url + 'confirm/') actions.click('#confirm-button') actions.verify_alert_present() actions.dismiss_alert() actions.verify_alert_not_present() actions.verify_text_in_element('#result', 'NOT CONFIRMED') # prompt actions.navigate(data.env.url + 'prompt/') actions.click('#prompt-button') actions.verify_alert_present() actions.dismiss_alert() actions.verify_alert_not_present() actions.verify_text_in_element('#result', 'DISMISSED')
def test_accept_alert(data): # alert actions.navigate(data.env.url + 'alert/') actions.click('#alert-button') actions.verify_alert_present() actions.accept_alert() assert golem_logger.last_info_log_line_contains('Accept alert') actions.verify_alert_not_present() actions.verify_element_text('#result', '1') # confirm actions.navigate(data.env.url + 'confirm/') actions.click('#confirm-button') actions.verify_alert_present() actions.accept_alert() actions.verify_alert_not_present() actions.verify_element_text('#result', 'CONFIRMED') # prompt actions.navigate(data.env.url + 'prompt/') actions.click('#prompt-button') actions.verify_alert_present() actions.accept_alert() actions.verify_alert_not_present() actions.verify_element_text('#result', 'EMPTY')
def test(data): # alert actions.navigate(data.env.url + 'alert/') actions.click('#alert-button') actions.verify_alert_present() actions.dismiss_alert() golem_steps.assert_last_step_message('Dismiss alert') actions.verify_alert_not_present() actions.verify_element_text('#result', '1') # confirm actions.navigate(data.env.url + 'confirm/') actions.click('#confirm-button') actions.verify_alert_present() actions.dismiss_alert() actions.verify_alert_not_present() actions.verify_element_text('#result', 'NOT CONFIRMED') # prompt actions.navigate(data.env.url + 'prompt/') actions.click('#prompt-button') actions.verify_alert_present() actions.dismiss_alert() actions.verify_alert_not_present() actions.verify_element_text('#result', 'DISMISSED')