def test_statistics_table_scenario2(browser, login, logout): """Check that Statistics table contains correct information""" 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() run_test_page = RunTestPage(browser) run_test_page.wait_new_page_load() run_test_page.set_case_status('passed') run_test_page.save_btn_click() run_test_page.back_to_suite_btn_click() run_test_page.wait_new_page_load() cases_page = CasesPage(browser) cases_page.click_first_case() cases_page.click_statistics_option() assert cases_page.visible_element_get_text( locators.CasesPageLocators.STATTABLE_SUITE) == "Nadiia - Linux - 20.6.4" and \ cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_RUN_BY) == "KYahorlytska" and \ cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_RESULT) == "✅ Passed" and \ cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_DURATION) <= "00:00:05" and \ cases_page.visible_element_get_text( locators.CasesPageLocators.STATTABLE_DATE) == "Dec 28 2020 09:37:52" # defect,should be changed to current date
def test_statistics_table_scenario3(browser, login, logout): """Check that Statistics table is updated if switch between several cases""" 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.click_statistics_option() cases_page.click_nth_case(7) cases_page.click_statistics_option() #time.sleep(2) assert cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_SUITE) == "Nadiia - Linux - 20.6.4" and \ cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_RUN_BY) == "Nadiia" and \ cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_RESULT) == "❌ Failed"
def test_current_suite_name(browser, login, logout): """Check that Current suite name is visible and contains correct information. Expected result: Current Suite - Nadiia - Linux - 20.6.4""" 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) current_suite_name = cases_page.visible_element_get_text(locators.CasesPageLocators.CURRENT_SUITE_NAME) assert current_suite_name == "Current Suite - Nadiia - Linux - 20.6.4\n(current)"
def test_stat_table_comment_scenario2(browser, login, logout): """Check that Statistics table contains comments with appropriate text""" 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_nth_case(4) cases_page.click_statistics_option() cases_page.move_mouse_on_element(locators.CasesPageLocators.STATTABLE_RESULT) assert cases_page.visible_element_get_text(locators.CasesPageLocators.COMMENT)
def test_cases_assign_option_scenario3(browser, login, logout): """"Verify re-assignment tester for 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.click_mb3_first_case() cases_page.move_mouse_on_element(locators.CasesPageLocators.ASSIGN_OPT_LNK) assignment_tester = cases_page.visible_element_get_text(locators.CasesPageLocators.ASSIGN_TO_1ST_USER) cases_page.visible_element_click(locators.CasesPageLocators.ASSIGN_TO_1ST_USER) first_case_tester = cases_page.get_nth_case_tester_name(1) assert assignment_tester == first_case_tester # defect: unable to change tester