Пример #1
0
        /// <summary>
        /// Store Workspace Details In Memory
        /// </summary>
        /// <param name="workspaceName">This is user type by enum</param>
        /// <param name="workspaceUserName">This is Guid  username</param>
        private void StoreWorkspaceDetailsInMemory(WorkSpace.WorkSpaceTypeEnum workspaceName,
                                                   Guid workspaceUserName)
        {
            //Store Workspace Details In Memory
            logger.LogMethodEntry("NewWorkspacePage", "StoreWorkspaceDetailsInMemory",
                                  base.IsTakeScreenShotDuringEntryExit);
            //Intialize the workspace
            WorkSpace newWorkspace = new WorkSpace
            {
                Name          = workspaceUserName.ToString(),
                WorkSpaceType = workspaceName,
                IsCreated     = true,
            };

            //Save The workspace Details in memory
            newWorkspace.StoreWorkSpaceInMemory();
            switch (workspaceName)
            {
            case WorkSpace.WorkSpaceTypeEnum.HEDMilWorkSpace:
                User user = new User
                {
                    Name      = workspaceUserName.ToString(),
                    UserType  = User.UserTypeEnum.HedMiLWsAdmin,
                    IsCreated = true,
                    Password  = NewWorkspacePageResource.
                                NewWorkspace_Page_CreateWorkspace_Password_Value
                }; user.StoreUserInMemory();
                break;
            }
            logger.LogMethodExit("NewWorkspacePage", "StoreWorkspaceDetailsInMemory",
                                 base.IsTakeScreenShotDuringEntryExit);;
        }
        public void UpdateAndCreatedWorkspace(
            WorkSpace.WorkSpaceTypeEnum workspaceTypeEnum, String adminType)
        {
            //Update The Created Workspace
            Logger.LogMethodEntry("CreateWorkspace", "UpdateAndCreatedWorkspace",
                                  base.IsTakeScreenShotDuringEntryExit);
            //Fetch the workspace name
            WorkSpace worspaceName = WorkSpace.Get(workspaceTypeEnum);

            //Searched created workspace
            new AdminToolPage().SearchCreatedWorkspace(
                (AdminToolPage.AdminWorkspaceTypeEnum)Enum.Parse
                    (typeof(AdminToolPage.AdminWorkspaceTypeEnum),
                    adminType), worspaceName.Name);
            Logger.LogMethodExit("CreateWorkspace", "UpdateAndCreatedWorkspace",
                                 base.IsTakeScreenShotDuringEntryExit);
        }
 public void CreateTheNewWorkspace(String adminType,
                                   WorkSpace.WorkSpaceTypeEnum workspaceName)
 {
     //Create The New Workspace
     Logger.LogMethodEntry("CreateWorkspace", "CreateTheNewWorkspace",
                           base.IsTakeScreenShotDuringEntryExit);
     // Click the Create New Workspace
     new AdminToolPage().ClickTheCreateNewWorkspaceLink(
         (AdminToolPage.AdminWorkspaceTypeEnum)Enum.Parse
             (typeof(AdminToolPage.AdminWorkspaceTypeEnum), adminType));
     //Create And Update Workspace
     new NewWorkspacePage().CreateAndUpdateTheWorkspace(
         (AdminToolPage.AdminWorkspaceTypeEnum)Enum.Parse
             (typeof(AdminToolPage.AdminWorkspaceTypeEnum),
             adminType), workspaceName);
     Logger.LogMethodExit("CreateWorkspace", "CreateTheNewWorkspace",
                          base.IsTakeScreenShotDuringEntryExit);
 }
Пример #4
0
        /// <summary>
        /// Create and Update The Workspace
        /// </summary>
        /// <param name="adminWorkspaceType">This is Admin workspace type</param>
        /// <param name="workspaceName">This is user type by enum</param>
        public void CreateAndUpdateTheWorkspace(AdminToolPage.AdminWorkspaceTypeEnum adminWorkspaceType,
                                                WorkSpace.WorkSpaceTypeEnum workspaceName)
        {
            //Create and Update The Workspace
            logger.LogMethodEntry("NewWorkspacePage", "CreateAndUpdateTheWorkspace",
                                  base.IsTakeScreenShotDuringEntryExit);
            //Intialize Guid for workspace
            Guid workspaceUserName = Guid.NewGuid();

            try
            {
                switch (adminWorkspaceType)
                {
                case AdminToolPage.AdminWorkspaceTypeEnum.Create:
                    //Select Window
                    base.SelectWindow(NewWorkspacePageResource.
                                      NewWorkspace_Page_CTG_CreateWorkspace_Window_Name);
                    //Fill the title
                    base.WaitForElement(By.Id(NewWorkspacePageResource.
                                              NewWorkspace_Page_CreateWorkspace_Title_Id_Locator));
                    base.GetWebElementPropertiesById(NewWorkspacePageResource.
                                                     NewWorkspace_Page_CreateWorkspace_Title_Id_Locator).Clear();
                    base.GetWebElementPropertiesById(NewWorkspacePageResource.
                                                     NewWorkspace_Page_CreateWorkspace_Title_Id_Locator).
                    SendKeys(workspaceUserName.ToString());
                    break;
                }
                //Fill UserName Details
                this.FillUserNameDetails(workspaceUserName.ToString(), adminWorkspaceType);
                //Enter FirstName and lastName details
                this.EnterFirstAndLastNameDetails
                    (workspaceUserName.ToString(), workspaceUserName.ToString(), adminWorkspaceType);
                //Click Save Button
                this.ClickTheSaveButtonInCreateWorkspacePopup();
                //Store User Details in Memory
                StoreWorkspaceDetailsInMemory(workspaceName, workspaceUserName);
            }
            catch (Exception e)
            {
                ExceptionHandler.HandleException(e);
            }
            logger.LogMethodExit("NewWorkspacePage", "CreateAndUpdateTheWorkspace",
                                 base.IsTakeScreenShotDuringEntryExit);
        }