/// <summary> /// 添加角色权限 /// </summary> /// <param name="entity">角色权限信息</param> public static void InsertRoleFunctions(RoleFunctions entity) { DataCommand cmd = DataCommandManager.GetDataCommand("InsertRoleFunctions"); cmd.SetParameterValue <RoleFunctions>(entity); cmd.ExecuteNonQuery(); }
public bool CreateRole(string RoleName, string RolePoints, RoleFunctions Functions, out string Message) { if (VerifyElementandScrollToElement(RoleWithFunctions(RoleName, EnumUtils.GetDescription(Functions).ToString()))) { return(VerifyRoleExists(RoleName, EnumUtils.GetDescription(Functions).ToString(), out Message)); } Click_OnButton(Button_AddRole); EnterRoleValues(RoleName, RoleName + "_Desc", RolePoints); SelectRole(Functions); Click_OnButton(Button_Save); return(VerifyRoleExists(RoleName, EnumUtils.GetDescription(Functions).ToString(), out Message)); }
public void SelectRole(RoleFunctions Functions) { try { string enumDescription; enumDescription = EnumUtils.GetDescription(Functions); ElementLocator FuncionCheckbox = new ElementLocator(Locator.XPath, Custom_CheckBox_ElementLocator(enumDescription)); CheckBoxElmandCheck(FuncionCheckbox); } catch (Exception e) { throw new Exception("Failed to select Functions Due to:" + e.Message); } }
public bool DeleteRole(string RoleName, RoleFunctions Functions, out string Message) { string CreateRoleMsg = ""; if (!VerifyElementandScrollToElement(RoleWithActions(RoleName, "Delete"))) { CreateRole(RoleName, "", Functions, out Message); CreateRoleMsg = Message + "And Used to Test Delete Functionality"; } Click_OnButton(RoleWithActions(RoleName, "Delete")); Driver.SwitchTo().Alert().Accept(); if (!VerifyElementandScrollToElement(RoleWithActions(RoleName, "Delete"))) { Message = CreateRoleMsg + ";Role Deleted Successfully ; Role Details:" + RoleName; return(true); } throw new Exception("Failed to Delete User:"); }
public TestStep DeleteRole(string RoleName, string RolePoints, RoleFunctions Functions, List <TestStep> listOfTestSteps) { string stepName = "Deleting Role Under User Management"; testStep = TestStepHelper.StartTestStep(testStep); try { DeleteRole(RoleName, Functions, out string Message); testStep.SetOutput(Message); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, true, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); return(testStep); } catch (Exception e) { testStep.SetOutput(e.Message); testStep = TestStepHelper.EndTestStep(testCase, testStep, stepName, false, DriverContext.SendScreenshotImageContent("WEB")); listOfTestSteps.Add(testStep); throw new Exception(e.Message); } }