def test(data): actions.navigate(data.env.url + 'elements/') actions.assert_element_text_contains('#link1', 'this is a link') golem_steps.assert_last_step_message( "Assert element #link1 contains text 'this is a link'") msg = "expected element #link1 text 'this is a link to index' to contain 'not-contained'" with expected_exception(AssertionError, msg): actions.assert_element_text_contains('#link1', 'not-contained')
def test(data): suite_builder.run_suite() suite_builder.access_suite_execution_from_toast() report_execution.wait_until_execution_end() actions.assert_element_text_contains(report_execution.title, 'test reports - simple suite') report_execution.assert_amount_of_tests(1) report_execution.assert_result_of_test(data.test_name, 'success') report_execution.expand_test(data.test_name) report_execution.assert_test_detail_row_is_displayed(data.test_name) report_execution.assert_general_total_row(columns={'Total Tests': '1', 'Success': '1', 'Failure': '0'})
def test(data): suite_builder.run_suite() suite_builder.access_suite_execution_from_toast() report_execution.wait_until_execution_end() current_url = actions.get_current_url() actions.navigate(current_url + 'html/') actions.assert_element_text_contains(report_execution.title, 'report execution - simple suite') actions.navigate(current_url + 'html-no-images/') actions.assert_element_text_contains(report_execution.title, 'report execution - simple suite') actions.navigate(current_url + 'json/') assert '"totals_by_result"' in actions.get_browser().page_source actions.navigate(current_url + 'junit/') actions.assert_url_contains('/junit')
def test(data): suite_builder.run_suite() suite_builder.access_suite_execution_from_toast() report_execution.wait_until_execution_end() actions.assert_element_text_contains( report_execution.title, 'report execution - {}'.format(data.suite)) report_execution.assert_amount_of_tests(1) assert report_execution.get_test_result(data.success_test, 'test_one') == 'success' report_execution.expand_test(data.success_test, 'test_one') report_execution.assert_test_detail_row_is_displayed( data.success_test, 'test_one') report_execution.assert_general_total_row(columns={ 'Total Tests': '1', 'Success': '1', 'Failure': '0' })
def assert_result_of_test(full_test_name, expected_result): """Assert the result of a test by the test full name""" test_row = test_row_by_full_test_name(full_test_name) result_td = test_row.find('td.test-result') actions.assert_element_text_contains(result_td, expected_result)