Beispiel #1
0
def test_upload_cluster_bundle_from_another_page(
        page: BundleListPage, app_fs: ADCMTest,
        create_bundle_archives: List[str]):
    """Upload bundle from cluster list and check it is presented in table"""
    expected_info = BundleInfo(name='test_cluster',
                               version='1.5',
                               edition='community',
                               description='community description')
    _check_bundle_list_is_empty(page)
    with allure.step('Create bundle from cluster creation popup'):
        cluster_page = ClusterListPage(app_fs.driver, app_fs.adcm.url).open()
        cluster_page.upload_bundle_from_cluster_create_popup(
            create_bundle_archives[0])
    _open_bundle_list_and_check_info(page, expected_info)
Beispiel #2
0
    def test_acknowledge_running_job_in_header_popup(self, app_fs):
        """Run action and click acknowledge in header popup while it runs"""
        cluster_page = ClusterListPage(app_fs.driver, app_fs.adcm.url).open()
        with allure.step('Run action in cluster'):
            row = cluster_page.table.get_all_rows()[0]
            cluster_page.run_action_in_cluster_row(row,
                                                   LONG_ACTION_DISPLAY_NAME)
        cluster_page.header.click_job_block_in_header()
        cluster_page.header.click_acknowledge_btn_in_job_popup()

        cluster_page.header.wait_success_job_amount_from_header(1)
        assert cluster_page.header.get_in_progress_job_amount_from_header(
        ) == "0", "In progress job amount should be 0"
        assert cluster_page.header.get_failed_job_amount_from_header(
        ) == "0", "Failed job amount should be 0"
    def test_header_tabs_for_authorised_user(self, app_fs):
        """Test header buttons for authorised user"""
        header = PageHeader(app_fs.driver, app_fs.adcm.url)

        header.click_arenadata_logo_in_header()
        intro_page = AdminIntroPage(app_fs.driver, app_fs.adcm.url)
        header.wait_url_contains_path(intro_page.path)

        header.click_clusters_tab_in_header()
        cluster_page = ClusterListPage(app_fs.driver, app_fs.adcm.url)
        header.wait_url_contains_path(cluster_page.path)

        header.click_hostproviders_tab_in_header()
        provider_page = ProviderListPage(app_fs.driver, app_fs.adcm.url)
        header.wait_url_contains_path(provider_page.path)

        header.click_hosts_tab_in_header()
        host_page = HostListPage(app_fs.driver, app_fs.adcm.url)
        header.wait_url_contains_path(host_page.path)

        header.click_jobs_tab_in_header()
        job_page = JobListPage(app_fs.driver, app_fs.adcm.url)
        header.wait_url_contains_path(job_page.path)

        header.click_bundles_tab_in_header()
        bundle_page = BundleListPage(app_fs.driver, app_fs.adcm.url)
        header.wait_url_contains_path(bundle_page.path)

        header.click_job_block_in_header()
        job_page = JobListPage(app_fs.driver, app_fs.adcm.url)
        header.wait_url_contains_path(job_page.path)
        header.check_job_popup()
Beispiel #4
0
def open_different_tabs(page: AdminIntroPage):
    """Open different tabs (cluster list, bundle list, profile page)"""
    page.header.click_clusters_tab_in_header()
    ClusterListPage(page.driver, page.base_url).wait_page_is_opened()
    page.header.click_bundles_tab_in_header()
    BundleListPage(page.driver, page.base_url).wait_page_is_opened()
    page.header.open_profile()
    ProfilePage(page.driver, page.base_url).wait_page_is_opened()
Beispiel #5
0
    def test_link_to_jobs_in_header_popup(self, app_fs, job_link, job_filter):
        """Link to /task from popup with filter"""

        cluster_page = ClusterListPage(app_fs.driver, app_fs.adcm.url).open()
        cluster_page.header.click_job_block_in_header()
        open_filter = getattr(cluster_page.header, job_link)
        open_filter()
        job_page = JobListPage(app_fs.driver, app_fs.adcm.url)
        job_page.wait_page_is_opened()
        assert job_page.get_selected_filter(
        ) == job_filter, f"Jobs should be filtered by {job_filter}"
 def test_check_back_button_in_browser_for_header_links(
         self, app_fs, sdk_client_fs):
     """Test browser back button after following header links"""
     add_dummy_objects_to_adcm(sdk_client_fs)
     with allure.step("Check back button for cluster page header link"):
         intro_page = AdminIntroPage(app_fs.driver, app_fs.adcm.url)
         intro_page.header.click_clusters_tab_in_header()
         cluster_page = ClusterListPage(app_fs.driver, app_fs.adcm.url)
         cluster_page.wait_page_is_opened()
         cluster_page.click_back_button_in_browser()
         intro_page.wait_page_is_opened()
     with allure.step(
             "Check back button for hostprovider page header link"):
         cluster_page.open()
         cluster_page.header.click_hostproviders_tab_in_header()
         hostprovider_page = ProviderListPage(app_fs.driver,
                                              app_fs.adcm.url)
         hostprovider_page.wait_page_is_opened()
         hostprovider_page.click_back_button_in_browser()
         cluster_page.wait_page_is_opened()
     with allure.step("Check back button for hosts page header link"):
         hostprovider_page.open()
         hostprovider_page.header.click_hosts_tab_in_header()
         hosts_page = HostListPage(app_fs.driver, app_fs.adcm.url)
         hosts_page.wait_page_is_opened()
         hosts_page.click_back_button_in_browser()
         hostprovider_page.wait_page_is_opened()
     with allure.step("Check back button for jobs page header link"):
         hosts_page.open()
         hosts_page.header.click_jobs_tab_in_header()
         jobs_page = JobListPage(app_fs.driver, app_fs.adcm.url)
         jobs_page.wait_page_is_opened()
         jobs_page.click_back_button_in_browser()
         hosts_page.wait_page_is_opened()
     with allure.step("Check back button for bundles page header link"):
         jobs_page.open()
         jobs_page.header.click_bundles_tab_in_header()
         bundles_page = BundleListPage(app_fs.driver, app_fs.adcm.url)
         bundles_page.wait_page_is_opened()
         bundles_page.click_back_button_in_browser()
         jobs_page.wait_page_is_opened()
Beispiel #7
0
    def test_job_has_correct_info_in_header_popup(self, job_info: dict,
                                                  cluster: Cluster, app_fs):
        """Run action that finishes (success/failed) and check it in header popup"""

        cluster_page = ClusterListPage(app_fs.driver, app_fs.adcm.url).open()
        cluster_page.wait_config_loaded()

        for action_name, expected_status in job_info['action_name'].items():
            if action_name == LONG_ACTION_DISPLAY_NAME:
                cluster.action(display_name=action_name).run()
            else:
                run_cluster_action_and_assert_result(
                    cluster,
                    cluster.action(display_name=action_name).name,
                    status=expected_status)
        cluster_page.header.click_job_block_in_header()
        assert (cluster_page.header.get_success_job_amount_from_header() ==
                job_info['success_jobs']
                ), f"Success job amount should be {job_info['success_jobs']}"
        assert (
            cluster_page.header.get_in_progress_job_amount_from_header() ==
            job_info['in_progress_job_jobs']
        ), f"In progress job amount should be {job_info['in_progress_job_jobs']}"
        assert (cluster_page.header.get_failed_job_amount_from_header() ==
                job_info['failed_jobs']
                ), f"Failed job amount should be {job_info['failed_jobs']}"

        def _wait_for_background():
            assert job_info['background'] in (
                circle_color := cluster_page.header.get_jobs_circle_color()
            ), f"Bell circle should be colored, but actual color was: {circle_color}"

        with allure.step('Check that "bell" color is correct'):
            wait_until_step_succeeds(_wait_for_background,
                                     period=0.3,
                                     timeout=10)
Beispiel #8
0
    def test_six_tasks_in_header_popup(self, cluster: Cluster, app_fs):
        """Check list of tasks in header popup"""
        cluster_page = ClusterListPage(app_fs.driver, app_fs.adcm.url).open()
        with allure.step('Run actions in cluster'):
            for _ in range(6):
                run_cluster_action_and_assert_result(
                    cluster,
                    cluster.action(
                        display_name=SUCCESS_ACTION_DISPLAY_NAME).name,
                    status='success')
        cluster_page.header.click_job_block_in_header()
        with allure.step("Check that in popup 5 tasks"):
            assert len(cluster_page.header.get_job_rows_from_popup()
                       ) == 5, "Popup should contain 5 tasks"
        cluster_page.header.click_all_link_in_job_popup()

        job_page = JobListPage(app_fs.driver, app_fs.adcm.url)
        job_page.wait_page_is_opened()
        with allure.step("Check that in job list page 6 tasks"):
            assert job_page.table.row_count == 6, "Job list page should contain 6 tasks"