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'])
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()
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'])
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'
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'
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'
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')
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'
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'
def test(data): test_builder.add_step_to_test('test', 'click') actions.refresh_page() actions.assert_alert_present() actions.accept_alert()