コード例 #1
0
def test_bulk_system_delete_no_secret_manually(clean_bulk_delete_systems_and_accounts, core_session, core_ui, list_of_created_systems, secret_cleaner):
    server_prefix, names_of_servers, server_ids = _make_two_servers_get_names(core_session, list_of_created_systems)

    ui = core_ui
    ui.navigate('Resources', 'Systems')
    ui.search(server_prefix)

    for name in names_of_servers:
        assert ui.check_exists(GridCell(name)), "Server not found in grid " + name

    ui.action('Delete Systems', names_of_servers)
    core_ui.switch_context(Modal('Bulk System Delete'))

    core_ui.uncheck("SaveSecret")
    core_ui.button('Delete')

    core_ui.switch_context(ConfirmModal())
    core_ui.button('Yes')

    core_ui.switch_context(NoTitleModal())
    core_ui.button('Close')

    ResourceManager.wait_for_systems_to_delete_or_timeout(core_session, server_ids)

    assert len(ResourceManager.get_multi_added_account_ids(core_session, server_ids)) == 0, "All added accounts not removed"
    assert len(ResourceManager.get_multi_added_system_ids(core_session, server_ids)) == 0, "All added systems not removed"
コード例 #2
0
def test_bulk_account_deletes_with_ui_no_secret(
        clean_bulk_delete_systems_and_accounts, core_session, core_admin_ui,
        list_of_created_systems):
    server_prefix, account_prefix, all_systems, all_accounts, all_account_names = _make_four_accounts_get_names(
        core_session, list_of_created_systems, ssh=True)

    ui = core_admin_ui
    ui.navigate('Resources', 'Accounts')
    ui.search(server_prefix)

    for name in all_account_names:
        assert ui.check_exists(
            GridCell(name)), f"Account name {name} not found in grid"

    ui.action('Delete accounts', all_account_names)
    ui.switch_context(Modal('Bulk Account Delete'))
    ui.uncheck("SaveSecret")
    ui.button('Delete')
    ui.switch_context(ConfirmModal())
    ui.button('Yes')
    ui.switch_context(InfoModal())
    ui.button('Close')

    ResourceManager.wait_for_accounts_to_delete_or_timeout(
        core_session, all_systems, all_accounts)

    assert len(
        ResourceManager.get_multi_added_account_ids(
            core_session, all_systems)) == 0, "All added accounts not removed"
    assert len(
        ResourceManager.get_multi_added_system_ids(
            core_session,
            all_systems)) == 2, "Wrong number of added systems remain"
コード例 #3
0
def test_move_report_to_same_dir(core_admin_ui, core_session, create_report,
                                 create_resources):
    my_report = create_report(core_session, "Select Name From Server")
    core_admin_ui.navigate('Reports')
    core_admin_ui.action('Move', my_report['Name'])
    move_modal = Modal(f'Move: {my_report["Name"]}')
    core_admin_ui.switch_context(move_modal)
    core_admin_ui.button("Move")
    core_admin_ui.switch_context(ConfirmModal())
    core_admin_ui.close_modal("No")
    # core_admin_ui.button("Move")  #TODO: Seems that the fixture fails when moved to the same directory, seems awry
    # core_admin_ui.button("Yes")
    core_admin_ui.expect(
        GridCell(my_report['Name']),
        f"Expected to see created Report {my_report['Name']} in report")
コード例 #4
0
def test_ui_check_bulk_delete_account_scheduled(core_session, core_admin_ui,
                                                list_of_created_systems):
    """
    Test case: C3088
               :param core_session: Returns API session
               :param core_admin_ui: Centrify admin Ui session
               :param list_of_created_systems: creating a empty list of created systems.
               """
    account_name_prefix = f'account_test{guid()}'

    # adding multiple systems with accounts
    result = ResourceManager.add_multiple_systems_with_accounts(
        core_session,
        1,
        2,
        list_of_created_systems,
        user_prefix=account_name_prefix)

    # arranging the results in the lists
    all_systems, all_accounts = DataManipulation.aggregate_lists_in_dict_values(
        [result])
    ui = core_admin_ui
    ui.navigate('Resources', 'Accounts')
    account_names = []
    for account in all_accounts:
        # getting the account information
        query_result, query_success = ResourceManager.get_account_information(
            core_session, account)
        account_names.append(query_result['VaultAccount']['Row']['User'])

    ui.search(account_name_prefix)
    ui.action('Delete accounts', account_names)
    ui.switch_context(Modal('Bulk Account Delete'))
    ui.uncheck("SaveSecret")
    ui.button('Delete')
    ui.switch_context(ConfirmModal())
    ui.button('Yes')
    ui.switch_context(InfoModal())
    ui.expect(
        Div("A delete operation has been scheduled. You will receive an e-mail when the operation has been completed."
            ), "Expecting a info popup for delete schedule")
    logger.info("Popup with delete operation has been scheduled appeared")
    ui.button('Close')
    result, success = ResourceManager.del_multiple_systems(
        core_session, all_systems)
    assert success is True, 'Delete systems job failed when expected success'
    logger.info(f"Delete systems job executed successfully {result}")
コード例 #5
0
def test_ui_check_bulk_delete_account_confirm(core_session, core_admin_ui,
                                              list_of_created_systems):
    """
         Test case: C3087
               :param core_session: Returns API session
               :param core_admin_ui: Centrify admin Ui session
               :param list_of_created_systems: creating a empty list of created systems.
               """
    account_name_prefix = f'account_test{guid()}'

    # adding multiple systems with accounts
    result = ResourceManager.add_multiple_systems_with_accounts(
        core_session,
        1,
        2,
        list_of_created_systems,
        user_prefix=account_name_prefix)

    # arranging the results in the lists
    all_systems, all_accounts = DataManipulation.aggregate_lists_in_dict_values(
        [result])
    ui = core_admin_ui
    ui.navigate('Resources', 'Accounts')
    account_names = []
    for account in all_accounts:
        # getting the account information
        query_result, query_success = ResourceManager.get_account_information(
            core_session, account)
        account_names.append(query_result['VaultAccount']['Row']['User'])
    ui.search(account_name_prefix)
    ui.action('Delete accounts', account_names)
    ui.switch_context(Modal('Bulk Account Delete'))
    ui.uncheck("SaveSecret")
    ui.button('Delete')
    ui.switch_context(ConfirmModal())
    ui.expect(
        Div("You are about to delete accounts which contain passwords or SSH Keys. This cannot be undone. Are "
            "you sure you want to continue?"),
        "Expecting a confirm delete account popup")
    logger.info("Confirm delete accounts popup appeared.")
    ui.button('Yes')
    result, success = ResourceManager.del_multiple_systems(
        core_session, all_systems)
    assert success is True, 'Delete systems job failed when expected success'
    logger.info(f"Delete systems job executed successfully {result}")
コード例 #6
0
def test_delete_report_directory(core_admin_ui, core_session, create_directory,
                                 create_report):
    my_directory = create_directory(core_session, "TestDirName").split('/')[-1]
    # Does not need guid, already has one in the creation!

    my_report = create_report(core_session, "Select Name From Server")

    core_admin_ui.navigate('Reports')
    core_admin_ui.expect(
        GridCell(my_report['Name']),
        f"Expected to see created Report {my_report['Name']} in report")

    core_admin_ui.expect(TreeFolder("My Reports"),
                         "Unable to find My Reports Tab under Reports")
    shared_reports_button = core_admin_ui._searchAndExpect(
        TreeFolder("My Reports"), f'Expected find My Reports Folder in Tree')
    shared_reports_button.try_click()
    core_admin_ui.expect(TreeFolder(my_directory),
                         f"The directory {my_directory} did not show up")

    core_admin_ui.right_click_action(TreeFolder(my_directory), "Delete")
    core_admin_ui.switch_context(ConfirmModal())
    core_admin_ui.close_modal('Yes')
コード例 #7
0
def test_system_settings_Policy_page(add_single_system, core_admin_ui):
    """C2540 Settings on Policy page
       trying to get rdp through system account with in 15 minute
            Steps:
                Pre: Create system
                1. Try to update description for system
                    -Assert Failure
        """

    ui = core_admin_ui
    added_system_id, sys_info = add_single_system
    logger.info(
        f"System {sys_info[0]}, with fqdn {sys_info[1]} created successfully with Uuid {added_system_id}"
    )
    description = f'{sys_info[0]}{guid()}'
    ui.navigate('Resources', 'Systems')
    ui.search(sys_info[0])
    ui.click_row(sys_info[0])
    ui.tab('Settings')

    # Step1: Update the description and compare the description
    ui.input('Description', description)
    ui.save()
    ui.expect(TextArea('Description', description),
              description,
              time_to_wait=15)
    logger.info(f"Update description for this System : {sys_info[0]}")

    ui.switch_context(ActiveMainContentArea())
    ui.input('Description', guid())
    ui.action('Select/Request Account')
    ui.switch_context(Modal(f'{sys_info[0]} Login'))
    ui.close_modal('Cancel')

    # Step2: Update the description and check weather Unsaved Changes pop is occurred without save
    ui.switch_context(ActiveMainContentArea())
    ui.input('Description', guid())
    ui.action('Add To Set')
    ui.switch_context(ConfirmModal())
    ui.button("No")
    ui.switch_context(Modal('Add To Set'))
    ui.button('Cancel')

    # Step3: Update the description and check weather Unsaved Changes pop is occurred without save and \
    # Add to set pop will occurred
    ui.switch_context(ActiveMainContentArea())
    ui.input('Description', guid())
    ui.action('Add To Set')
    ui.switch_context(ConfirmModal())
    ui.button('Yes')

    # Step4: Add to set name in windows system set
    ui.switch_context(Modal('Add To Set'))
    member_set_name = f'test_set_{guid()}'
    ui.tag_input('tagComboInput', member_set_name)
    ui.remove_context()
    ui.close_modal('Save')

    # Step3: Update the description and check weather Unsaved Changes pop is occurred without save and \
    # Add to set pop will occurred and then cancel
    ui.switch_context(ActiveMainContentArea())
    ui.input('Description', guid())
    ui.action('Add To Set')
    ui.switch_context(ConfirmModal())
    ui.button('Cancel')
コード例 #8
0
def test_account_settings_Policy_page(core_session, pas_setup, core_admin_ui,
                                      update_tenant_remote):
    """C2543 Update Account Settings page
            Steps:
                Pre: Create system with 1 account hand
                1. Try to update description for account
                    -Assert Failure
        """
    ui = core_admin_ui
    # Disable 'Allow access from a public network' policy on Global Security Setting page
    result, success = update_tenant_remote(core_session, False)
    assert success, f"Not able to disable 'Allow access from a public network' policy on Global Security Setting " \
                    f"page. API response result: {result}. "
    logger.info(
        f"'Allow access from a public network' policy disabled on Global Security Setting page"
    )
    system_id, account_id, sys_info = pas_setup
    description = f'{sys_info[0]}{guid()}'
    logger.info(
        f"System: {sys_info[0]} successfully added with UUID: {system_id} and account: {sys_info[4]} "
        f"with UUID: {account_id} associated with it.")
    ui.navigate('Resources', 'Accounts')
    ui.search(sys_info[0])
    ui.click_row(sys_info[0])
    ui.tab('Settings')

    # Step1: Update the description and compare the description.
    ui.input('Description', description)
    ui.save()
    ui.expect(TextArea('Description', description),
              description,
              time_to_wait=15)
    logger.info(f"Update description for this account : {sys_info[4]}")

    # Step2: Update the description and check weather Unsaved Changes pop is occurred without save.
    ui.switch_context(ActiveMainContentArea())
    ui.input('Description', guid())
    ui.action('Update Password')
    ui.switch_context(ConfirmModal())
    ui.button('No')
    ui.switch_context(Modal('Update Unmanaged Password'))
    ui.button('Cancel')

    # Step3: Update the description and check weather Unsaved Changes pop is occurred without save.
    ui.switch_context(ActiveMainContentArea())
    ui.input('Description', guid())
    ui.action('Update Password')
    ui.switch_context(ConfirmModal())
    ui.button('Cancel')

    # Step3: Update the description and check weather Unsaved Changes pop is occurred without save and \
    # update unmanaged password pop will occurred.
    ui.switch_context(ActiveMainContentArea())
    ui.input('Description', guid())
    ui.action('Update Password')
    ui.switch_context(ConfirmModal())
    ui.button('Yes')
    ui.switch_context(Modal('Update Unmanaged Password'))
    ui.button('Cancel')

    # Step3: Update the description and check weather take rdp tab giving error.
    ui.switch_context(ActiveMainContentArea())
    ui.input('Description', guid())
    ui.action('Login')
    ui.wait_for_tab_with_name(f"Login session {sys_info[0]}")
    expected_alert_message = "Remote access not allowed. Please enable the 'Allow access from a public network' " \
                             "policy if web login from a public network is required."
    ui.switch_to_pop_up_window()
    ui.switch_context(WarningModal())
    assert ui.check_exists((Div(expected_alert_message))), \
        f"pop up warning message for Remote access is not same as : {expected_alert_message}"
    logger.info(f"Correct pop up warning message displayed for Remote access.")