Exemplo n.º 1
0
def test_send_text_to_alert(data):
    actions.navigate(data.env.url + 'prompt/')
    actions.click('#prompt-button')
    actions.send_text_to_alert('hey, some text')
    golem_steps.assert_last_step_message("Send 'hey, some text' to alert")
    actions.accept_alert()
    actions.verify_element_text('#result', 'hey, some text')
Exemplo n.º 2
0
def test(data):
    actions.navigate(data.env.url + 'alert/')
    actions.accept_alert(ignore_not_present=True)
    actions.click('#alert-button')
    try:
        actions.accept_alert()
    except Exception as e:
        assert e.__class__.__name__ == 'NoAlertPresentException'
Exemplo n.º 3
0
def test(data):
    actions.send_keys(suite_builder.environments_input, 'not-existent')
    actions.wait(0.5)
    actions.click(suite_builder.save_button)
    common.assert_toast_message_is_displayed(
        'Environment not-existent does not exist for project test')
    actions.refresh_page()
    actions.assert_alert_present()
    actions.accept_alert()
    actions.assert_element_value(suite_builder.environments_input, '')
Exemplo n.º 4
0
def test(data):
    actions.wait(1)
    actions.check_element(suite_builder.all_tests_checkbox)
    actions.send_keys(suite_builder.processes_input, 3)
    actions.refresh_page()
    actions.wait(1)
    actions.assert_alert_present()
    actions.accept_alert()
    actions.assert_element_value(suite_builder.processes_input, '1')
    actions.clear_element(suite_builder.processes_input)
    actions.send_keys(suite_builder.processes_input, 3)
    actions.refresh_page()
    actions.assert_alert_present()
    actions.dismiss_alert()
    suite_builder.save_suite()
    common.navigate_menu('Suites')
    actions.assert_title_contains(': Suites')
Exemplo n.º 5
0
def test(data):
    # alert
    actions.navigate(data.env.url+'alert/')
    actions.click('#alert-button')
    actions.verify_alert_present()
    actions.accept_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.accept_alert()
    actions.verify_alert_not_present()
    actions.verify_text_in_element('#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_text_in_element('#result', 'EMPTY')
Exemplo n.º 6
0
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')
Exemplo n.º 7
0
def test_alert_not_present(data):
    actions.navigate(data.env.url + 'alert/')
    actions.accept_alert(ignore_not_present=True)
    with expected_exception(NoAlertPresentException):
        actions.accept_alert()
def test(data):
    actions.navigate(data.env.url + 'prompt/')
    actions.click('#prompt-button')
    actions.send_text_to_alert('hey, some text')
    actions.accept_alert()
    actions.verify_text_in_element('#result', 'hey, some text')
Exemplo n.º 9
0
def test(data):
    test_builder.add_action('click')
    actions.refresh_page()
    actions.assert_alert_present()
    actions.accept_alert()
Exemplo n.º 10
0
def test(data):
    test_builder.add_step_to_test('test', 'click')
    actions.refresh_page()
    actions.assert_alert_present()
    actions.accept_alert()