def test_del_phase(self, fixture_driver): login_page = LoginPageObject(fixture_driver) login_page.login(settings.LOGIN, settings.PASSWORD) list_estimate_page = ListEstimatePageObject(fixture_driver) list_estimate_page.click_first_estimate() detail_estimate_page = DetailEstimatePageObject(fixture_driver) detail_estimate_page.click_add_phase_button() detail_estimate_page.send_custom_name_phase(settings.CUSTOM_NAME_PHASE) detail_estimate_page.confirm_add_phase() detail_phase_page = DetailPhasePageObject(fixture_driver) detail_phase_page.click_edit_phase_button() assert detail_phase_page.get_del_phase_button() del_phase_button = detail_phase_page.get_del_phase_button() detail_phase_page.hover_to(del_phase_button) assert detail_phase_page.get_tooltip_del_phase() detail_phase_page.del_phase(0) assert detail_phase_page.get_del_phase_window() assert detail_phase_page.get_del_phase_cancel_button() assert detail_phase_page.get_del_phase_confirm_button() detail_phase_page.click_del_phase_confirm_button() assert not detail_estimate_page.check_added_phase() detail_phase_page.click_save_edit_phase_button() assert not detail_phase_page.get_attribute_display_from_save_edit_phase_button( ) assert detail_estimate_page.check_add_phase_button()
def test_fail(self, fixture_driver): login_page = LoginPageObject(fixture_driver) login_page.login("test_login", "") param_url = login_page.get_url() assert str(param_url) == URL + "estimates"
def test_add_description_task(self, fixture_driver): login_page = LoginPageObject(fixture_driver) login_page.login(settings.LOGIN, settings.PASSWORD) list_estimate_page = ListEstimatePageObject(fixture_driver) list_estimate_page.click_first_estimate() detail_estimate_page = DetailEstimatePageObject(fixture_driver) detail_estimate_page.click_add_phase_button() detail_estimate_page.send_custom_name_phase(settings.CUSTOM_NAME_PHASE) detail_estimate_page.confirm_add_phase() detail_phase_page = DetailPhasePageObject(fixture_driver) detail_phase_page.open_add_task_window() detail_phase_page.add_custom_task(settings.CUSTOM_NAME_TASK) detail_phase_page.click_description_feature_or_task(0) assert detail_phase_page.get_description_feature_or_task_input_count() description_task_text = detail_phase_page.enter_description_feature_or_task( settings.DESCRIPTION_TASK) detail_phase_page.click_description_feature_or_task(0) assert not detail_phase_page.get_description_feature_or_task_input_count( ) detail_phase_page.click_description_feature_or_task(0) assert detail_phase_page.get_description_feature_or_task_input_count() current_description_task_text = detail_phase_page.get_current_description_feature_or_task_input_text( ) assert description_task_text == current_description_task_text
def test_add_phase_for_estimate(self, fixture_driver): login_page = LoginPageObject(fixture_driver) login_page.login(settings.LOGIN, settings.PASSWORD) list_estimate_page = ListEstimatePageObject(fixture_driver) list_estimate_page.click_first_estimate() detail_estimate_page = DetailEstimatePageObject(fixture_driver) detail_estimate_page.click_add_phase_button() add_phase = detail_estimate_page.select_phase_buttons() assert detail_estimate_page.phase_window_is_present() detail_estimate_page.confirm_add_phase() current_added_phase = detail_estimate_page.get_text_added_phase() assert add_phase.lower() == current_added_phase.lower()
def test_add_task_for_phase(self, fixture_driver): login_page = LoginPageObject(fixture_driver) login_page.login(settings.LOGIN, settings.PASSWORD) list_estimate_page = ListEstimatePageObject(fixture_driver) list_estimate_page.click_first_estimate() detail_estimate_page = DetailEstimatePageObject(fixture_driver) detail_estimate_page.click_add_phase_button() detail_estimate_page.send_custom_name_phase(settings.CUSTOM_NAME_PHASE) detail_estimate_page.confirm_add_phase() detail_phase_page = DetailPhasePageObject(fixture_driver) detail_phase_page.open_add_task_window() assert detail_phase_page.check_feature_or_task_window() name_task = detail_phase_page.add_task(0) assert detail_phase_page.search_task(name_task)
def test_add_feature_for_phase(self, fixture_driver): login_page = LoginPageObject(fixture_driver) login_page.login(settings.LOGIN, settings.PASSWORD) list_estimate_page = ListEstimatePageObject(fixture_driver) list_estimate_page.click_first_estimate() detail_estimate_page = DetailEstimatePageObject(fixture_driver) detail_estimate_page.click_add_phase_button() detail_estimate_page.select_phase_buttons() assert detail_estimate_page.phase_window_is_present() detail_estimate_page.confirm_add_phase() detail_phase_page = DetailPhasePageObject(fixture_driver) detail_phase_page.open_add_feature_window() assert detail_phase_page.check_feature_or_task_window() name_feature = detail_phase_page.add_feature(0) assert detail_phase_page.search_feature(name_feature)
def test_add_max_time_for_task(self, fixture_driver): login_page = LoginPageObject(fixture_driver) login_page.login(settings.LOGIN, settings.PASSWORD) list_estimate_page = ListEstimatePageObject(fixture_driver) list_estimate_page.click_first_estimate() detail_estimate_page = DetailEstimatePageObject(fixture_driver) detail_estimate_page.click_add_phase_button() detail_estimate_page.send_custom_name_phase(settings.CUSTOM_NAME_PHASE) detail_estimate_page.confirm_add_phase() detail_phase_page = DetailPhasePageObject(fixture_driver) detail_phase_page.open_add_task_window() detail_phase_page.add_custom_task(settings.CUSTOM_NAME_TASK) max_time = detail_phase_page.input_max_time(10) assert float(detail_phase_page.get_current_max_time()) == max_time total_max_time = detail_phase_page.get_total_max_time_phase() assert float(max_time) == float(total_max_time)
def test_login_with_blank_data(self, fixture_driver): login_page = LoginPageObject(fixture_driver) assert login_page.login("", "") == login_page.get_data_input_value() assert login_page.button_login_is_present() param_url = login_page.get_url() assert str(param_url) == URL + "login"
def test_create_estimate(self): LoginPageObject(self._driver).login(settings.LOGIN, settings.PASSWORD) new_estimate_page = NewEstimatePageObject(self._driver) new_estimate_page.open_form() assert "edit" in new_estimate_page.get_url() new_estimate_page.create_estimate( settings.NAME_CLIENT, settings.NAME_PROJECT, settings.NAME_EXPERT, settings.DESCRIPTION_PROJECT) detail_estimate_page = DetailEstimatePageObject(self._driver) assert detail_estimate_page.phase_window_is_present() detail_estimate_page.close_message() assert detail_estimate_page.get_about_window() detail_estimate_page.click_bread_crumbs() list_estimate_page = ListEstimatePageObject(self._driver) assert str(list_estimate_page.get_first_estimate()) == settings.NAME_CLIENT
def test_login_with_incorrect_data(self, fixture_driver): login_page = LoginPageObject(fixture_driver) login_page.login("test", "test") assert login_page.get_color_message_error() == "#dd2c00" assert login_page.get_message_error() == "User not found"
def test_login_with_valid_data(self, fixture_driver): login_page = LoginPageObject(fixture_driver) login_page.login("test_login, "test_password") param_url = login_page.get_url() assert str(param_url) == URL + "estimates"
def test_login(self, test_login, test_password, expected_url, test_case): login_page = LoginPageObject(self._driver) login_page.login(test_login, test_password) param_url = login_page.get_url() if test_case == "test_case1": assert str(param_url) == expected_url elif test_case == "test_case2": assert login_page.get_color_message_error() == "#dd2c00" assert login_page.get_message_error() == "User not found" elif test_case == "test_case3": assert test_login, test_password == login_page.get_data_input_value( ) assert login_page.button_login_is_present() assert str(param_url) == expected_url elif test_case == "test_case4": login_input_value, password_input_value = login_page.get_data_input_value( ) assert test_login == login_input_value and test_password == password_input_value assert login_page.button_login_is_present() assert str(param_url) == expected_url