Example #1
0
    def test_open_service_main_page_by_tab(self, app_fs, create_cluster_with_service):
        """Test open /cluster/{}/service/{}/main page from left menu"""

        cluster, service = create_cluster_with_service
        service_config_page = ServiceConfigPage(app_fs.driver, app_fs.adcm.url, cluster.id, service.id).open()
        service_main_page = service_config_page.open_main_tab()
        service_main_page.check_all_elements()
        service_main_page.check_service_toolbar(CLUSTER_NAME, SERVICE_NAME)
Example #2
0
    def test_save_configuration_hell_on_service_config_page(self, app_fs, sdk_client_fs):
        """
        UI test for super large config
        Scenario:
        1. Get Service configuration
        2. Get display names from UI
        3. Check that config name in prototype is correct
        4. Check that in UI we have full list of display names from prototype
        5. Fill required fields and try to save
        """

        required_fields = {
            'integer not default required:': (['2']),
            'float not default required:': (['2.2']),
            'string not default required:': (['Ein neuer Tag beginnt']),
            'password not default required no confirm:': (['strongestpasswordever']),
            'text not default required:': (['This is\nthe day']),
            'file not default required:': (['My only\nfriend']),
            'json not default required:': (['{"Where": "the long shadow falls"}']),
            'list not default required:': (['Silencer']),
            'map not default required:': (['Poccolus', 'Ragana', 'Poccolus', 'Ragana']),
        }
        with allure.step("Create cluster and service"):
            bundle = cluster_bundle(sdk_client_fs, "config_hell_service")
            cluster = bundle.cluster_create(name=CLUSTER_NAME)
            service = cluster.service_add(name='service_ui_config_hell')
        service_config_page = ServiceConfigPage(app_fs.driver, app_fs.adcm.url, cluster.id, service.id).open()
        with allure.step('Check that config name in prototype is correct'):
            assert service.display_name == 'New UI Config Hell'
        with allure.step('Check that in UI we have full list of group display names from prototype'):
            parameters_display_names = {config['display_name'] for config in service.prototype().config}
            group_names = filter(
                lambda name: 'group' in name
                and ('invisible' not in name or 'not invisible' in name)
                and ('advanced' not in name or 'not advanced' in name),
                parameters_display_names,
            )
            ui_display_names = service_config_page.config.get_all_config_rows_names()
            config_group_names = [n.text for n in service_config_page.config.get_group_names()]
            for display_name in group_names:
                assert (
                    display_name in ui_display_names or display_name in config_group_names
                ), f"Config named '{display_name}' should be presented in config"
        with allure.step('Fill required fields'):
            for param_display_name, value in required_fields.items():
                row = service_config_page.config.get_config_row(param_display_name)
                service_config_page.config.type_in_field_with_few_inputs(row=row, values=value)
        service_config_page.config.save_config(load_timeout=40)
        with allure.step('Ensure page is still opened'):
            service_config_page.wait_page_is_opened(timeout=1)
        with allure.step('Check that popup is not presented on page'):
            assert not service_config_page.is_popup_presented_on_page(), 'No popup should be shown after save'
Example #3
0
    def test_field_validation_on_service_config_page(self, app_fs, sdk_client_fs):
        """Test config fields validation on /cluster/{}/service/{}/config page"""

        params = {
            'pass_name': 'Important password',
            'req_name': 'Required item',
            'not_req_name': 'Just item',
            'wrong_value': 'test',
        }

        with allure.step("Create cluster and service"):
            bundle = cluster_bundle(sdk_client_fs, BUNDLE_REQUIRED_FIELDS)
            cluster = bundle.cluster_create(name=CLUSTER_NAME)
            service = cluster.service_add(name=SERVICE_NAME)
        service_config_page = ServiceConfigPage(app_fs.driver, app_fs.adcm.url, cluster.id, service.id).open()
        service_config_page.config.check_password_confirm_required(params['pass_name'])
        service_config_page.config.check_field_is_required(params['req_name'])
        config_row = service_config_page.config.get_all_config_rows()[0]
        service_config_page.config.type_in_field_with_few_inputs(row=config_row, values=[params['wrong_value']])
        service_config_page.config.check_field_is_invalid(params['not_req_name'])
        service_config_page.config.check_config_warn_icon_on_left_menu()
        service_config_page.toolbar.check_warn_button(
            tab_name="test_service",
            expected_warn_text=[
                'Test cluster has an issue with its config',
                'test_service has an issue with its config',
            ],
        )
Example #4
0
    def test_field_tooltips_on_service_config_page(self, app_fs, sdk_client_fs):
        """Test config fields tooltips on /cluster/{}/service/{}/config page"""

        with allure.step("Create cluster and service"):
            bundle = cluster_bundle(sdk_client_fs, BUNDLE_WITH_DESCRIPTION_FIELDS)
            cluster = bundle.cluster_create(name=CLUSTER_NAME)
            service = cluster.service_add(name=SERVICE_NAME)
        service_config_page = ServiceConfigPage(app_fs.driver, app_fs.adcm.url, cluster.id, service.id).open()
        for item in CONFIG_ITEMS:
            service_config_page.config.check_text_in_tooltip(item, f"Test description {item}")
Example #5
0
    def test_save_custom_config_on_service_config_page(self, app_fs, sdk_client_fs):
        """Test config save on /cluster/{}/service/{}/config page"""

        params = {
            "config_name_new": "test_name",
            "config_name_old": "init",
        }
        with allure.step("Create cluster and service"):
            bundle = cluster_bundle(sdk_client_fs, BUNDLE_WITH_DESCRIPTION_FIELDS)
            cluster = bundle.cluster_create(name=CLUSTER_NAME)
            service = cluster.service_add(name=SERVICE_NAME)
        service_config_page = ServiceConfigPage(app_fs.driver, app_fs.adcm.url, cluster.id, service.id).open()
        service_config_page.config.fill_config_fields_with_test_values()
        service_config_page.config.set_description(params["config_name_new"])
        service_config_page.config.save_config()
        service_config_page.config.compare_versions(params["config_name_old"])
        service_config_page.config.check_config_fields_history_with_test_values()
Example #6
0
    def test_field_validation_on_service_config_page_with_default_value(self, app_fs, sdk_client_fs):
        """Test config fields validation on /cluster/{}/service/{}/config page"""

        params = {'field_name': 'string', 'new_value': 'test', "config_name": "test_name"}

        with allure.step("Create cluster and service"):
            bundle = cluster_bundle(sdk_client_fs, BUNDLE_DEFAULT_FIELDS)
            cluster = bundle.cluster_create(name=CLUSTER_NAME)
            service = cluster.service_add(name=SERVICE_NAME)
        service_config_page = ServiceConfigPage(app_fs.driver, app_fs.adcm.url, cluster.id, service.id).open()
        service_config_page.config.clear_field_by_keys(params['field_name'])
        service_config_page.config.check_field_is_required(params['field_name'])
        service_config_page.config.type_in_field_with_few_inputs(
            row=service_config_page.config.get_all_config_rows()[0], values=[params['new_value']]
        )
        service_config_page.config.save_config()
        service_config_page.config.assert_input_value_is(
            expected_value=params["new_value"], display_name=params["field_name"]
        )
Example #7
0
    def test_reset_config_in_row_on_service_config_page(self, app_fs, create_cluster_with_service):
        """Test config reset on /cluster/{}/service/{}/config page"""

        params = {"row_name": "param1", "row_value_new": "test", "row_value_old": "", "config_name": "test_name"}

        cluster, service = create_cluster_with_service
        service_config_page = ServiceConfigPage(app_fs.driver, app_fs.adcm.url, cluster.id, service.id).open()
        config_row = service_config_page.config.get_all_config_rows()[0]
        service_config_page.config.type_in_field_with_few_inputs(
            row=config_row, values=[params["row_value_new"]], clear=True
        )
        service_config_page.config.set_description(params["config_name"])
        service_config_page.config.save_config()

        config_row = service_config_page.config.get_all_config_rows()[0]
        service_config_page.config.reset_to_default(row=config_row)
        service_config_page.config.assert_input_value_is(
            expected_value=params["row_value_old"], display_name=params["row_name"]
        )
Example #8
0
    def test_filter_config_on_service_config_page(self, app_fs, create_cluster_with_service):
        """Test config filtration on /cluster/{}/service/{}/config page"""

        params = {"search_param": "param1", "group_name": "core-site"}

        cluster, service = create_cluster_with_service
        service_config_page = ServiceConfigPage(app_fs.driver, app_fs.adcm.url, cluster.id, service.id).open()
        with service_config_page.config.wait_rows_change():
            service_config_page.config.search(params["search_param"])
        with allure.step(f"Check that rows are filtered by {params['search_param']}"):
            config_rows = service_config_page.config.get_all_config_rows()
            assert len(config_rows) == 2, "Rows are not filtered: there should be 1 group row and 1 sub group row"
            assert (
                service_config_page.config.get_config_row_info(config_rows[0]).name == f"{params['search_param']}:"
            ), f"Name should be {params['search_param']}"
        with service_config_page.config.wait_rows_change():
            service_config_page.config.clear_search_input()
        with allure.step("Check that rows are not filtered"):
            config_rows = service_config_page.config.get_all_config_rows()
            assert len(config_rows) == 3, "Rows are filtered: there should be 1 group row and 2 sub group rows"
        with service_config_page.config.wait_rows_change(expected_rows_amount=0):
            service_config_page.config.click_on_group(params["group_name"])