def test_open_by_tab_main_component_page(self, app_fs, create_cluster_with_service): """Test open /cluster/{}/service/{}/component/{}/main page from left menu""" cluster, service = create_cluster_with_service component = service.component(name=FIRST_COMPONENT_NAME) component_config_page = ComponentConfigPage( app_fs.driver, app_fs.adcm.url, cluster.id, service.id, component.id ).open() component_main_page = component_config_page.open_main_tab() component_main_page.check_all_elements() component_main_page.check_component_toolbar(CLUSTER_NAME, SERVICE_NAME, FIRST_COMPONENT_NAME)
def test_open_by_toolbar_main_component_page(self, app_fs, create_cluster_with_service): """Test open /cluster/{}/service/{}/component/{}/main page from toolbar""" cluster, service = create_cluster_with_service component = service.component(name=FIRST_COMPONENT_NAME) component_config_page = ComponentConfigPage( app_fs.driver, app_fs.adcm.url, cluster.id, service.id, component.id ).open() component_config_page.click_link_by_name(FIRST_COMPONENT_NAME) component_main_page = ComponentMainPage(app_fs.driver, app_fs.adcm.url, cluster.id, service.id, component.id) component_main_page.wait_page_is_opened() component_main_page.check_component_toolbar(CLUSTER_NAME, SERVICE_NAME, FIRST_COMPONENT_NAME)
def test_filter_config_on_component_config_page(self, app_fs, create_cluster_with_service): """Test config filtration on /cluster/{}/service/{}/component/{}/config page""" params = {"search_param": "str_param", "group_name": "core-site"} cluster, service = create_cluster_with_service component = service.component(name=FIRST_COMPONENT_NAME) component_config_page = ComponentConfigPage( app_fs.driver, app_fs.adcm.url, cluster.id, service.id, component.id ).open() with component_config_page.config.wait_rows_change(): component_config_page.config.search(params["search_param"]) with allure.step(f"Check that rows are filtered by {params['search_param']}"): config_rows = component_config_page.config.get_all_config_rows() assert len(config_rows) == 1, "Rows are not filtered: there should be 1 row" assert ( component_config_page.config.get_config_row_info(config_rows[0]).name == f"{params['search_param']}:" ), f"Name should be {params['search_param']}" with component_config_page.config.wait_rows_change(): component_config_page.config.clear_search_input() with allure.step("Check that rows are not filtered"): config_rows = component_config_page.config.get_all_config_rows() assert len(config_rows) == 5, "Rows are filtered: there should be 4 row and 1 config group" with component_config_page.config.wait_rows_change(expected_rows_amount=3): component_config_page.config.click_on_group(params["group_name"])
def test_field_tooltips_on_component_config_page(self, app_fs, create_cluster_with_service, create_bundle_archives): """Test config fields tooltips on /cluster/{}/service/{}/component/{}/config page""" cluster, service = create_cluster_with_service component = service.component(name=FIRST_COMPONENT_NAME) component_config_page = ComponentConfigPage( app_fs.driver, app_fs.adcm.url, cluster.id, service.id, component.id ).open() for item in CONFIG_ITEMS: component_config_page.config.check_text_in_tooltip(item, f"Test description {item}")
def test_save_custom_config_on_component_config_page( self, app_fs, create_cluster_with_service, create_bundle_archives ): """Test config save on /cluster/{}/service/{}/component/{}/config page""" params = { "config_name_new": "test_name", "config_name_old": "init", } cluster, service = create_cluster_with_service component = service.component(name=FIRST_COMPONENT_NAME) component_config_page = ComponentConfigPage( app_fs.driver, app_fs.adcm.url, cluster.id, service.id, component.id ).open() component_config_page.config.fill_config_fields_with_test_values() component_config_page.config.set_description(params["config_name_new"]) component_config_page.config.save_config() component_config_page.config.compare_versions(params["config_name_old"]) component_config_page.config.check_config_fields_history_with_test_values()
def test_field_validation_on_component_config_page_with_default_value( self, app_fs, create_cluster_with_service, create_bundle_archives ): """Test config fields validation on /cluster/{}/service/{}/component/{}/config page""" params = {'field_name': 'string', 'new_value': 'test', "config_name": "test_name"} cluster, service = create_cluster_with_service component = service.component(name=FIRST_COMPONENT_NAME) component_config_page = ComponentConfigPage( app_fs.driver, app_fs.adcm.url, cluster.id, service.id, component.id ).open() component_config_page.config.clear_field_by_keys(params['field_name']) component_config_page.config.check_field_is_required(params['field_name']) component_config_page.config.type_in_field_with_few_inputs( row=component_config_page.config.get_all_config_rows()[0], values=[params['new_value']] ) component_config_page.config.save_config() component_config_page.config.assert_input_value_is( expected_value=params["new_value"], display_name=params["field_name"] )
def test_reset_config_in_row_on_component_config_page(self, app_fs, create_cluster_with_service): """Test config reset on /cluster/{}/service/{}/component/{}/config page""" params = {"row_name": "str_param", "row_value_new": "test", "row_value_old": "123", "config_name": "test_name"} cluster, service = create_cluster_with_service component = service.component(name=FIRST_COMPONENT_NAME) component_config_page = ComponentConfigPage( app_fs.driver, app_fs.adcm.url, cluster.id, service.id, component.id ).open() config_row = component_config_page.config.get_all_config_rows()[0] component_config_page.config.type_in_field_with_few_inputs( row=config_row, values=[params["row_value_new"]], clear=True ) component_config_page.config.set_description(params["config_name"]) component_config_page.config.save_config() config_row = component_config_page.config.get_all_config_rows()[0] component_config_page.config.reset_to_default(row=config_row) component_config_page.config.assert_input_value_is( expected_value=params["row_value_old"], display_name=params["row_name"] )
def test_field_validation_on_component_config_page( self, app_fs, create_cluster_with_service, create_bundle_archives ): """Test config fields validation on /cluster/{}/service/{}/component/{}/config page""" params = { 'pass_name': 'Important password', 'req_name': 'Required item', 'not_req_name': 'Just item', 'wrong_value': 'test', } cluster, service = create_cluster_with_service component = service.component(name=FIRST_COMPONENT_NAME) component_config_page = ComponentConfigPage( app_fs.driver, app_fs.adcm.url, cluster.id, service.id, component.id ).open() component_config_page.config.check_password_confirm_required(params['pass_name']) component_config_page.config.check_field_is_required(params['req_name']) config_row = component_config_page.config.get_all_config_rows()[0] component_config_page.config.type_in_field_with_few_inputs(row=config_row, values=[params['wrong_value']]) component_config_page.config.check_field_is_invalid(params['not_req_name']) component_config_page.config.check_config_warn_icon_on_left_menu() component_config_page.toolbar.check_warn_button( tab_name=FIRST_COMPONENT_NAME, expected_warn_text=[f'{FIRST_COMPONENT_NAME} has an issue with its config'] )