/// <summary> /// Run an end-to-end test scenario /// Ensure any opened forms are closed at the end of the scenario /// </summary> /// <param name="manager">UserContextManager</param> /// <param name="testContext">current Test Context</param> /// <param name="action">function to perform the user actions</param> /// <param name="actionName">the name of the scenario being performed</param> public static void Run(UserContextManager manager, TestContext testContext, Action<UserContext> action, string actionName = null) { var userContext = manager.GetUserContext(testContext); var formCount = userContext.GetOpenFormCount(); try { action(userContext); userContext.CheckOpenForms(formCount); userContext.WaitForReady(); manager.ReturnUserContext(testContext, userContext); } catch (Exception) { // if error occurs we close the session and don't return to the pool CloseSession(userContext, testContext); throw; } }
/// <summary> /// Run an end-to-end test scenario /// Ensure any opened forms are closed at the end of the scenario /// </summary> /// <param name="manager">UserContextManager</param> /// <param name="testContext">current Test Context</param> /// <param name="action">function to perform the user actions</param> /// <param name="actionName">the name of the scenario being performed</param> public static void Run(UserContextManager manager, TestContext testContext, Action <UserContext> action, string actionName = null) { var userContext = manager.GetUserContext(testContext); var formCount = userContext.GetOpenFormCount(); //try //{ action(userContext); userContext.CheckOpenForms(formCount); userContext.WaitForReady(); manager.ReturnUserContext(testContext, userContext); //} //catch (Exception) //{ // // if error occurs we close the session and don't return to the pool // CloseSession(userContext, testContext); // throw; //} }
private static UserContextManager CreateUserContextManager() { // use NAV User Password authentication userContextManager = new NAVUserContextManager( Settings.Default.NAVClientService, null, null, SmallBusinessRoleCentre, Settings.Default.NAVUserName, Settings.Default.NAVUserPassword); return userContextManager; }
private UserContextManager CreateUserContextManager() { // use NAV User Password authentication orderProcessorUserContextManager = new NAVUserContextManager( NAVClientService, null, null, OrderProcessorRoleCenterId, NAVUserName, NAVPassword); // Use the current windows user uncomment the following //orderProcessorUserContextManager = new WindowsUserContextManager( // NAVClientService, // null, // null, // OrderProcessorRoleCenterId); // to use NAV User Password authentication for multiple tenants uncomment the following //orderProcessorUserContextManager = new NAVTenantUserContextManager( // NAVClientService, // "default", // null, // OrderProcessorRoleCenterId, // NAVUserName, // NAVPassword); return orderProcessorUserContextManager; }