def test_view_builtin_password_complex_profile(core_session, core_admin_ui): """ Test case: C1632 :param core_session: Centrify session :param core_admin_ui: Centrify admin Ui session """ ui = core_admin_ui ui.navigate("Settings", "Resources", "Password Profiles") ResourceManager.get_profiles(core_session, type="Default", rr_format=True) ui.select_option(name=ComboboxWithNameStartsWith("jsutil-datacombo"), item_name="Built-In Profiles") ui.action("View Profile", "Windows") # Viewing the Built-in windows profile Checking Minimum password Length, Maximum password Length, # Minium Alphabetic Character Count, Minimum NonAlphabetic Character Count ui.expect(ReadOnlyTextField('Name'), "Name is not editable") ui.expect(ReadOnlyTextField('MinimumPasswordLength'), "Minimum Password Length is not editable") ui.expect(ReadOnlyTextField('MaximumPasswordLength'), "Maximum Password Length is not editable") ui.expect(ReadOnlyTextField('MinimumAlphabeticCharacterCount'), "Minimum Alphabetic Character Count is not editable") ui.expect(ReadOnlyTextField('MinimumNonAlphabeticCharacterCount'), "Minimum Non Alphabetic Character Count is not editable") ui.close_modal("Close", modal_title="Password Complexity Profile") logger.info("Password profile for windows is not editable as expected") ui.switch_context(RenderedTab("Password Profiles")) # viewing the Database built-in profile. Checking Minimum password Length, Maximum password Length, # Minium Alphabetic Character Count, Minimum NonAlphabetic Character Count ui.action("View Profile", "Default profile for Oracle Database services") ui.expect(ReadOnlyTextField('Name'), "Name is not editable") ui.expect(ReadOnlyTextField('MinimumPasswordLength'), "Minimum Password Length is not editable") ui.expect(ReadOnlyTextField('MaximumPasswordLength'), "Maximum Password Length is not editable") ui.expect(ReadOnlyTextField('MinimumAlphabeticCharacterCount'), "Minimum Alphabetic Character Count is not editable") ui.expect(ReadOnlyTextField('MinimumNonAlphabeticCharacterCount'), "Minimum Non Alphabetic Character Count is not editable") ui.close_modal("Close", modal_title="Password Complexity Profile") logger.info("Password profile for windows is not editable as expected") ui.switch_context(RenderedTab("Password Profiles")) # viewing the Active directory built-in profile. Checking Minimum password Length, Maximum password Length, # Minium Alphabetic Character Count, Minimum NonAlphabetic Character Count, Read Only Text Field ui.action("View Profile", "Default profile for Active Directory domains") ui.expect(ReadOnlyTextField('Name'), "Name is not editable") ui.expect(ReadOnlyTextField('MinimumPasswordLength'), "Minimum Password Length is not editable") ui.expect(ReadOnlyTextField('MaximumPasswordLength'), "Maximum Password Length is not editable") ui.expect(ReadOnlyTextField('MinimumAlphabeticCharacterCount'), "Minimum Alphabetic Character Count is not editable") ui.expect(ReadOnlyTextField('MinimumNonAlphabeticCharacterCount'), "Minimum Non Alphabetic Character Count is not editable") ui.close_modal("Close", modal_title="Password Complexity Profile") logger.info("Password profile for domains is not editable as expected")
def test_delete_password_profile(core_session): """ TC: C281495 - Delete Password Complex Profile :param core_session: Authenticates API session """ profile_name_cps = f'Profile {guid()}' profile_create_result, profile_create_success = ResourceManager.add_password_profile( core_session, profile_name_cps, min_pwd_len=12, max_pwd_len=24) assert profile_create_success, f"Profile: {profile_name_cps} failed to create due to {profile_create_result}" logger.info( f"Profile {profile_name_cps} successfully created and result is {profile_create_result}" ) all_profiles_result, all_profiles_success = ResourceManager.get_profiles( core_session, type='All', rr_format=True) assert all_profiles_success, f"Failed to get profiles list {all_profiles_result}" logger.info( f"Successfully get the list of all the profiles {all_profiles_result}") cloned_builtin_profile_id = [] for profile_list in all_profiles_result['Results']: if profile_list['Row']['Name'] == profile_name_cps: cloned_builtin_profile_id.append(profile_list['Row']['ID']) profile_delete_success = ResourceManager.delete_password_profile( core_session, cloned_builtin_profile_id[0]) assert profile_delete_success, f"Failed to delete profile {profile_name_cps}" logger.info(f"Successfully deleted password profile {profile_name_cps}")
def test_clear_password_complexity_profile_description( core_session, core_admin_ui, create_basic_pass_profile): """ Test case C1661 :param core_session: Centrify session :param core_admin_ui: Creates random user and login in browser. :param create_basic_pass_profile: Created a basic password complexity profile. """ # Creating a basic password profile profile = create_basic_pass_profile(core_session, 1)[0] cps_prof_id = profile[0]['_RowKey'] profile_name_cps = profile[0]['Name'] ui = core_admin_ui ui.navigate("Settings", "Resources", "Password Profiles") ui.search(profile_name_cps) # Modify the password profile of description ui.right_click_action(GridCell(profile_name_cps, data_content=True), 'Modify Profile') ui.switch_context(Modal("Password Complexity Profile")) ui.input("Description", " ") ui.close_modal("Save") # Getting all the profiles and checking for the updated profile all_profiles, success = ResourceManager.get_profiles(core_session, type="All", rr_format=True) complex_password_profile = [] for row in all_profiles['Results']: if row['Row']['Name'] == profile_name_cps: complex_password_profile.append(row['Row']['Description']) # checking the description of the profile saved successfully after clearing the description field. assert complex_password_profile[0] == '', \ f"Profile with id {cps_prof_id} not saved successfully with description{success}" logger.info( f"Updated description of profile {profile_name_cps} successfully with {complex_password_profile[0]}" )
def test_add_newly_password_complex_profile(core_session, core_admin_ui): """ Test case: C1630 :param core_session: Centrify session :param core_admin_ui: Centrify admin Ui session """ ui = core_admin_ui ui.navigate("Settings", "Resources", "Password Profiles") ui.launch_modal("Add", modal_title="Password Complexity Profile") profile_name = f'testprofilename{guid()}' profile_description = "Test Description" ui.input("Name", profile_name) ui.input("Description", profile_description) ui.input("MinimumPasswordLength", 12) ui.input("MaximumPasswordLength", 32) check_atleast_one_digit_repeat = ui.check_exists(CheckedCheckbox("AtLeastOneDigit")) # checking At least One Digit in the password profile option exists in ui. assert check_atleast_one_digit_repeat, "Expecting checkbox for atLeast one digit repeat not appeared" logger.info("Atleast one digit option showed") ui.check("ConsecutiveCharRepeatAllowed") ui.check("undefined") ui.input("MaximumCharOccurrenceCount", 3) ui.check("undefined") ui.check("undefined") ui.input("MinimumAlphabeticCharacterCount", 2) ui.input("MinimumNonAlphabeticCharacterCount", 2) ui.close_modal("Save") # Getting all the profiles in password complexity profile. all_profiles, a = ResourceManager.get_profiles(core_session, type="All", rr_format=True) cloned_builtin_profile_id = [] for row in all_profiles['Results']: if row['Row']['Name'] == profile_name: cloned_builtin_profile_id.append(row['Row']['ProfileType']) assert row['Row']['ProfileType'] == "UserDefined", f"Profile created successfully with id " \ f"{cloned_builtin_profile_id}" logger.info(f"Created profile_name {profile_name} successfully with {cloned_builtin_profile_id}")