示例#1
0
def test_accept_license_with_two_bundles_upload_at_once(
        create_bundle_archives: List[str], page: BundleListPage):
    """Upload two bundles and accept license"""
    with page.table.wait_rows_change():
        page.upload_bundles(create_bundle_archives)
    with catch_failed(ElementClickInterceptedException,
                      "License was not accepted by single button click"):
        page.accept_licence(row_num=1)
示例#2
0
def test_two_bundles(create_bundle_archives: List[str], page: BundleListPage):
    """Upload two bundles"""
    with allure.step('Upload 1st bundle'), page.table.wait_rows_change():
        page.upload_bundle(create_bundle_archives[0])
    with allure.step('Upload 2nd bundle'), page.table.wait_rows_change():
        page.upload_bundle(create_bundle_archives[1])
    with allure.step('Check there are exactly 2 rows'):
        rows = page.table.row_count
        assert rows == 2, f'Row amount should be 2, but only {rows} is presented'
示例#3
0
def test_delete_bundle(create_bundle_archives: List[str],
                       page: BundleListPage):
    """Upload bundle and delete it"""
    with allure.step('Upload bundle'):
        page.upload_bundle(create_bundle_archives[0])
        assert page.table.row_count == 1, 'One bundle should be uploaded'
    with allure.step('Delete bundle'):
        page.delete_bundle()
        assert page.table.row_count == 0, 'No bundle should be listed in the table'
示例#4
0
def test_open_bundle_from_table(page: BundleListPage,
                                upload_bundles: List[Bundle]):
    """Test open bundle object page from list of bundles"""
    with allure.step('Open bundle object page from bundle list'):
        page.click_bundle_in_row(page.table.get_row())
    with allure.step('Check object page is opened'):
        object_page = BundlePage(page.driver, page.base_url,
                                 upload_bundles[0].id)
        object_page.wait_page_is_opened()
        object_page.check_bundle_toolbar(CLUSTER_CE_CONFIG[0]["name"].upper())
示例#5
0
def test_ce_bundle_upload(create_bundle_archives: List[str],
                          page: BundleListPage):
    """Upload community bundle"""
    bundle_params = BundleInfo(name="test_cluster",
                               version="1.5",
                               edition="community",
                               description="community description")
    page.upload_bundle(create_bundle_archives[0])
    bundle_info = page.get_bundle_info()
    check_bundle_info_is_equal(bundle_info, bundle_params)
示例#6
0
def _open_bundle_list_and_check_info(page: BundleListPage,
                                     expected_info: BundleInfo):
    """
    Open bundle list page, check that exactly 1 row is presented and check it's info
    """
    page.open()
    assert (
        row_count := page.table.row_count
    ) == 1, f'Bundle list should have exactly 1 record, but {row_count} was found'
    bundle_info = page.get_bundle_info()
    check_bundle_info_is_equal(bundle_info, expected_info)
示例#7
0
def test_ee_bundle_upload(create_bundle_archives: List[str],
                          page: BundleListPage):
    """Upload enterprise bundle and accept licence"""
    bundle_params = BundleInfo(
        name='test_cluster',
        version='1.5',
        edition='enterprise',
        description='enterprise description',
    )
    page.upload_bundle(create_bundle_archives[0])
    page.accept_licence()
    bundle_info = page.get_bundle_info()
    check_bundle_info_is_equal(bundle_info, bundle_params)
示例#8
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()
示例#9
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()
示例#10
0
 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()
示例#11
0
def page(app_fs: ADCMTest, login_to_adcm_over_api) -> BundleListPage:
    """Get BundleListPage after authorization"""
    return BundleListPage(app_fs.driver, app_fs.adcm.url).open()
示例#12
0
def test_bundle_list_pagination(page: BundleListPage):
    """Upload 12 bundles and check pagination"""
    params = {'on_first_page': 10, 'on_second_page': 2}
    page.close_info_popup()
    page.table.check_pagination(params['on_second_page'])
示例#13
0
def test_delete_bundle_with_created_cluster(page: BundleListPage):
    """
    Bundle should not be deleted if an object defined in it is created
    """
    page.delete_bundle()
    page.check_at_least_one_bundle_is_presented()
示例#14
0
def test_open_adcm_main_menu(page: BundleListPage):
    """Open main menu by clicking on the menu icon in toolbar"""
    page.click_on_home_button_on_toolbar()
    AdminIntroPage(page.driver, page.base_url).wait_page_is_opened()