Ejemplo n.º 1
0
def test(data):
    test_builder.add_step_to_test('test', 'fail', params=["'failure message'"])
    actions.click(test_builder.run_button)
    test_run_modal.wait_for_test_to_run()
    test_run_modal.assert_result_log_line(0, 'Test execution started: {}'.format(data.test))
    test_run_modal.assert_result_log_line(1, 'INFO Browser: chrome')
    test_run_modal.assert_result_log_line(2, 'INFO Test started: test')
    test_run_modal.assert_result_log_line(3, 'ERROR AssertionError: failure message')
    test_run_modal.assert_result('failure')
    test_run_modal.assert_result_errors(['AssertionError: failure message'])
    test_run_modal.assert_result_steps(['Failure - AssertionError: failure message'])
Ejemplo n.º 2
0
def test(data):
    test_builder.add_step_to_test('test', 'code_block')
    step = test_builder.get_step('test', 0)
    assert step.step_type == 'code-block'
    step.set_code_value('if(True):\n    print("True")')
    assert step.get_code_value() == 'if(True):\n    print("True")'
    test_builder.save_test()
    test_builder.go_to_code_view()
    expected = ('def test(data):\n'
                '    if(True):\n'
                '        print("True")\n')
    assert expected in test_builder_code.get_value()
Ejemplo n.º 3
0
def test(data):
    test_builder.add_step_to_test('test', 'error', params=["'error message'"])
    actions.click(test_builder.run_button)
    test_run_modal.wait_for_test_to_run()
    test_run_modal.assert_result_log_line(
        0, 'Test execution started: {}'.format(data.test))
    test_run_modal.assert_result_log_line(1, 'INFO Browser: chrome')
    test_run_modal.assert_result_log_line(2, 'INFO Test started: test')
    test_run_modal.assert_result_log_line(3, 'ERROR error message')
    test_run_modal.assert_result_log_line(4, 'INFO Test Result: ERROR')
    test_run_modal.assert_result('error')
    test_run_modal.assert_result_errors(['error message'])
    test_run_modal.assert_result_steps(['ERROR - error message'])
Ejemplo n.º 4
0
def test_add_after_test_hook(data):
    test_builder.add_test_hook('after_test')
    test_builder.add_step_to_test('after_test', 'double_click')
    test_builder.save_test_and_refresh_page()
    assert test_builder.get_steps(
        'after_test')[0].action_name == 'double_click'
Ejemplo n.º 5
0
def test_add_after_each_hook(data):
    test_builder.add_test_hook('after_each')
    test_builder.add_step_to_test('after_each', 'add_cookie')
    test_builder.save_test_and_refresh_page()
    assert test_builder.get_steps('after_each')[0].action_name == 'add_cookie'
Ejemplo n.º 6
0
def test_add_before_each_hook(data):
    test_builder.add_test_hook('before_each')
    test_builder.add_step_to_test('before_each', 'log')
    test_builder.save_test()
    actions.refresh_page()
    assert test_builder.get_steps('before_each')[0].action_name == 'log'
Ejemplo n.º 7
0
def test_toast_is_displayed_when_saving_changes(data):
    test_builder.add_step_to_test('test', 'click')
    actions.click(test_builder.save_button)
    common.assert_toast_message_is_displayed('Test ' + data.test + ' saved')
Ejemplo n.º 8
0
def test(data):
    test_builder.add_step_to_test('test', 'click')
    actions.refresh_page()
    actions.assert_alert_present()
    actions.dismiss_alert()
    assert test_builder.get_step('test', 0).action_name == 'click'
Ejemplo n.º 9
0
def test(data):
    test_builder.add_step_to_test('test', 'click')
    test_builder.save_test_and_refresh_page()
    assert test_builder.get_steps('test')[0].action_name == 'click'
Ejemplo n.º 10
0
def test(data):
    test_builder.add_step_to_test('test', 'click')
    actions.refresh_page()
    actions.assert_alert_present()
    actions.accept_alert()