Ejemplo n.º 1
0
 static string GetBusinessFlowPlatforms(BusinessFlow BF)
 {
     return(null);
 }
Ejemplo n.º 2
0
        public override bool ImportSelectedTests(string importDestinationPath, IEnumerable <Object> selectedTestSets)
        {
            if (selectedTestSets != null && selectedTestSets.Count() > 0)
            {
                ObservableList <QCTestSetTreeItem> testSetsItemsToImport = new ObservableList <QCTestSetTreeItem>();
                bool bfsWereDeleted = false;
                foreach (QCTestSetTreeItem testSetItem in selectedTestSets)
                {
                    //check if some of the Test Set was already imported
                    if (testSetItem.AlreadyImported == true)
                    {
                        Amdocs.Ginger.Common.eUserMsgSelection userSelection = Reporter.ToUser(eUserMsgKey.TestSetExists, testSetItem.TestSetName);
                        if (userSelection == Amdocs.Ginger.Common.eUserMsgSelection.Yes)
                        {
                            //Delete the mapped BF
                            File.Delete(testSetItem.MappedBusinessFlow.FileName);
                            bfsWereDeleted = true;
                            testSetsItemsToImport.Add(testSetItem);
                        }
                    }
                    else
                    {
                        testSetsItemsToImport.Add(testSetItem);
                    }
                }

                if (testSetsItemsToImport.Count == 0)
                {
                    return(false);                                  //noting to import
                }
                //Refresh Ginger repository and allow GingerQC to use it
                ALMIntegration.Instance.AlmCore.GingerActivitiesGroupsRepo = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <ActivitiesGroup>();
                ALMIntegration.Instance.AlmCore.GingerActivitiesRepo       = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <Activity>();

                foreach (QCTestSetTreeItem testSetItemtoImport in testSetsItemsToImport)
                {
                    try
                    {
                        //import test set data
                        Reporter.ToStatus(eStatusMsgKey.ALMTestSetImport, null, testSetItemtoImport.TestSetName);
                        GingerCore.ALM.QC.QCTestSet TS = new GingerCore.ALM.QC.QCTestSet();
                        TS.TestSetID   = testSetItemtoImport.TestSetID;
                        TS.TestSetName = testSetItemtoImport.TestSetName;
                        TS.TestSetPath = testSetItemtoImport.Path;
                        TS             = ((QCRestAPICore)ALMIntegration.Instance.AlmCore).ImportTestSetData(TS);

                        //convert test set into BF
                        BusinessFlow tsBusFlow = ((QCRestAPICore)ALMIntegration.Instance.AlmCore).ConvertQCTestSetToBF(TS);

                        if (WorkSpace.UserProfile.Solution.MainApplication != null)
                        {
                            //add the applications mapped to the Activities
                            foreach (Activity activ in tsBusFlow.Activities)
                            {
                                if (string.IsNullOrEmpty(activ.TargetApplication) == false)
                                {
                                    if (tsBusFlow.TargetApplications.Where(x => x.Name == activ.TargetApplication).FirstOrDefault() == null)
                                    {
                                        ApplicationPlatform appAgent = WorkSpace.UserProfile.Solution.ApplicationPlatforms.Where(x => x.AppName == activ.TargetApplication).FirstOrDefault();
                                        if (appAgent != null)
                                        {
                                            tsBusFlow.TargetApplications.Add(new TargetApplication()
                                            {
                                                AppName = appAgent.AppName
                                            });
                                        }
                                    }
                                }
                            }
                            //handle non mapped Activities
                            if (tsBusFlow.TargetApplications.Count == 0)
                            {
                                tsBusFlow.TargetApplications.Add(new TargetApplication()
                                {
                                    AppName = WorkSpace.UserProfile.Solution.MainApplication
                                });
                            }
                            foreach (Activity activ in tsBusFlow.Activities)
                            {
                                if (string.IsNullOrEmpty(activ.TargetApplication))
                                {
                                    activ.TargetApplication = tsBusFlow.MainApplication;
                                }
                            }
                        }
                        else
                        {
                            foreach (Activity activ in tsBusFlow.Activities)
                            {
                                activ.TargetApplication = null; // no app configured on solution level
                            }
                        }

                        WorkSpace.Instance.SolutionRepository.AddRepositoryItem(tsBusFlow);
                        Reporter.HideStatusMessage();
                    }
                    catch (Exception ex)
                    {
                        Reporter.ToUser(eUserMsgKey.ErrorInTestsetImport, testSetItemtoImport.TestSetName, ex.Message);
                        Reporter.ToLog(eLogLevel.ERROR, "Error importing from QC", ex);
                    }
                }

                Reporter.ToUser(eUserMsgKey.TestSetsImportedSuccessfully);

                Reporter.ToLog(eLogLevel.DEBUG, "Imported from QC successfully");
                return(true);
            }
            Reporter.ToLog(eLogLevel.ERROR, "Error importing from QC");
            return(false);
        }
Ejemplo n.º 3
0
 public override void UpdateBusinessFlow(ref BusinessFlow businessFlow)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
        public void FlowcontrolTest_WithBFCreateCopy()
        {
            //Arrange
            BusinessFlow bf = new BusinessFlow("Test");

            Activity activity = new Activity();

            activity.ActivityName = "Login";

            ActUIElement actGotoURL = new ActUIElement();

            actGotoURL.Description = "Launch";

            activity.Acts.Add(actGotoURL);

            Activity activity2 = new Activity();

            activity2.ActivityName = "Test";

            ActDummy act2 = new ActDummy();

            act2.Description = "WaitForApp";

            activity.Acts.Add(act2);

            FlowControl flowControl = new FlowControl();

            flowControl.Active            = true;
            flowControl.Condition         = "1=1";
            flowControl.FlowControlAction = eFlowControlAction.GoToActivity;
            flowControl.Value             = activity2.Guid + flowControl.GUID_NAME_SEPERATOR + activity2.ItemName;

            FlowControl flowControl2 = new FlowControl();

            flowControl2.Active            = true;
            flowControl2.Condition         = "2=2";
            flowControl2.FlowControlAction = eFlowControlAction.GoToAction;
            flowControl2.Value             = act2.Guid + flowControl.GUID_NAME_SEPERATOR + act2.ItemName;


            actGotoURL.FlowControls.Add(flowControl);
            actGotoURL.FlowControls.Add(flowControl2);

            bf.Activities.RemoveAt(0);
            bf.Activities.Add(activity);
            bf.Activities.Add(activity2);

            activity2.ActivityName = "Test_New";
            bf.RepositorySerializer.SaveToFile(bf, TestResources.GetTempFile("BF.xml"));

            //Act
            BusinessFlow bfCopy = (BusinessFlow)bf.CreateInstance();

            Guid newGuidOfActivity2 = bfCopy.Activities.Where(x => x.ItemName == "Test_New").FirstOrDefault().Guid;

            Guid newGuidOfAct2 = bfCopy.Activities[0].Acts.Where(x => x.ItemName == "WaitForApp").FirstOrDefault().Guid;


            //Assert
            Assert.AreEqual(bfCopy.Activities[0].Acts[0].FlowControls[1].GetGuidFromValue(), newGuidOfAct2);
            Assert.AreEqual(bfCopy.Activities[0].Acts[0].FlowControls[0].GetGuidFromValue(), newGuidOfActivity2);
        }
Ejemplo n.º 5
0
        public static void ClassInit(TestContext context)
        {
            mBF        = new BusinessFlow();
            mBF.Name   = "BF Test Fire Fox";
            mBF.Active = true;

            Activity activity = new Activity();

            mBF.AddActivity(activity);

            ActDummy action1 = new ActDummy();
            ActDummy action2 = new ActDummy();

            mBF.Activities[0].Acts.Add(action1);
            mBF.Activities[0].Acts.Add(action2);

            Platform p = new Platform();

            p.PlatformType = ePlatformType.Web;
            mBF.TargetApplications.Add(new TargetApplication()
            {
                AppName = "SCM"
            });

            VariableString v1 = new VariableString()
            {
                Name = "v1", InitialStringValue = "1"
            };

            mBF.AddVariable(v1);

            mGR                 = new GingerRunner();
            mGR.Name            = "Test Runner";
            mGR.CurrentSolution = new Ginger.SolutionGeneral.Solution();

            mGR.CurrentBusinessFlow = mBF;
            mGR.CurrentBusinessFlow.CurrentActivity = mBF.Activities[0];

            environment         = new ProjEnvironment();
            environment.Name    = "Default";
            mBF.Environment     = environment.Name;
            mGR.ProjEnvironment = environment;

            Agent a = new Agent();

            //a.DriverType = Agent.eDriverType.SeleniumFireFox;//have known firefox issues with selenium 3
            a.DriverType = Agent.eDriverType.SeleniumChrome;

            mGR.SolutionAgents = new ObservableList <Agent>();
            mGR.SolutionAgents.Add(a);
            // p2.Agent = a;

            mGR.ApplicationAgents.Add(new ApplicationAgent()
            {
                AppName = "SCM", Agent = a
            });
            mGR.SolutionApplications = new ObservableList <ApplicationPlatform>();
            mGR.SolutionApplications.Add(new ApplicationPlatform()
            {
                AppName = "SCM", Platform = ePlatformType.Web, Description = "New application"
            });
            mGR.BusinessFlows.Add(mBF);
            mGR.SpecificEnvironmentName = environment.Name;
            mGR.UseSpecificEnvironment  = false;

            string path         = Path.Combine(TestResources.GetTestResourcesFolder(@"Solutions" + Path.DirectorySeparatorChar + "BasicSimple"));
            string solutionFile = System.IO.Path.Combine(path, @"Ginger.Solution.xml");

            solution = Solution.LoadSolution(solutionFile);
            SR       = GingerSolutionRepository.CreateGingerSolutionRepository();
            SR.Open(path);
            WorkSpace.Instance.Solution = solution;
            WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder = WorkSpace.Instance.Solution.LoggerConfigurations.ExecutionLoggerConfigurationExecResultsFolder;
        }
Ejemplo n.º 6
0
 public bool ExportBfActivitiesGroupsToALM(BusinessFlow businessFlow, ObservableList <ActivitiesGroup> grdActivitiesGroups, ref string result)
 {
     return(true);//ExportToRally.Instance.ExportBfActivitiesGroupsToALM(businessFlow, grdActivitiesGroups, ref result);
 }
Ejemplo n.º 7
0
        public void ActivityVariableDependancyTest_WithCreateInstance()
        {
            //Arrange
            BusinessFlow bf = new BusinessFlow("Test");

            Activity activity = new Activity();
            VariableSelectionList selectionList2 = new VariableSelectionList();

            selectionList2.Name = "activityVariable1";
            selectionList2.OptionalValuesList.Add(new OptionalValue("c"));
            selectionList2.OptionalValuesList.Add(new OptionalValue("d"));

            VariableDependency vd = new VariableDependency(selectionList2.Guid, selectionList2.ItemName, selectionList2.Value);

            ActUIElement actGotoURL = new ActUIElement();

            actGotoURL.Description = "www.google.com";
            actGotoURL.VariablesDependencies.Add(vd);
            ActDummy actDummy = new ActDummy();

            actDummy.Description = "www.google.com";
            actDummy.VariablesDependencies.Add(vd);
            activity.Variables.Add(selectionList2);
            activity.Acts.Add(actGotoURL);
            activity.Acts.Add(actDummy);
            Activity activity2 = new Activity();
            ActDummy act2      = new ActDummy();

            act2.Description = "www.google.com";
            activity2.Acts.Add(act2);
            VariableSelectionList selectionList = new VariableSelectionList();

            selectionList.Name = "bfVariable1";
            selectionList.OptionalValuesList.Add(new OptionalValue("a"));
            selectionList.OptionalValuesList.Add(new OptionalValue("b"));

            bf.Variables.Add(selectionList);


            VariableDependency vd1 = new VariableDependency(selectionList.Guid, selectionList.ItemName, selectionList.Value);

            activity.VariablesDependencies.Add(vd1);
            activity2.VariablesDependencies.Add(vd1);

            bf.Activities.RemoveAt(0);
            bf.Activities.Add(activity);
            bf.Activities.Add(activity2);


            //Act
            BusinessFlow bfCopy = (BusinessFlow)bf.CreateInstance();

            Guid newBFVarGuid       = bfCopy.Variables.Where(x => x.Name == "bfVariable1").FirstOrDefault().Guid;
            Guid newActivityVarGuid = bfCopy.Activities[0].Variables[0].Guid;

            //Assert
            Assert.AreEqual(newBFVarGuid, bfCopy.Activities[0].VariablesDependencies[0].VariableGuid);
            Assert.AreEqual(newBFVarGuid, bfCopy.Activities[1].VariablesDependencies[0].VariableGuid);
            Assert.AreEqual(newActivityVarGuid, bfCopy.Activities[0].Acts[0].VariablesDependencies[0].VariableGuid);
            Assert.AreEqual(newActivityVarGuid, bfCopy.Activities[0].Acts[1].VariablesDependencies[0].VariableGuid);
        }
Ejemplo n.º 8
0
        public override void UpdateActivitiesGroup(ref BusinessFlow businessFlow, List <Tuple <string, string> > TCsIDs)
        {
            List <QCTSTest> TCOfTestSetList = ((QCCore)ALMIntegration.Instance.AlmCore).GetTSQCTestsList(businessFlow.ExternalID.ToString(), TCsIDs.Select(x => x.Item2.ToString()).ToList());

            ((QCCore)ALMIntegration.Instance.AlmCore).UpdatedQCTestInBF(ref businessFlow, TCOfTestSetList);
        }
Ejemplo n.º 9
0
        public override void UpdateBusinessFlow(ref BusinessFlow businessFlow)
        {
            List <QCTSTest> TCOfTestSetList = ((QCCore)ALMIntegration.Instance.AlmCore).GetTSQCTestsList(businessFlow.ExternalID.ToString());

            ((QCCore)ALMIntegration.Instance.AlmCore).UpdateBusinessFlow(ref businessFlow, TCOfTestSetList);
        }
 public override void BusinessFlowEnd(uint eventTime, BusinessFlow businessFlow, bool offlineMode = false)
 {
     WorkSpace.Instance.Telemetry.Add("businessflowend", new { Guid = businessFlow.Guid, Elapsed = businessFlow.Elapsed, Status = businessFlow.RunStatus.ToString() });
 }
Ejemplo n.º 11
0
 public BusinessFlowTreeItem(BusinessFlow businessFlow, eBusinessFlowsTreeViewMode viewMode = eBusinessFlowsTreeViewMode.ReadWrite)
 {
     mBusinessFlow = businessFlow;
     mViewMode     = viewMode;
 }
Ejemplo n.º 12
0
 public EditLocatorsWindow(BusinessFlow BizFlow)
 {
     InitializeComponent();
     SetGridView();
     UIA.CreateLocatorList(LocatorsGrid, Locators);
 }
Ejemplo n.º 13
0
 public abstract object SetReportActivityGroup(ActivitiesGroup activityGroup, BusinessFlow businessFlow, bool offlineMode = false);
Ejemplo n.º 14
0
        public override void BusinessFlowEnd(uint eventTime, BusinessFlow businessFlow, bool offlineMode = false)
        {
            BusinessFlowReport businessFlowReport = new BusinessFlowReport(businessFlow);

            SaveObjToJSonFile(businessFlowReport, Path.Combine(mDumpFolder, CurrentBusinessFlowFolder, "BusinessFlowReport.txt"));
        }
Ejemplo n.º 15
0
        public override bool ExportExecutionDetailsToALM(BusinessFlow bizFlow, ref string result, bool exectutedFromAutomateTab = false, PublishToALMConfig publishToALMConfig = null)
        {
            ObservableList <ExternalItemFieldBase> runFields = GetALMItemFields(null, true, ALM_Common.DataContracts.ResourceType.TEST_RUN);

            return(ExportToQCRestAPI.ExportExceutionDetailsToALM(bizFlow, ref result, runFields, exectutedFromAutomateTab, publishToALMConfig));
        }
Ejemplo n.º 16
0
        public override bool ExportActivitiesGroupToALM(ActivitiesGroup activtiesGroup, string uploadPath = null, bool performSaveAfterExport = false, BusinessFlow businessFlow = null)
        {
            if (activtiesGroup == null)
            {
                return(false);
            }
            //if it is called from shared repository need to select path
            if (uploadPath == null)
            {
                QCTestPlanExplorerPage win = new QCTestPlanExplorerPage();
                win.xCreateBusinessFlowFolder.Visibility = Visibility.Collapsed;//no need to create separate folder
                uploadPath = win.ShowAsWindow(eWindowShowStyle.Dialog);
            }
            //upload the Activities Group
            Reporter.ToStatus(eStatusMsgKey.ExportItemToALM, null, activtiesGroup.Name);
            string res = string.Empty;
            //TODO: retireve test case fields -->DONE
            ObservableList <ExternalItemFieldBase> testCaseFields = WorkSpace.Instance.Solution.ExternalItemsFields;

            ALMIntegration.Instance.RefreshALMItemFields(testCaseFields, true, null);
            var  filterTestCaseFields = testCaseFields.Where(tc => tc.ItemType == eQCItemType.TestCase.ToString()).ToList();
            bool exportRes            = ((QCCore)ALMIntegration.Instance.AlmCore).ExportActivitiesGroupToALM(activtiesGroup, matchingTC, uploadPath, new ObservableList <ExternalItemFieldBase>(filterTestCaseFields), ref res);

            Reporter.HideStatusMessage();
            if (exportRes)
            {
                if (performSaveAfterExport)
                {
                    Reporter.ToStatus(eStatusMsgKey.SaveItem, null, activtiesGroup.Name, GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup));
                    WorkSpace.Instance.SolutionRepository.SaveRepositoryItem(activtiesGroup);
                    Reporter.HideStatusMessage();
                }
                return(true);
            }
            else
            {
                Reporter.ToUser(eUserMsgKey.ExportItemToALMFailed, GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup), activtiesGroup.Name, res);
            }

            return(false);
        }
Ejemplo n.º 17
0
 public override bool ExportExecutionDetailsToALM(BusinessFlow bizFlow, ref string result, bool exectutedFromAutomateTab = false, PublishToALMConfig publishToALMConfig = null)
 {
     return(true);//ExportToRally.Instance.ExportExecutionDetailsToRally(bizFlow, ref result);
 }
Ejemplo n.º 18
0
        public override bool ExportBusinessFlowToALM(BusinessFlow businessFlow, bool performSaveAfterExport = false, ALMIntegration.eALMConnectType almConectStyle = ALMIntegration.eALMConnectType.Silence, string testPlanUploadPath = null, string testLabUploadPath = null)
        {
            if (businessFlow == null)
            {
                return(false);
            }

            if (businessFlow.ActivitiesGroups.Count == 0)
            {
                Reporter.ToUser(eUserMsgKey.StaticInfoMessage, "The " + GingerDicser.GetTermResValue(eTermResKey.BusinessFlow) + " do not include " + GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroups) + " which supposed to be mapped to ALM Test Cases, please add at least one " + GingerDicser.GetTermResValue(eTermResKey.ActivitiesGroup) + " before doing export.");
                return(false);
            }

            TestSet matchingTS = null;

            Amdocs.Ginger.Common.eUserMsgSelection userSelec = Amdocs.Ginger.Common.eUserMsgSelection.None;
            //check if the businessFlow already mapped to QC Test Set
            if (String.IsNullOrEmpty(businessFlow.ExternalID) == false)
            {
                matchingTS = ((QCCore)ALMIntegration.Instance.AlmCore).GetQCTestSet(businessFlow.ExternalID);
                if (matchingTS != null)
                {
                    //ask user if want to continue
                    userSelec = Reporter.ToUser(eUserMsgKey.BusinessFlowAlreadyMappedToTC, businessFlow.Name, matchingTS.TestSetFolder.Path + "\\" + matchingTS.Name);
                    if (userSelec == Amdocs.Ginger.Common.eUserMsgSelection.Cancel)
                    {
                        return(false);
                    }
                    else if (userSelec == Amdocs.Ginger.Common.eUserMsgSelection.No)
                    {
                        matchingTS = null;
                    }
                }
            }

            //check if all of the business flow activities groups already exported to QC and export the ones which not
            foreach (ActivitiesGroup ag in businessFlow.ActivitiesGroups)
            {
                //check if the ActivitiesGroup already mapped to QC Test Case
                matchingTC = null;
                if (String.IsNullOrEmpty(ag.ExternalID) == false)
                {
                    matchingTC = ((QCCore)ALMIntegration.Instance.AlmCore).GetQCTest(ag.ExternalID);
                    if (matchingTC != null)
                    {
                        //ask user if want to continue
                        Amdocs.Ginger.Common.eUserMsgSelection userSelect = Reporter.ToUser(eUserMsgKey.ActivitiesGroupAlreadyMappedToTC, ag.Name, matchingTC["TS_SUBJECT"].Path + "\\" + matchingTC.Name);
                        if (userSelect == Amdocs.Ginger.Common.eUserMsgSelection.Cancel)
                        {
                            return(false);
                        }
                        else if (userSelect == Amdocs.Ginger.Common.eUserMsgSelection.No)
                        {
                            matchingTC = null;
                        }
                        else
                        {
                            testPlanUploadPath = matchingTC["TS_SUBJECT"].Path;
                        }
                    }
                }

                //if user selected No and want to create new testplans to selected folder path
                if (matchingTC == null && String.IsNullOrEmpty(testPlanUploadPath))
                {
                    //get the QC Test Plan path to upload the activities group to
                    testPlanUploadPath = SelectALMTestPlanPath();
                    if (String.IsNullOrEmpty(testPlanUploadPath))
                    {
                        //no path to upload to
                        return(false);
                    }

                    //create upload path if checked to create separete folder
                    if (QCTestPlanFolderTreeItem.IsCreateBusinessFlowFolder)
                    {
                        //create folder with BF name
                        try
                        {
                            if (QCConnect.CreateFolder(testPlanUploadPath, businessFlow.Name))
                            {
                                testPlanUploadPath += "\\" + businessFlow.Name;
                            }
                        }
                        catch (Exception ex)
                        {
                            Reporter.ToLog(eLogLevel.ERROR, "Failed to get create folder for Test Plan", ex);
                        }
                    }
                }
                ExportActivitiesGroupToALM(ag, testPlanUploadPath);
            }

            if (matchingTS == null && string.IsNullOrEmpty(testLabUploadPath))
            {
                if (userSelec == Amdocs.Ginger.Common.eUserMsgSelection.No)
                {
                    Reporter.ToUser(eUserMsgKey.ExportQCNewTestSetSelectDiffFolder);
                }

                //get the QC Test Plan path to upload the activities group to
                testLabUploadPath = SelectALMTestLabPath();
                if (String.IsNullOrEmpty(testLabUploadPath))
                {
                    //no path to upload to
                    return(false);
                }
            }

            //upload the business flow
            Reporter.ToStatus(eStatusMsgKey.ExportItemToALM, null, businessFlow.Name);
            string res = string.Empty;
            //TODO : need to update to retrieve only Test Set Item Fields -->DONE
            ObservableList <ExternalItemFieldBase> testSetFields = WorkSpace.Instance.Solution.ExternalItemsFields;

            ALMIntegration.Instance.RefreshALMItemFields(testSetFields, true, null);
            var  filterTestSetFields = testSetFields.Where(tc => tc.ItemType == eQCItemType.TestSet.ToString()).ToList();
            bool exportRes           = ((QCCore)ALMIntegration.Instance.AlmCore).ExportBusinessFlowToALM(businessFlow, matchingTS, testLabUploadPath, new ObservableList <ExternalItemFieldBase> (filterTestSetFields), ref res);

            Reporter.HideStatusMessage();
            if (exportRes)
            {
                if (performSaveAfterExport)
                {
                    Reporter.ToStatus(eStatusMsgKey.SaveItem, null, businessFlow.Name, GingerDicser.GetTermResValue(eTermResKey.BusinessFlow));
                    WorkSpace.Instance.SolutionRepository.SaveRepositoryItem(businessFlow);
                    Reporter.HideStatusMessage();
                }
                if (almConectStyle != ALMIntegration.eALMConnectType.Auto)
                {
                    Reporter.ToUser(eUserMsgKey.ExportItemToALMSucceed);
                }
                return(true);
            }
            else
            if (almConectStyle != ALMIntegration.eALMConnectType.Auto)
            {
                Reporter.ToUser(eUserMsgKey.ExportItemToALMFailed, GingerDicser.GetTermResValue(eTermResKey.BusinessFlow), businessFlow.Name, res);
            }
            //}

            return(false);
        }
Ejemplo n.º 19
0
 public bool ExportBusinessFlowToRally(BusinessFlow businessFlow, ObservableList <ExternalItemFieldBase> ExternalItemsFields, ref string result)
 {
     return(true);//ExportToRally.Instance.ExportBusinessFlowToRally(businessFlow, ExternalItemsFields, ref result);
 }
Ejemplo n.º 20
0
 public void Init(RepositoryItemBase item, BusinessFlow containingBusinessFlow)
 {
     mItem         = item;
     mBusinessFlow = containingBusinessFlow;
     SetRepoLinkStatus();
 }
Ejemplo n.º 21
0
        public void BackUpRestore()
        {
            //Arrange
            int    ActivitiesToCreate = 5;
            string BizFlowName        = "Biz flow Back/Rest";
            string BizFlowDescription = "Desc Back/Rest tester";

            BusinessFlow BF = new BusinessFlow()
            {
                Name = BizFlowName
            };

            BF.Status     = BusinessFlow.eBusinessFlowStatus.Development;
            BF.Activities = new ObservableList <Activity>();
            ObservableList <Activity> OriginalActivitiesObj = BF.Activities;

            for (int i = 1; i <= ActivitiesToCreate; i++)
            {
                Activity a = new Activity()
                {
                    ActivityName = "Activity " + i, Description = "desc" + i, Status = eRunStatus.Passed
                };
                BF.AddActivity(a);
            }

            // Create Activity to check ref
            Activity a6 = new Activity()
            {
                ActivityName = "a6"
            };

            BF.Activities.Add(a6);

            // Add one action to make sure backup drill down, and restore the ref item not a copy
            ActUIElement act1 = new ActUIElement();

            act1.Description = "Goto URL 1";
            a6.Acts.Add(act1);

            //add action with input/output vals
            act1.InputValues = new ObservableList <ActInputValue>();
            string        firstInputValName = "Param1";
            ActInputValue firstInputVal     = new ActInputValue()
            {
                Param = firstInputValName
            };

            act1.InputValues.Add(firstInputVal);
            act1.InputValues.Add(new ActInputValue()
            {
                Param = "Param2"
            });

            //add flow control
            act1.FlowControls = new ObservableList <FlowControl>();
            act1.FlowControls.Add(new GingerCore.FlowControlLib.FlowControl()
            {
                Condition = "A=B", FlowControlAction = eFlowControlAction.GoToActivity
            });
            eFlowControlAction secondFlowControlAction = eFlowControlAction.RerunAction;

            GingerCore.FlowControlLib.FlowControl secondFlowControl = new GingerCore.FlowControlLib.FlowControl()
            {
                Condition = "C>123", FlowControlAction = secondFlowControlAction
            };
            act1.FlowControls.Add(secondFlowControl);
            act1.FlowControls.Add(new GingerCore.FlowControlLib.FlowControl()
            {
                Condition = "D=111", FlowControlAction = eFlowControlAction.StopRun
            });

            //BF Variables
            VariableString v = new VariableString();

            v.Name        = "Var1";
            v.Description = "VDesc 1";
            BF.AddVariable(v);
            VariableSelectionList sl = new VariableSelectionList();

            sl.Name = "Var 2";
            sl.OptionalValuesList = new ObservableList <OptionalValue>();
            sl.OptionalValuesList.Add(new OptionalValue("11"));
            sl.OptionalValuesList.Add(new OptionalValue("22"));
            sl.OptionalValuesList.Add(new OptionalValue("33"));
            BF.AddVariable(sl);

            // BF.SaveBackup();

            BF.SaveBackup();

            //Erase/Modify some stuff
            BF.Name        = "zzzz";
            BF.Description = BizFlowDescription;
            BF.Status      = BusinessFlow.eBusinessFlowStatus.Retired;
            BF.Activities[1].Description = "AAAA";
            BF.Activities.Remove(BF.Activities[2]);
            BF.Activities.Remove(BF.Activities[3]);
            act1.Description = "ZZZZZ";

            act1.InputValues[0].Param = "qqq";
            act1.InputValues.Remove(act1.InputValues[1]);

            act1.FlowControls[1].FlowControlAction = eFlowControlAction.MessageBox;
            act1.FlowControls.Add(new GingerCore.FlowControlLib.FlowControl()
            {
                Condition = "Val=123"
            });
            act1.FlowControls.Add(new GingerCore.FlowControlLib.FlowControl()
            {
                Condition = "Val=555"
            });

            sl.OptionalValuesList[0].Value = "aaaa";
            sl.OptionalValuesList.Add(new OptionalValue("44"));
            sl.OptionalValuesList.Add(new OptionalValue("55"));

            // BF.RestoreFromBackup();
            BF.RestoreFromBackup();

            // Assert
            Assert.AreEqual(BF.Name, BizFlowName, "BF.Name");
            Assert.AreEqual(BF.Description, null, "BF.Description");

            // check enum restore
            Assert.AreEqual(BF.Status, BusinessFlow.eBusinessFlowStatus.Development, "BF.Status");
            Assert.AreEqual(BF.Activities.Count(), ActivitiesToCreate + 1, "BF.Activities.Count()");

            //check original list ref obj
            Assert.AreEqual(BF.Activities, OriginalActivitiesObj, "BF.Activities REF");
            Assert.AreEqual(BF.Activities[0].Description, "desc1", "BF.Activities[0].Description");
            Assert.AreEqual(BF.Activities[5].ActivityName, "a6", "BF.Activities[5].ActivityName");

            // Check original action ref is back
            Assert.AreEqual(BF.Activities[5], a6, "BF.Activities[5] REF");
            Assert.AreEqual(act1.Description, "Goto URL 1", "act1.Description");
            Assert.AreEqual(a6.Acts[0], act1, "a6.Acts[0]");

            //check Action input values
            Assert.AreEqual(act1.InputValues.Count, 2, "act1.InputValues.Count");
            Assert.AreEqual(act1.InputValues[0], firstInputVal, "act1.InputValues[0] REF");
            Assert.AreEqual(act1.InputValues[0].Param, firstInputValName, "act1.InputValues[0].Param");

            //check Action flow control
            Assert.AreEqual(act1.FlowControls.Count, 3, "act1.FlowControls.Count");
            Assert.AreEqual(act1.FlowControls[1], secondFlowControl, "act1.FlowControls[1] REF");
            Assert.AreEqual(act1.FlowControls[1].FlowControlAction, secondFlowControlAction, "act1.FlowControls[1].FlowControlAction");

            //BF variables
            Assert.AreEqual(BF.Variables.Count, 2, "BF.Variables.Count");
            Assert.AreEqual(BF.Variables[1], sl, "BF.Variables[0] REF");
            Assert.AreEqual(((VariableSelectionList)BF.Variables[1]).OptionalValuesList[0].Value, "11", "BF.Variables[0].Value");
        }
Ejemplo n.º 22
0
 public override object SetReportActivityGroup(ActivitiesGroup activityGroup, BusinessFlow businessFlow, bool offlineMode)
 {
     //return new LiteDbActivityGroup();
     return(GetAGReportData(activityGroup, businessFlow));//Returning ActivityGroupReport so we will get execution info on the console
 }
Ejemplo n.º 23
0
        public void DynamicRunetExecutionTest()
        {
            //Arrange
            ObservableList <BusinessFlow> bfList = SR.GetAllRepositoryItems <BusinessFlow>();
            BusinessFlow BF1 = bfList[0];

            ObservableList <Activity> activityList = BF1.Activities;

            Activity activity = activityList[0];

            BF1.Active = true;

            GingerRunner mGRForRunset = new GingerRunner();

            mGRForRunset.Name = "Test Runner";

            Agent a = new Agent();

            a.DriverType = Agent.eDriverType.SeleniumChrome;

            mGRForRunset.SolutionAgents = new ObservableList <Agent>();
            mGRForRunset.SolutionAgents.Add(a);

            mGRForRunset.ApplicationAgents.Add(new ApplicationAgent()
            {
                AppName = "SCM", Agent = a
            });
            mGRForRunset.SolutionApplications = new ObservableList <ApplicationPlatform>();
            mGRForRunset.SolutionApplications.Add(new ApplicationPlatform()
            {
                AppName = "SCM", Platform = ePlatformType.Web, Description = "New application"
            });

            mGRForRunset.BusinessFlows.Add(BF1);
            WorkSpace.Instance.SolutionRepository = SR;

            mGRForRunset.SpecificEnvironmentName = environment.Name;
            mGRForRunset.UseSpecificEnvironment  = false;

            RunSetConfig runSetConfig1 = new RunSetConfig();

            mGRForRunset.IsUpdateBusinessFlowRunList = true;
            runSetConfig1.GingerRunners.Add(mGRForRunset);

            runSetConfig1.UpdateRunnersBusinessFlowRunsList();
            runSetConfig1.mRunModeParallel = false;

            RunSetActionHTMLReport produceHTML2 = CreateProduceHTMlOperation();

            runSetConfig1.RunSetActions.Add(produceHTML2);

            RunsetExecutor GMR1 = new RunsetExecutor();

            GMR1.RunsetExecutionEnvironment = environment;
            GMR1.RunSetConfig = runSetConfig1;
            WorkSpace.Instance.RunsetExecutor = GMR1;
            CLIHelper cLIHelper1 = new CLIHelper();

            cLIHelper1.RunAnalyzer       = false;
            cLIHelper1.ShowAutoRunWindow = false;
            cLIHelper1.DownloadUpgradeSolutionFromSourceControl = false;

            RunSetAutoRunConfiguration autoRunConfiguration1 = new RunSetAutoRunConfiguration(solution, GMR1, cLIHelper1);
            CLIDynamicFile             mCLIDynamicXML1       = new CLIDynamicFile(CLIDynamicFile.eFileType.XML);

            autoRunConfiguration1.SelectedCLI = mCLIDynamicXML1;
            String xmlFile = autoRunConfiguration1.SelectedCLI.CreateConfigurationsContent(solution, GMR1, cLIHelper1);

            autoRunConfiguration1.CreateContentFile();

            CLIProcessor cLIProcessor = new CLIProcessor();

            string[] args = new string[] { autoRunConfiguration1.SelectedCLI.Verb, "--" + CLIOptionClassHelper.FILENAME, autoRunConfiguration1.ConfigFileFullPath };

            //Act
            cLIProcessor.ExecuteArgs(args);

            //Assert
            string path = TestResources.GetTestResourcesFolder(@"Solutions" + Path.DirectorySeparatorChar + "BasicSimple" + Path.DirectorySeparatorChar + "Reports" + Path.DirectorySeparatorChar + "Reports");

            Assert.IsTrue(Directory.Exists(path));
        }
Ejemplo n.º 24
0
        public static void ClassInit(TestContext context)
        {
            Reporter.WorkSpaceReporter = new UnitTestWorkspaceReporter();

            int port = SocketHelper.GetOpenPort();

            // gingerGrid = WorkSpace.Instance.LocalGingerGrid; // new GingerGrid(port);
            gingerGrid = new GingerGrid(port);
            gingerGrid.Start();

            // WorkSpace.Instance.LocalGingerGrid = gingerGrid;

            webPlatform = new WebPlatformServiceFake();
            gingerNode  = new GingerNode(webPlatform);
            gingerNode.StartGingerNode("WebPlatformServiceFake 1", SocketHelper.GetLocalHostIP(), port);

            // Wait for node to be connected.

            gingerNodeProxy            = new GingerNodeProxy(gingerGrid.NodeList[0]);
            gingerNodeProxy.GingerGrid = gingerGrid;

            // GingerRunner gingerRunner = new GingerRunner();
            agent = new Agent();
            agent.GingerNodeProxy = gingerNodeProxy;
            agent.Platform        = GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ePlatformType.Service;
            // agent.PluginId = "aa";
            agent.ServiceId           = "WebPlatformServiceFake";
            agent.AgentType           = Agent.eAgentType.Service;
            agent.DriverConfiguration = new Amdocs.Ginger.Common.ObservableList <DriverConfigParam>();

            //agent.st
            // agent.StartDriver();
            gingerNodeProxy.StartDriver(agent.DriverConfiguration);



            mGR = new GingerRunner();
            mGR.CurrentSolution = new Ginger.SolutionGeneral.Solution();
            mBF            = new BusinessFlow();
            mBF.Activities = new ObservableList <Activity>();
            mBF.Name       = "BF Test Java Driver";
            Platform p = new Platform();

            p.PlatformType = ePlatformType.Web;
            mBF.TargetApplications.Add(new TargetApplication()
            {
                AppName = "TestApp"
            });
            Activity activity = new Activity();

            activity.TargetApplication = "JavaTestApp";
            mBF.Activities.Add(activity);
            mBF.CurrentActivity     = activity;
            mGR.CurrentBusinessFlow = mBF;


            ApplicationAgent AA = new ApplicationAgent();

            AA.AppName = "JavaTestApp";
            AA.Agent   = agent;

            mGR.ApplicationAgents.Add(AA);
            mGR.SetCurrentActivityAgent();
        }
Ejemplo n.º 25
0
 public PBDriver(BusinessFlow BF, eUIALibraryType type = eUIALibraryType.ComWrapper)
 {
     BusinessFlow   = BF;
     LibraryType    = type;
     gridDictionary = new Dictionary <AutomationElement, AutomationElement[, ]>();
 }
Ejemplo n.º 26
0
 private void OnActParentBusinessFlowChanged(BusinessFlow bf)
 {
     mActParentBusinessFlow = bf;
 }
Ejemplo n.º 27
0
 public override void UpdateActivitiesGroup(ref BusinessFlow businessFlow, List <Tuple <string, string> > TCsIDs)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 28
0
 public bool ExportBusinessFlowToALM(BusinessFlow businessFlow, QCTestSet mappedTestSet, string uploadPath, ObservableList <ExternalItemFieldBase> testSetFields, ObservableList <ExternalItemFieldBase> testInstanceFields, ref string result)
 {
     return(ExportToQCRestAPI.ExportBusinessFlowToQC(businessFlow, mappedTestSet, uploadPath, testSetFields, testInstanceFields, ref result));
 }
Ejemplo n.º 29
0
 public override void ExportBfActivitiesGroupsToALM(BusinessFlow businessFlow, ObservableList <ActivitiesGroup> grdActivitiesGroups)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 30
0
 public static void LogBusinessFlow(BusinessFlow BF)
 {
 }