public void TestCleanUp()
 {
     if (apiModelsFolder != null)
     {
         ObservableList <ApplicationAPIModel> list = apiModelsFolder.GetFolderItems();
         for (int i = 0; i < list.Count;)
         {
             WorkSpace.Instance.SolutionRepository.DeleteRepositoryItem(list[i]);
         }
     }
 }
예제 #2
0
        public void CutPasteAgentFromSubFolderToroot()
        {
            //Arrange
            string    name       = "Move Me Up";
            string    folderName = "MySubFolder 2";
            AgentsPOM AgentsPOM  = mGingerAutomator.MainWindowPOM.GotoAgents();

            AgentsPOM.AgentsTree.SelectRootItem();
            AgentsPOM.AddSubFolder(folderName);
            Agent MyAgent = AgentsPOM.CreateAgent(folderName, name, ePlatformType.Web, Agent.eDriverType.SeleniumChrome);

            //Act
            AgentsPOM.AgentsTree.SelectItem(name);
            AgentsPOM.AgentsTree.Cut();
            AgentsPOM.AgentsTree.SelectRootItem();
            AgentsPOM.AgentsTree.Paste();

            bool agentExist = AgentsPOM.AgentsTree.IsItemExist(name);

            RepositoryFolder <Agent> AgentsFolder = WorkSpace.Instance.SolutionRepository.GetRepositoryItemRootFolder <Agent>();
            RepositoryFolder <Agent> subFolder    = AgentsFolder.GetSubFolder(folderName);
            Agent ACopyTag = (from x in subFolder.GetFolderItems() where x.Name == name select x).SingleOrDefault();

            // assert
            Assert.IsTrue(agentExist, "Agent exist");
            Assert.IsTrue(ACopyTag != null);
            Assert.AreEqual(@"~\Agents\" + folderName, ACopyTag.ContainingFolder);
            Assert.AreEqual(MyAgent, ACopyTag, "Same agent object in memeory");
        }
예제 #3
0
        private bool ChangeAPIMapping(bool showNewMappingMessage = false)
        {
            RepositoryFolder <ApplicationAPIModel> APIModels = WorkSpace.Instance.SolutionRepository.GetRepositoryItemRootFolder <ApplicationAPIModel>();

            if (APIModels.GetFolderItems().Count == 0)
            {
                Reporter.ToUser(eUserMsgKeys.NoAPIExistToMappedTo);
                return(false);
            }

            if (showNewMappingMessage)
            {
                Reporter.ToUser(eUserMsgKeys.APIMappedToActionIsMissing);
            }

            if (apiModelPage == null)
            {
                AppApiModelsFolderTreeItem apiRoot = new AppApiModelsFolderTreeItem(APIModels);
                apiModelPage = new SingleItemTreeViewSelectionPage("API Models", eImageType.APIModel, apiRoot, SingleItemTreeViewSelectionPage.eItemSelectionType.Single);
            }
            List <object> selectedList = apiModelPage.ShowAsWindow();

            if (selectedList != null && selectedList.Count == 1)
            {
                AAMB = (ApplicationAPIModel)selectedList[0];
                mAct.APImodelGUID = AAMB.Guid;
                return(true);
            }

            return(false);
        }
예제 #4
0
        List <ITreeViewItem> ITreeViewItem.Childrens()
        {
            List <ITreeViewItem> Childrens = new List <ITreeViewItem>();

            ObservableList <RepositoryFolder <ApplicationPOMModel> > subFolders = mPOMModelFolder.GetSubFolders();

            foreach (RepositoryFolder <ApplicationPOMModel> pomFolder in subFolders)
            {
                ApplicationPOMsTreeItem pomFTVI = new ApplicationPOMsTreeItem(pomFolder);
                Childrens.Add(pomFTVI);
            }
            subFolders.CollectionChanged -= TreeFolderItems_CollectionChanged; // untrack sub folders
            subFolders.CollectionChanged += TreeFolderItems_CollectionChanged; // track sub folders

            //Add direct childrens
            mChildPoms = mPOMModelFolder.GetFolderItems();
            mChildPoms.CollectionChanged -= TreeFolderItems_CollectionChanged;
            mChildPoms.CollectionChanged += TreeFolderItems_CollectionChanged;//adding event handler to add/remove tree items automatically based on folder items collection changes
            foreach (ApplicationPOMModel pom in mChildPoms.OrderBy(nameof(ApplicationPOMModel.Name)))
            {
                ApplicationPOMTreeItem pomTI = new ApplicationPOMTreeItem(pom);
                Childrens.Add(pomTI);
            }

            return(Childrens);
        }
예제 #5
0
        protected List <ITreeViewItem> GetChildrentGeneric <T>(RepositoryFolder <T> RF, string OrderBy)
        {
            List <ITreeViewItem> Childrens = new List <ITreeViewItem>();

            ObservableList <RepositoryFolder <T> > subFolders = RF.GetSubFolders();

            foreach (RepositoryFolder <T> envFolder in subFolders)
            {
                Childrens.Add(GetTreeItem(envFolder));
            }
            subFolders.CollectionChanged -= TreeFolderItems_CollectionChanged; // track sub folders
            subFolders.CollectionChanged += TreeFolderItems_CollectionChanged; // track sub folders

            //Add direct childrens
            ObservableList <T> folderItems = RF.GetFolderItems();

            // why we need -? in case we did refresh and reloaded the item TODO: research, make children called once
            folderItems.CollectionChanged -= TreeFolderItems_CollectionChanged;
            folderItems.CollectionChanged += TreeFolderItems_CollectionChanged;//adding event handler to add/remove tree items automatically based on folder items collection changes

            foreach (T item in folderItems.OrderBy(OrderBy))
            {
                ITreeViewItem tvi = GetTreeItem(item);
                Childrens.Add(tvi);
            }
            return(Childrens);
        }
예제 #6
0
        private void InitControls()
        {
            //TODO: uncomments once we have BusinessFlowsFolderTreeItem which get RF
            //RepositoryFolder<BusinessFlow> RF1 = mSolutionRepository.GetRepositoryItemRootFolder<BusinessFlow>();
            //BusinessFlowsFolderTreeItem t = new BusinessFlowsFolderTreeItem(RF1);
            //TVFrame.SetContent(new TreeViewExplorerPage(t));

            RepositoryFolder <BusinessFlow> RF2 = mSolutionRepository.GetRepositoryItemRootFolder <BusinessFlow>();
            ObservableList <BusinessFlow>   BFs = RF2.GetFolderItems();

            Grid1.ItemsSource = BFs;

            RepositoryFolder <BusinessFlow> RF3  = mSolutionRepository.GetRepositoryItemRootFolder <BusinessFlow>();
            ObservableList <BusinessFlow>   BFs2 = RF3.GetFolderItems();

            Grid2.ItemsSource = BFs2;

            // EnvsComboBox.in
            EnvsListBox.ItemsSource       = mSolutionRepository.GetAllRepositoryItems <ProjEnvironment>();
            EnvsListBox.DisplayMemberPath = nameof(ProjEnvironment.Name);

            EnvsComboBox.ItemsSource       = mSolutionRepository.GetAllRepositoryItems <ProjEnvironment>();
            EnvsComboBox.DisplayMemberPath = nameof(ProjEnvironment.Name);

            // Go get first env Guid
            Guid            guid = mSolutionRepository.GetAllRepositoryItems <ProjEnvironment>()[0].Guid;
            ProjEnvironment env1 = mSolutionRepository.GetRepositoryItemByGuid <ProjEnvironment>(guid);

            EnvNameTextBox.BindControl(env1, nameof(ProjEnvironment.Name));

            AllBFsListBox.ItemsSource       = mSolutionRepository.GetAllRepositoryItems <BusinessFlow>();
            AllBFsListBox.DisplayMemberPath = nameof(BusinessFlow.Name);
        }
        List <ITreeViewItem> ITreeViewItem.Childrens()
        {
            List <ITreeViewItem> Childrens = new List <ITreeViewItem>();

            ObservableList <RepositoryFolder <ApplicationAPIModel> > subFolders = mAPIModelFolder.GetSubFolders();

            foreach (RepositoryFolder <ApplicationAPIModel> apiFolder in subFolders)
            {
                AppApiModelsFolderTreeItem apiFTVI = new AppApiModelsFolderTreeItem(apiFolder, mShowEditInMenu);
                Childrens.Add(apiFTVI);
            }
            subFolders.CollectionChanged -= TreeFolderItems_CollectionChanged; // untrack sub folders
            subFolders.CollectionChanged += TreeFolderItems_CollectionChanged; // track sub folders

            //Add direct children's
            mChildAPIs = mAPIModelFolder.GetFolderItems();
            mChildAPIs.CollectionChanged -= TreeFolderItems_CollectionChanged;
            mChildAPIs.CollectionChanged += TreeFolderItems_CollectionChanged;//adding event handler to add/remove tree items automatically based on folder items collection changes
            foreach (ApplicationAPIModel api in mChildAPIs.OrderBy(nameof(ApplicationAPIModel.Name)))
            {
                AppApiModelTreeItem apiTI = new AppApiModelTreeItem(api, mShowEditInMenu);
                Childrens.Add(apiTI);
            }

            return(Childrens);
        }
        public ExplorerBusinessFlowsPage(RepositoryFolder <BusinessFlow> repositoryFolder)
        {
            InitializeComponent();

            grdBusinessFlows.btnRefresh.Visibility = Visibility.Collapsed;
            SetBusinessFlowsGridView();
            grdBusinessFlows.DataSourceList = repositoryFolder.GetFolderItems();
        }
예제 #9
0
        public void ApplicationAPIModelMultipleSoapAndRestSaveAndLoad()
        {
            // Arrange
            RepositoryFolder <ApplicationAPIModel> RFRoot    = SR.GetRepositoryItemRootFolder <ApplicationAPIModel>();
            RepositoryFolder <ApplicationAPIModel> subFolder = (RepositoryFolder <ApplicationAPIModel>)RFRoot.AddSubFolder("SecondFolder");

            //Act
            //add items to root folder
            ApplicationAPIModel AAMS1 = new ApplicationAPIModel()
            {
                Name = "Group1_Operation1"
            };

            SR.AddRepositoryItem(AAMS1);
            ApplicationAPIModel AAMS2 = new ApplicationAPIModel()
            {
                Name = "Group1_Operation2"
            };

            SR.AddRepositoryItem(AAMS2);
            ApplicationAPIModel AAMS3 = new ApplicationAPIModel()
            {
                Name = "Group1_Operation3"
            };

            SR.AddRepositoryItem(AAMS3);
            //add items to sub folder items
            ApplicationAPIModel AAMR1 = new ApplicationAPIModel()
            {
                Name = "Group2_Operation1"
            };

            subFolder.AddRepositoryItem(AAMR1);
            ApplicationAPIModel AAMR2 = new ApplicationAPIModel()
            {
                Name = "Group2_Operation2"
            };

            subFolder.AddRepositoryItem(AAMR2);
            ApplicationAPIModel AAMR3 = new ApplicationAPIModel()
            {
                Name = "Group2_Operation3"
            };

            subFolder.AddRepositoryItem(AAMR3);

            ObservableList <ApplicationAPIModel>   AAMBList          = SR.GetAllRepositoryItems <ApplicationAPIModel>();
            RepositoryFolder <ApplicationAPIModel> SecondFolder      = RFRoot.GetSubFolder("SecondFolder");
            ObservableList <ApplicationAPIModel>   AAMBListSubFolder = SecondFolder.GetFolderItems();


            //Assert
            // Assert.AreEqual(AAMBList.Count, 6, "All appllication models including sub folders"); - cannot compare since we run several tests in parallel
            Assert.AreEqual(AAMBListSubFolder.Count, 3, "Second Folder should have 3 files");
        }
 private void SetGridData()
 {
     if (mFolder.IsRootFolder)
     {
         grdEnvs.DataSourceList = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <ProjEnvironment>();
     }
     else
     {
         grdEnvs.DataSourceList = mFolder.GetFolderItems();
     }
 }
예제 #11
0
 private void SetGridAndTreeData()
 {
     if (mActivitiesFolder.IsRootFolder)
     {
         xActivitiesRepositoryGrid.DataSourceList = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <Activity>();
     }
     else
     {
         xActivitiesRepositoryGrid.DataSourceList = mActivitiesFolder.GetFolderItems();
     }
 }
예제 #12
0
 private void SetGridAndTreeData()
 {
     if (mVariablesFolder.IsRootFolder)
     {
         xVariablesGrid.DataSourceList = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <VariableBase>();
     }
     else
     {
         xVariablesGrid.DataSourceList = mVariablesFolder.GetFolderItems();
     }
 }
예제 #13
0
 private void SetAPIModelGridData()
 {
     if (mPOMsFolder.IsRootFolder)
     {
         xPOMModelsGrid.DataSourceList = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <ApplicationPOMModel>();
     }
     else
     {
         xPOMModelsGrid.DataSourceList = mPOMsFolder.GetFolderItems();
     }
 }
예제 #14
0
        //string mFolder;

        public AgentsPage(RepositoryFolder <Agent> agentsFolder)
        {
            InitializeComponent();
            SetAgentsGridView();

            if (agentsFolder.IsRootFolder)
            {
                xAgentsGrd.DataSourceList = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <Agent>();
            }
            else
            {
                xAgentsGrd.DataSourceList = agentsFolder.GetFolderItems();
            }
        }
        public ExplorerBusinessFlowsPage(RepositoryFolder <BusinessFlow> repositoryFolder)
        {
            InitializeComponent();

            grdBusinessFlows.btnRefresh.Visibility = Visibility.Collapsed;
            SetBusinessFlowsGridView();

            if (repositoryFolder.IsRootFolder)
            {
                grdBusinessFlows.DataSourceList = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <BusinessFlow>();
            }
            else
            {
                grdBusinessFlows.DataSourceList = repositoryFolder.GetFolderItems();
            }
        }
예제 #16
0
        List <ITreeViewItem> ITreeViewItem.Childrens()
        {
            List <ITreeViewItem>          Childrens = new List <ITreeViewItem>();
            ObservableList <BusinessFlow> BFs;

            if (Folder == "Recently Used")
            {
                // Since Recently used is per user we keep temp file in the solution folder using MRU class
                BFs = new ObservableList <BusinessFlow>();

                string[] BizFlowsFile = App.UserProfile.Solution.RecentlyUsedBusinessFlows.getList();

                foreach (string BFfilename in BizFlowsFile)
                {
                    // DO NOT load from file - need to search or get from db repo... so it will all be in sync wherever ths BF is used
                    //BusinessFlow BF = App.LocalRepository.GetBusinessFlow(BFfilename);
                    BusinessFlow BF = App.LocalRepository.GetItemByFileName <BusinessFlow>(typeof(BusinessFlow), BFfilename);
                    if (BF != null && BFs.Contains(BF) == false)
                    {
                        BFs.Add(BF);
                    }
                }
            }
            else
            {
                if (WorkSpace.Instance.BetaFeatures.BFUseSolutionRepositry)
                {
                    BFs = mRepositoryFolder.GetFolderItems();
                    AddsubFolders(mRepositoryFolder, Childrens);
                }
                else
                {
                    BFs = App.LocalRepository.GetSolutionBusinessFlows(specificFolderPath: Path);
                    AddsubFolders(Path, Childrens);
                }
            }

            //Add Business Flows to tree children
            foreach (BusinessFlow BF in BFs)
            {
                BusinessFlowTreeItem BFTI = new BusinessFlowTreeItem(mViewMode);
                BFTI.BusinessFlow = BF;
                Childrens.Add(BFTI);
            }

            return(Childrens);
        }
        private void SetGridAndTreeData()
        {
            xActivitiesGroupsRepositoryListView.ListTitleVisibility = Visibility.Hidden;
            ActivitiesGroupsListViewHelper mActionsListHelper = new ActivitiesGroupsListViewHelper(mContext, General.eRIPageViewMode.AddFromShardRepository);

            xActivitiesGroupsRepositoryListView.SetDefaultListDataTemplate(mActionsListHelper);
            xActivitiesGroupsRepositoryListView.ListSelectionMode = SelectionMode.Extended;
            mActionsListHelper.ListView = xActivitiesGroupsRepositoryListView;

            if (mActivitiesGroupFolder.IsRootFolder)
            {
                xActivitiesGroupsRepositoryListView.DataSourceList = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <ActivitiesGroup>();
            }
            else
            {
                xActivitiesGroupsRepositoryListView.DataSourceList = mActivitiesGroupFolder.GetFolderItems();
            }
        }
예제 #18
0
        List <ITreeViewItem> ITreeViewItem.Childrens()
        {
            List <ITreeViewItem> Childrens = new List <ITreeViewItem>();

            foreach (RepositoryFolder <ApplicationPOMModel> POMFolder in mPOMModelFolder.GetSubFolders())
            {
                ApplicationPOMsTreeItem apiFTVI = new ApplicationPOMsTreeItem(POMFolder);
                Childrens.Add(apiFTVI);
            }

            //Add direct childrens
            foreach (ApplicationPOMModel api in mPOMModelFolder.GetFolderItems())
            {
                ApplicationPOMTreeItem apiTI = new ApplicationPOMTreeItem(api);
                Childrens.Add(apiTI);
            }

            return(Childrens);
        }
예제 #19
0
        private void ExportAllToALM(object sender, System.Windows.RoutedEventArgs e)
        {
            ObservableList <BusinessFlow> bfToExport = mBusFlowsFolder.GetFolderItems();

            if (bfToExport.Count > 0)
            {
                if (bfToExport.Count == 1)
                {
                    ALMIntegration.Instance.ExportBusinessFlowToALM(bfToExport[0], true);
                }
                else
                {
                    if (ALMIntegration.Instance.ExportAllBusinessFlowsToALM(bfToExport, true, ALMIntegration.eALMConnectType.Auto))
                    {
                        Reporter.ToUser(eUserMsgKeys.ExportAllItemsToALMSucceed);
                    }
                    else
                    {
                        Reporter.ToUser(eUserMsgKeys.ExportAllItemsToALMFailed);
                    }
                }
            }
        }
예제 #20
0
        public void CopyPasteAgentinAgentRoot()
        {
            //Arrange
            string    name      = "C1";
            string    copy      = "C1_Copy";
            AgentsPOM AgentsPOM = mGingerAutomator.MainWindowPOM.GotoAgents();

            AgentsPOM.CreateAgent(name, ePlatformType.Web, Agent.eDriverType.SeleniumIE);

            //Act
            AgentsPOM.AgentsTree.Copy();
            AgentsPOM.AgentsTree.SelectRootItem();
            AgentsPOM.AgentsTree.Paste(copy);
            bool agentExist = AgentsPOM.AgentsTree.IsItemExist(copy);

            Agent Acopy = (from x in WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <Agent>() where x.Name == copy select x).SingleOrDefault();
            RepositoryFolder <Agent> AgentsFolder = WorkSpace.Instance.SolutionRepository.GetRepositoryItemRootFolder <Agent>();
            Agent ACopyTag = (from x in AgentsFolder.GetFolderItems() where x.Name == copy select x).SingleOrDefault();

            // assert
            Assert.IsTrue(agentExist, "Agent exist");
            Assert.IsTrue(Acopy != null);
            Assert.AreEqual(Acopy, ACopyTag);
        }
예제 #21
0
        //string mFolder;

        public AgentsPage(RepositoryFolder <Agent> agentsFolder)
        {
            InitializeComponent();
            SetAgentsGridView();
            xAgentsGrd.DataSourceList = agentsFolder.GetFolderItems();
        }