def test_add_comment_saved(self, browser, login, logout): """Test that comment added in Comment block and seen after reopen """ comment_locator = RunTestPageLocators.TC_N_STEP_COMMENT_TB self.open_run_test_page_for_1st_test(browser) run_test_page = RunTestPage(browser) run_test_page.step_1_double_click() comment_text = run_test_page.visible_element_get_text( comment_locator, 0) run_test_page.visible_element_send_text(comment_locator, " New Added Comment", 0) run_test_page.failed_btn_1_step_click() run_test_page.passed_btn_1_step_click() run_test_page.save_and_close_btn_click() run_test_page.wait_new_page_load() cases_page = CasesPage(browser) cases_page.wait_new_page_load() cases_page.click_first_case() cases_page.click_mb3_first_case() cases_page.click_run_test_option() run_test_page.step_1_double_click() new_comment_text = run_test_page.visible_element_get_text( comment_locator, 0) assert new_comment_text == comment_text + ' New Added Comment', "Comment text should be seen in the end" run_test_page.visible_element_clear_text(comment_locator, 0) # clear added text run_test_page.visible_element_send_text(comment_locator, comment_text, 0) run_test_page.failed_btn_1_step_click() run_test_page.passed_btn_1_step_click() run_test_page.save_and_close_btn_click() cases_page.wait_new_page_load()
def open_run_test_page_for_1st_test(self, browser): """Function to load 'Run' page for 1st test case""" suites_page = SuitesPage(browser) suites_page.wait_new_page_load() suites_page.suite_1st_link_click() suites_page.wait_new_page_load() cases_page = CasesPage(browser) cases_page.click_first_case() cases_page.run_test_btn_click() cases_page.wait_new_page_load()
def test_comment_seen_after_double_click_on_1st_step( self, browser, login, logout): """Test that Comment block is seen after double-click on 1st step row """ self.open_run_test_page_for_1st_test(browser) run_test_page = RunTestPage(browser) run_test_page.step_1_double_click() assert run_test_page.is_element_seen( RunTestPageLocators.TC_N_STEP_COMMENT_TB), "Comment should be seen" run_test_page.back_to_suite_btn_click() cases_page = CasesPage(browser) cases_page.wait_new_page_load()
def test_back_to_suite_click(self, browser, login, logout): """Test that 'Cases' page opened after 'Back to Suite' icon in 'Run' page""" suites_page = SuitesPage(browser) suites_page.wait_new_page_load() suites_page.suite_1st_link_click() suites_page.wait_new_page_load() cases_page = CasesPage(browser) case_title = cases_page.get_title() cases_page.click_first_case() cases_page.run_test_btn_click() cases_page.wait_new_page_load() run_test_page = RunTestPage(browser) run_test_page.back_to_suite_btn_click() run_test_page.wait_new_page_load() non_run_page_title = run_test_page.get_title() assert non_run_page_title == case_title, "Should be 'Cases' page"
def test_save_and_close_icon_click(self, browser, login, logout): """Test that 'Cases' page opened after 'Save and Close' icon in 'Run' page""" suites_page = SuitesPage(browser) suites_page.wait_new_page_load() suites_page.suite_1st_link_click() suites_page.wait_new_page_load() cases_page = CasesPage(browser) cases_page.click_first_case() case_title = cases_page.get_title() cases_page.run_test_btn_click() cases_page.wait_new_page_load() run_test_page = RunTestPage(browser) run_test_page.failed_btn_1_step_click() run_test_page.passed_btn_1_step_click() run_test_page.save_and_close_btn_click() run_test_page.wait_new_page_load() test_page_title = run_test_page.get_title() assert test_page_title == case_title, "Should be 'Cases' page"
def test_case_name(self, browser, login, logout): """Test that test case name the same as opened in 'Cases' page""" suites_page = SuitesPage(browser) suites_page.wait_new_page_load() suites_page.suite_1st_link_click() suites_page.wait_new_page_load() cases_page = CasesPage(browser) case_title = cases_page.get_first_case_name() cases_page.click_first_case() cases_page.click_mb3_first_case() cases_page.click_run_test_option() cases_page.wait_new_page_load() run_test_page = RunTestPage(browser) case_name = run_test_page.get_test_case_name() assert case_name == case_title, "Should be test case name" run_test_page.back_to_suite_btn_click() cases_page = CasesPage(browser) cases_page.wait_new_page_load()
def test_edit_step_description_saved(self, browser, login, logout): """Test that step description edit is saved and seen after reopen """ step_description_locator = RunTestPageLocators.TC_N_STEP_DESCRIPTION self.open_run_test_page_for_1st_test(browser) run_test_page = RunTestPage(browser) run_test_page.step_1_double_click() step_description = run_test_page.visible_element_get_text( step_description_locator) run_test_page.visible_element_click(step_description_locator) run_test_page.step_alt_click(step_description_locator) run_test_page.step_alt_click(step_description_locator) run_test_page.visible_element_send_text(step_description_locator, " New Added Description") run_test_page.visible_element_double_click( RunTestPageLocators.TC_N_STEP_DESCRIPTION) # to exit editing mode run_test_page.failed_btn_1_step_click() run_test_page.passed_btn_1_step_click() run_test_page.save_and_close_btn_click() run_test_page.wait_new_page_load() cases_page = CasesPage(browser) cases_page.wait_new_page_load() cases_page.click_first_case() cases_page.click_mb3_first_case() cases_page.click_run_test_option() new_description_text = run_test_page.visible_element_get_text( step_description_locator) assert new_description_text == step_description + ' New Added Description', \ "Added Description should be seen in the end" run_test_page.step_alt_click(step_description_locator) run_test_page.step_alt_click(step_description_locator) run_test_page.visible_element_clear_text( step_description_locator) # clear text run_test_page.visible_element_send_text( step_description_locator, step_description) # paste original text run_test_page.visible_element_double_click( step_description_locator) # exit editing run_test_page.failed_btn_1_step_click() run_test_page.passed_btn_1_step_click() run_test_page.save_and_close_btn_click() cases_page.wait_new_page_load()
def test_edit_step_results_saved(self, browser, login, logout): """Test that step results edit is saved and seen after reopen """ tc_1_step_result_locator = RunTestPageLocators.TC_N_STEP_EXPECTED_RESULT self.open_run_test_page_for_1st_test(browser) run_test_page = RunTestPage(browser) run_test_page.step_1_double_click() step_result = run_test_page.visible_element_get_text( tc_1_step_result_locator, 0) run_test_page.visible_element_click(tc_1_step_result_locator, 0) run_test_page.step_alt_click(tc_1_step_result_locator, 0) run_test_page.step_alt_click(tc_1_step_result_locator, 0) run_test_page.visible_element_send_text(tc_1_step_result_locator, " New Added Result", 0) run_test_page.visible_element_double_click(tc_1_step_result_locator, 0) # to exit editing mode run_test_page.failed_btn_1_step_click() run_test_page.passed_btn_1_step_click() run_test_page.save_and_close_btn_click() run_test_page.wait_new_page_load() cases_page = CasesPage(browser) cases_page.wait_new_page_load() cases_page.click_first_case() cases_page.click_mb3_first_case() cases_page.click_run_test_option() new_description_text = run_test_page.visible_element_get_text( tc_1_step_result_locator, 0) assert new_description_text == step_result + ' New Added Result', \ "Added Result should be seen in the end" run_test_page.step_alt_click(tc_1_step_result_locator, 0) run_test_page.step_alt_click(tc_1_step_result_locator, 0) run_test_page.visible_element_clear_text(tc_1_step_result_locator, 0) # clear added text run_test_page.visible_element_send_text(tc_1_step_result_locator, step_result, 0) run_test_page.visible_element_double_click(tc_1_step_result_locator, 0) run_test_page.failed_btn_1_step_click() run_test_page.passed_btn_1_step_click() run_test_page.save_and_close_btn_click() cases_page.wait_new_page_load()