Beispiel #1
0
        public void InstalledPluginPackageFromOnline()
        {
            //Arrange

            // TODO: create a simple plugin for unit test which will download faster.

            string PluginId = "PACT";
            string path     = TestResources.GetTestTempFolder(@"Solutions\PluginsManagerSR1");

            if (Directory.Exists(path))
            {
                Directory.Delete(path, true);
            }

            SolutionRepository solutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();

            solutionRepository.CreateRepository(path);
            solutionRepository.Open(path);

            PluginsManager pluginsManager = new PluginsManager(solutionRepository);
            ObservableList <PluginPackage> pluginPackages = solutionRepository.GetAllRepositoryItems <PluginPackage>();

            // Act
            var p = pluginsManager.GetOnlinePluginsIndex();
            OnlinePluginPackage onlinePluginPackage = (from x in p where x.Id == PluginId select x).SingleOrDefault();

            //OnlinePluginPackageRelease onlinePluginPackageRelease
            pluginsManager.InstallPluginPackage(onlinePluginPackage, onlinePluginPackage.Releases[0]);
            //string folder = Path.Combine(Common.GetTestResourcesFolder(), @"PluginPackages\SeleniumPluginPackage.1.0.0");


            //Assert
            Assert.AreEqual(1, pluginPackages.Count);
            Assert.AreEqual("PACT", pluginPackages[0].PluginId);
        }
Beispiel #2
0
        private void OpenSolution()
        {
            Console.WriteLine("Solution Folder?");
            string sFolder = Console.ReadLine();

            if (Directory.Exists(sFolder))
            {
                Console.WriteLine("Opening Solution at folder: " + sFolder);

                SR = GingerSolutionRepository.CreateGingerSolutionRepository();

                WorkSpace.Instance.SolutionRepository = SR;
                SR.Open(sFolder);
                IEnumerable <RepositoryFile> files = SR.GetAllSolutionRepositoryFiles().ToList();
                Console.WriteLine("Files count = " + files.Count());

                Console.WriteLine("Ginger Menu - Solution: " + sFolder);

                OpenSolutionMenuItem.Active       = false;
                CloseSolutionMenuItem.Active      = true;
                BusinessFlowsCountMenuItem.Active = true;
                BusinessFlowsListMenuItem.Active  = true;
                EnvironmentsListMenuItem.Active   = true;
                RunBusinessFlowMenuItem.Active    = true;
                RunSetMenuItem.Active             = true;
            }
            else
            {
                Console.WriteLine("Directory not found: " + sFolder);
            }
        }
Beispiel #3
0
        public static void ClassInitialize(TestContext TestContext)
        {
            mTestHelper.ClassInitialize(TestContext);


            // Create temp solution
            SolutionRepository solutionRepository;
            string             path = Path.Combine(TestResources.GetTestTempFolder(@"Solutions" + Path.DirectorySeparatorChar + "AgentTestSolution"));

            if (Directory.Exists(path))
            {
                Directory.Delete(path, true);
            }
            solutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();
            solutionRepository.CreateRepository(path);
            WorkSpace.Instance.SolutionRepository = solutionRepository;

            // add Example4 Plugin to solution
            string pluginPath = Path.Combine(TestResources.GetTestResourcesFolder(@"Plugins" + Path.DirectorySeparatorChar + "PluginDriverExample4"));

            WorkSpace.Instance.PlugInsManager.Init(solutionRepository);
            WorkSpace.Instance.PlugInsManager.AddPluginPackage(pluginPath);

            mGingerGrid = WorkSpace.Instance.LocalGingerGrid;
        }
        public void TestInitialize()
        {
            BusinessFlow mBF = new BusinessFlow();

            mBF.Activities = new ObservableList <Activity>();
            mBF.Name       = "BF Non-Driver Action Test";
            mBF.Active     = true;

            Activity activity = new Activity();

            mBF.Activities.Add(activity);
            mBF.CurrentActivity = activity;

            mGR = new GingerExecutionEngine(new GingerRunner());
            mGR.CurrentSolution     = new Ginger.SolutionGeneral.Solution();
            mGR.CurrentBusinessFlow = mBF;
            mGR.BusinessFlows.Add(mBF);


            Reporter.ToLog(eLogLevel.DEBUG, "Creating the GingerCoreNET WorkSpace");
            WorkSpaceEventHandler WSEH = new WorkSpaceEventHandler();

            WorkSpace.Init(WSEH);
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();
            isOSWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
        }
Beispiel #5
0
        public static void ClassInitialize(TestContext TC)
        {
            solutionName = "ActionConversionSol";
            CreateTestSolution();

            // Use helper !!!!!

            // Creating workspace
            WorkSpace.Init(new WorkSpaceEventHandler());
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();

            // Init SR
            mSolutionRepository = WorkSpace.Instance.SolutionRepository;
            Ginger.App.InitClassTypesDictionary();
            string TempRepositoryFolder = TestResources.GetTestTempFolder(@"Solutions\" + solutionName);

            mSolutionRepository.Open(TempRepositoryFolder);

            Ginger.SolutionGeneral.Solution sol = new Ginger.SolutionGeneral.Solution();
            sol.ApplicationPlatforms = new ObservableList <GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ApplicationPlatform>();
            sol.ApplicationPlatforms.Add(new GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ApplicationPlatform()
            {
                AppName  = "Web-App",
                Platform = GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ePlatformType.Web
            });

            sol.ApplicationPlatforms.Add(new GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ApplicationPlatform()
            {
                AppName  = "Java-App",
                Platform = GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ePlatformType.Java
            });

            WorkSpace.Instance.Solution = sol;
        }
Beispiel #6
0
        public static void ClassInitialize(TestContext TestContext)
        {
            DummyWorkSpace ws = new DummyWorkSpace();

            WorkSpace.Init(ws);

            string folder = TestResources.GetTestTempFolder("Solutions", "PluginTest");

            if (Directory.Exists(folder))
            {
                Directory.Delete(folder, true);
            }

            SR = GingerSolutionRepository.CreateGingerSolutionRepository();
            SR.CreateRepository(folder);
            SR.Open(folder);
            WorkSpace.Instance.SolutionRepository = SR;
            string pluginFolder = TestResources.GetTestResourcesFolder(@"PluginPackages" + Path.DirectorySeparatorChar + "GingerOfficePlugin");


            //string txt = WorkSpace.Instance.PlugInsManager.CreatePluginPackageInfo("GingerOfficePlugin", "1.0.0");
            //System.IO.File.WriteAllText(pluginFolder + @"\Ginger.PluginPackage.json", txt);


            WorkSpace.Instance.PlugInsManager.AddPluginPackage(pluginFolder);
        }
        public static void ClassInitialize(TestContext TC)
        {
            solutionName = "ActionConversionSol";
            CreateTestSolution();

            // Use helper !!!!!

            // Creating workspace
            WorkSpace.Init(new WorkSpaceEventHandler());
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();

            // Init SR
            mSolutionRepository = WorkSpace.Instance.SolutionRepository;
            string TempRepositoryFolder = TestResources.GetTestTempFolder(@"Solutions\" + solutionName);

            mSolutionRepository.Open(TempRepositoryFolder);

            Ginger.SolutionGeneral.Solution sol = new Ginger.SolutionGeneral.Solution();
            sol.ApplicationPlatforms = new ObservableList <GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ApplicationPlatform>();
            sol.ApplicationPlatforms.Add(new GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ApplicationPlatform()
            {
                AppName  = "WebServices",
                Platform = GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ePlatformType.WebServices
            });

            WorkSpace.Instance.Solution = sol;

            mListBF = new ObservableList <BusinessFlow>();
            mBF     = new BusinessFlow()
            {
                Name = "TestBFConversion", Active = true
            };
            mBF.TargetApplications = WorkSpace.Instance.Solution.GetSolutionTargetApplications();
        }
Beispiel #8
0
        public static void ClassInit(TestContext context)
        {
            RepositoryItemHelper.RepositoryItemFactory = new RepositoryItemFactory();

            mBF            = new BusinessFlow();
            mBF.Activities = new ObservableList <Activity>();
            mBF.Name       = "BF Non-Driver Action Test";
            mBF.Active     = true;

            Activity activity = new Activity();

            mBF.Activities.Add(activity);
            mBF.CurrentActivity = activity;

            mGR = new GingerRunner();
            mGR.CurrentSolution     = new Ginger.SolutionGeneral.Solution();
            mGR.CurrentBusinessFlow = mBF;
            mGR.BusinessFlows.Add(mBF);


            Reporter.ToLog(eLogLevel.DEBUG, "Creating the GingerCoreNET WorkSpace");
            WorkSpaceEventHandler WSEH = new WorkSpaceEventHandler();

            WorkSpace.Init(WSEH);
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();
        }
        public static void ClassInitialize(TestContext TC)
        {
            Reporter.ToLog(eLogLevel.DEBUG, "Creating the GingerCoreNET WorkSpace");
            WorkSpaceEventHandler WSEH = new WorkSpaceEventHandler();

            WorkSpace.Init(WSEH);

            string TempSolutionFolder = TestResources.GetTestTempFolder(@"Solutions" + Path.DirectorySeparatorChar + "APIModelsComparisonUtilityTest");

            if (Directory.Exists(TempSolutionFolder))
            {
                Directory.Delete(TempSolutionFolder, true);
            }

            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();
            WorkSpace.Instance.SolutionRepository.CreateRepository(TempSolutionFolder);

            NewRepositorySerializer RS = new NewRepositorySerializer();

            NewRepositorySerializer.AddClassesFromAssembly(typeof(ApplicationAPIModel).Assembly);
            WorkSpace.Instance.SolutionRepository.Open(TempSolutionFolder);

            // Initialize ApplicationAPIModels XML file names to be fetched from TestResources
            xmlFiles = new List <string>()
            {
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "Create_User.Ginger.ApplicationAPIModel.xml",
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "Delete_User.Ginger.ApplicationAPIModel.xml",
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "PhoneVerifySOAP_CheckPhoneNumber.Ginger.ApplicationAPIModel.xml",
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "Update_User.Ginger.ApplicationAPIModel.xml",
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "PhoneVerifySOAP_CheckPhoneNumbers.Ginger.ApplicationAPIModel.xml",
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "GetQuote_DelayedStockQuoteSoap.Ginger.ApplicationAPIModel.xml",
            };

            existingAPIsList = new ObservableList <ApplicationAPIModel>();
            learnedAPIsList  = new List <ApplicationAPIModel>();

            // Importing API Models from XML files (listed in xmlFiles)
            foreach (String fileName in xmlFiles)
            {
                var tempFile = TestResources.GetTestResourcesFile(fileName);
                ApplicationAPIModel appModel = RS.DeserializeFromFile(typeof(ApplicationAPIModel), tempFile) as ApplicationAPIModel;
                appModel.FilePath = appModel.Name;//so it will get new file path when been added to repository later
                if (appModel != null)
                {
                    existingAPIsList.Add(appModel);
                    learnedAPIsList.Add(appModel.CreateCopy() as ApplicationAPIModel);
                }
            }

            // Modifying certain API Models for testing different Comparison status and scenarios
            existingAPIsList[1].RequestBody = existingAPIsList[1].RequestBody + "This is modified";
            existingAPIsList[3].RequestBody = existingAPIsList[3].RequestBody + "This is also modified";

            // Storing the API Models in the Solution Repository as will be utilized during Comparison process
            foreach (ApplicationAPIModel apiModel in existingAPIsList.Skip(1).Take(4))
            {
                WorkSpace.Instance.SolutionRepository.AddRepositoryItem(apiModel);
            }
        }
        public static void ClassInit(TestContext context)
        {
            mBF            = new BusinessFlow();
            mBF.Activities = new ObservableList <Activity>();
            mBF.Name       = "BF Test Fire Fox";
            mBF.Active     = true;
            Platform p = new Platform();

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

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

            mBF.AddVariable(busFlowV1);

            mGR          = new GingerRunner();
            mGR.Executor = new GingerExecutionEngine(mGR);

            mGR.Executor.CurrentSolution = new Ginger.SolutionGeneral.Solution();

            Agent a = new Agent();

            a.AgentType = Agent.eAgentType.Service; // Simple agent which anyhow we don't need to start for this test and will work on Linux

            ((GingerExecutionEngine)mGR.Executor).SolutionAgents = new ObservableList <Agent>();
            ((GingerExecutionEngine)mGR.Executor).SolutionAgents.Add(a);

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

            WorkSpace.Init(new WorkSpaceEventHandler());
            WorkSpace.Instance.RunningFromUnitTest = true;
            WorkSpace.Instance.SolutionRepository  = GingerSolutionRepository.CreateGingerSolutionRepository();

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

            solution = SolutionOperations.LoadSolution(solutionFile);
            WorkSpace.Instance.SolutionRepository.Open(path);
            WorkSpace.Instance.Solution = solution;
            if (WorkSpace.Instance.Solution.SolutionOperations == null)
            {
                WorkSpace.Instance.Solution.SolutionOperations = new SolutionOperations(WorkSpace.Instance.Solution);
            }
        }
Beispiel #11
0
        public static void ClassInit(TestContext context)
        {
            AutoLogProxy.Init("Unit Tests");

            // Create new solution
            mBusinessFlow            = new BusinessFlow();
            mBusinessFlow.Activities = new ObservableList <Activity>();
            mBusinessFlow.Name       = "MyDriver BF";
            mBusinessFlow.Active     = true;
            Platform p = new Platform();

            p.PlatformType = ePlatformType.NA;
            mBusinessFlow.TargetApplications.Add(new TargetApplication()
            {
                AppName = mAppName
            });

            mGingerRunner = new GingerRunner();
            mGingerRunner.CurrentSolution = new Ginger.SolutionGeneral.Solution();

            Agent agent = new Agent();

            agent.AgentType = Agent.eAgentType.Service;

            mGingerRunner.SolutionAgents = new ObservableList <Agent>();
            mGingerRunner.SolutionAgents.Add(agent);

            mGingerRunner.ApplicationAgents.Add(new ApplicationAgent()
            {
                AppName = mAppName, Agent = agent
            });
            mGingerRunner.SolutionApplications = new ObservableList <ApplicationPlatform>();
            mGingerRunner.SolutionApplications.Add(new ApplicationPlatform()
            {
                AppName = mAppName, Platform = ePlatformType.NA
            });
            mGingerRunner.BusinessFlows.Add(mBusinessFlow);


            // Add the plugin to solution
            WorkSpace.Init(new WorkSpaceEventHandler());
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();

            string solutionfolder = TestResources.GetTestTempFolder("sol1");

            if (Directory.Exists(solutionfolder))
            {
                Directory.Delete(solutionfolder, true);
            }
            WorkSpace.Instance.SolutionRepository.CreateRepository(solutionfolder);
            WorkSpace.Instance.SolutionRepository.Open(solutionfolder);

            string pluginFolder = TestResources.GetTestResourcesFolder(@"Plugins\PluginDriverExample4");

            WorkSpace.Instance.PlugInsManager.AddPluginPackage(pluginFolder);
        }
 public void TestInitialize()
 {
     WorkSpace.Init(new WorkSpaceEventHandler());
     WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();
     gingerRunner = new GingerExecutionEngine(new GingerRunner(), Amdocs.Ginger.Common.eExecutedFrom.Automation);
     if (WorkSpace.Instance.Solution?.SolutionOperations == null)
     {
         WorkSpace.Instance.Solution.SolutionOperations = new SolutionOperations(WorkSpace.Instance.Solution);
     }
 }
        internal static SolutionRepository CreateWorkspaceAndOpenSolution(string path)
        {
            WorkSpaceEventHandler WSEH = new WorkSpaceEventHandler();

            WorkSpace.Init(WSEH);
            WorkSpace.Instance.RunningFromUnitTest = true;
            WorkSpace.Instance.SolutionRepository  = GingerSolutionRepository.CreateGingerSolutionRepository();
            WorkSpace.Instance.SolutionRepository.Open(path);
            return(WorkSpace.Instance.SolutionRepository);
        }
Beispiel #14
0
        public static void ClassInit(TestContext context)
        {
            SeleniumDriver mDriver = null;

            mGR = new GingerRunner();
            mGR.CurrentSolution = new Ginger.SolutionGeneral.Solution();

            mBF            = new BusinessFlow();
            mBF.Activities = new ObservableList <Activity>();
            mBF.Name       = "BF Test Screen Shot Action";
            mBF.Active     = true;

            Activity activity = new Activity();

            mBF.Activities.Add(activity);
            mBF.CurrentActivity = activity;

            Platform p = new Platform();

            p.PlatformType = ePlatformType.Web;
            mBF.TargetApplications.Add(new TargetApplication()
            {
                AppName = "WebApp"
            });
            mBF.CurrentActivity.TargetApplication = "WebApp";
            mDriver                   = new SeleniumDriver(GingerCore.Drivers.SeleniumDriver.eBrowserType.Chrome);
            mDriver.AutoDetect        = true;
            mDriver.HttpServerTimeOut = 60;
            mDriver.StartDriver();

            Agent a = new Agent();

            a.Active     = true;
            a.Driver     = mDriver;
            a.DriverType = Agent.eDriverType.SeleniumChrome;

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

            ApplicationAgent AA = new ApplicationAgent();

            AA.AppName = "WebApp";
            AA.Agent   = a;

            mGR.ApplicationAgents.Add(AA);
            mGR.CurrentBusinessFlow = mBF;
            mGR.SetCurrentActivityAgent();

            // use helper !!!!
            Reporter.ToLog(eLogLevel.DEBUG, "Creating the GingerCoreNET WorkSpace");
            WorkSpaceEventHandler WSEH = new WorkSpaceEventHandler();

            WorkSpace.Init(WSEH);
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();
        }
Beispiel #15
0
        public static void ClassInitialize(TestContext TC)
        {
            CreateTestSolution();

            // Init SR
            mSolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();
            Ginger.App.InitClassTypesDictionary();
            string TempRepositoryFolder = TestResources.GetTestTempFolder(@"Solutions\SRTestTemp");

            mSolutionRepository.Open(TempRepositoryFolder);
        }
Beispiel #16
0
        public static void ClassInit(TestContext context)
        {
            AgentOperations agentOperations = new AgentOperations(wsAgent);

            wsAgent.AgentOperations = agentOperations;

            WorkSpace.Init(new WorkSpaceEventHandler());
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();

            // Init SR
            SolutionRepository mSolutionRepository = WorkSpace.Instance.SolutionRepository;

            string TempRepositoryFolder = TestResources.GetTestTempFolder(Path.Combine("Solutions", "temp"));

            mSolutionRepository.Open(TempRepositoryFolder);
            Ginger.SolutionGeneral.Solution sol = new Ginger.SolutionGeneral.Solution();
            sol.ContainingFolderFullPath = TempRepositoryFolder;
            WorkSpace.Instance.Solution  = sol;
            if (WorkSpace.Instance.Solution.SolutionOperations == null)
            {
                WorkSpace.Instance.Solution.SolutionOperations = new SolutionOperations(WorkSpace.Instance.Solution);
            }
            WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder = Path.Combine(TempRepositoryFolder, "ExecutionResults");

            mBF            = new BusinessFlow();
            mBF.Activities = new ObservableList <Activity>();
            mBF.Name       = "BF WebServices Web API";
            mBF.Active     = true;


            Platform p = new Platform();

            p.PlatformType = ePlatformType.WebServices;


            mDriver = new WebServicesDriver(mBF);
            mDriver.SaveRequestXML        = true;
            mDriver.SavedXMLDirectoryPath = "~\\Documents";
            mDriver.SecurityType          = @"None";

            wsAgent.DriverType = Agent.eDriverType.WebServices;
            ((AgentOperations)wsAgent.AgentOperations).Driver = mDriver;
            ApplicationAgent mAG = new ApplicationAgent();

            mAG.Agent = wsAgent;

            mGR          = new GingerRunner();
            mGR.Executor = new GingerExecutionEngine(mGR);

            ((GingerExecutionEngine)mGR.Executor).SolutionAgents = new ObservableList <Agent>();
            ((GingerExecutionEngine)mGR.Executor).SolutionAgents.Add(wsAgent);

            mGR.Executor.BusinessFlows.Add(mBF);
        }
Beispiel #17
0
        public void TestInitialize()
        {
            WorkSpace.Init(new WorkSpaceEventHandler());
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();
            File.Copy(excelPathWrite, excelPathWriteTemp, true);

            if (WorkSpace.Instance.Solution?.SolutionOperations == null)
            {
                WorkSpace.Instance.Solution.SolutionOperations = new SolutionOperations(WorkSpace.Instance.Solution);
            }
        }
Beispiel #18
0
        public static void ClassInit(TestContext context)
        {
            mBF            = new BusinessFlow();
            mBF.Activities = new ObservableList <Activity>();
            mBF.Name       = "BF Test Fire Fox";
            mBF.Active     = true;
            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.CurrentSolution = new Ginger.SolutionGeneral.Solution();

            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);



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

            SR = GingerSolutionRepository.CreateGingerSolutionRepository();
            SR.Open(path);
        }
        private async void SaveKeyBtn_Click(object sender, RoutedEventArgs e)
        {
            if (xForgetRadioButton.IsChecked.Value && UCEncryptionKey.CheckKeyCombination())
            {
                if (Reporter.ToUser(eUserMsgKey.ForgotKeySaveChanges) == Amdocs.Ginger.Common.eUserMsgSelection.Yes)
                {
                    _solution.EncryptionKey = UCEncryptionKey.EncryptionKeyPasswordBox.Password;
                    _solution.SolutionOperations.SaveEncryptionKey();
                    _solution.SolutionOperations.SaveSolution(false);

                    uOkBtn.Visibility      = Visibility.Visible;
                    uSaveKeyBtn.Visibility = Visibility.Collapsed;
                    uCloseBtn.Visibility   = Visibility.Collapsed;

                    xForgetRadioButton.IsEnabled  = false;
                    xReplaceRadioButton.IsEnabled = false;
                    UCEncryptionKey.IsEnabled     = false;
                    validKeyAdded = true;
                    await LoadEncryptedParamtersList();
                }
            }
            else if (xReplaceRadioButton.IsChecked.Value && UCEncryptionKeyPrevious.ValidateKey() && UCEncryptionKey.CheckKeyCombination())
            {
                this.ShowLoader();
                ShowStatusMessage("Updating new encryption key for solution");
                uSaveKeyBtn.Visibility  = Visibility.Collapsed;
                uCloseBtn.Visibility    = Visibility.Collapsed;
                _solution.EncryptionKey = UCEncryptionKey.EncryptionKeyPasswordBox.Password;
                _solution.SolutionOperations.SaveEncryptionKey();
                _solution.SolutionOperations.SaveSolution(false);
                if (WorkSpace.Instance.SolutionRepository == null)
                {
                    WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();
                    WorkSpace.Instance.SolutionRepository.Open(_solution.ContainingFolderFullPath);
                    WorkSpace.Instance.Solution = _solution;
                }
                int varReencryptedCount = await HandlePasswordValuesReEncryption(UCEncryptionKeyPrevious.EncryptionKeyPasswordBox.Password);

                this.HideLoader();
                HideStatusMessage();
                if (varReencryptedCount > 0)
                {
                    Reporter.ToUser(eUserMsgKey.StaticInfoMessage, varReencryptedCount + " Variables Re-encrypted using new Encryption key across Solution.\n Please check in all changes to source control");
                }

                xSolutionPasswordsParamtersGrid.Visibility = Visibility.Collapsed;
                validKeyAdded = true;

                _pageGenericWin.Close();
            }
        }
        // Combine to one in core !!!!!!!!!!!!!!!!!!!!!

        private static void OpenSolution(string sFolder)
        {
            if (Directory.Exists(sFolder))
            {
                Console.WriteLine("Opening Solution at folder: " + sFolder);
                SR = GingerSolutionRepository.CreateGingerSolutionRepository();
                WorkSpace.Instance.SolutionRepository = SR;
                SR.Open(sFolder);
            }
            else
            {
                Console.WriteLine("Directory not found: " + sFolder);
            }
        }
        public static void CreateWorkspaceWithTempSolution(string solutionFolderName)
        {
            WorkSpace.Init(new WorkSpaceEventHandler());
            WorkSpace.Instance.RunningFromUnitTest = true;
            WorkSpace.Instance.SolutionRepository  = GingerSolutionRepository.CreateGingerSolutionRepository();

            string solutionfolder = TestResources.GetTestTempFolder(solutionFolderName);

            if (Directory.Exists(solutionfolder))
            {
                Directory.Delete(solutionfolder, true);
            }
            WorkSpace.Instance.SolutionRepository.CreateRepository(solutionfolder);
            WorkSpace.Instance.SolutionRepository.Open(solutionfolder);
        }
Beispiel #22
0
        private static void CreateTestSolution()
        {
            // First we create a basic solution with some sample items
            SolutionRepository SR = new SolutionRepository();
            string             TempRepositoryFolder = TestResources.GetTestTempFolder(@"Solutions\SRTestTemp");

            if (Directory.Exists(TempRepositoryFolder))
            {
                Directory.Delete(TempRepositoryFolder, true);
            }


            SR = GingerSolutionRepository.CreateGingerSolutionRepository();
            SR.Open(TempRepositoryFolder);

            ProjEnvironment E1 = new ProjEnvironment()
            {
                Name = "E1"
            };

            SR.AddRepositoryItem(E1);



            //RepositoryFolder<MyRepositoryItem> BFRF = SR.GetRepositoryItemRootFolder<MyRepositoryItem>();
            //RepositoryFolder<MyRepositoryItem> SubFolder1 = (RepositoryFolder<MyRepositoryItem>)BFRF.AddSubFolder("SubFolder1");

            //BFRF.AddSubFolder("EmptySubFolder");

            //MyRepositoryItem BF4 = new MyRepositoryItem("A4");
            //SubFolder1.AddRepositoryItem(BF4);

            //// Folder to delete later
            //BFRF.AddSubFolder("SubFolderForDelete");

            //// Create folders tree
            //RepositoryFolder<MyRepositoryItem> SF1 = (RepositoryFolder<MyRepositoryItem>)BFRF.AddSubFolder("SF1");
            //RepositoryFolder<MyRepositoryItem> SF2 = (RepositoryFolder<MyRepositoryItem>)SF1.AddSubFolder("SF1_SF2");
            //RepositoryFolder<MyRepositoryItem> SF3 = (RepositoryFolder<MyRepositoryItem>)SF2.AddSubFolder("SF1_SF2_SF3");
            //MyRepositoryItem BF5 = new MyRepositoryItem("A5");
            //SubFolder1.AddRepositoryItem(BF5);

            //MyRepositoryItem BF6 = new MyRepositoryItem("A6");
            //SF3.AddRepositoryItem(BF6);

            //TODO: add more sample items for testing
            SR.Close();
        }
Beispiel #23
0
        private static void CreateTestSolution()
        {
            // First we create a basic solution with some sample items
            SolutionRepository SR = new SolutionRepository();
            string             TempRepositoryFolder = TestResources.GetTestTempFolder(@"Solutions\" + solutionName);

            if (Directory.Exists(TempRepositoryFolder))
            {
                Directory.Delete(TempRepositoryFolder, true);
            }

            SR = GingerSolutionRepository.CreateGingerSolutionRepository();
            SR.Open(TempRepositoryFolder);

            SR.Close();
        }
Beispiel #24
0
        public static void ClassInitialize(TestContext TC)
        {
            solutionName = "SRVarSync";
            CreateTestSolution();

            // Creating workspace
            WorkSpace.Init(new WorkSpaceEventHandler());
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();

            // Init SR
            mSolutionRepository = WorkSpace.Instance.SolutionRepository;
            Ginger.App.InitClassTypesDictionary();
            string TempRepositoryFolder = TestResources.GetTestTempFolder(@"Solutions\" + solutionName);

            mSolutionRepository.Open(TempRepositoryFolder);
        }
Beispiel #25
0
        public static void ClassInitialize(TestContext TC)
        {
            string TempSolutionFolder = TestResources.GetTestTempFolder(@"Solutions" + Path.DirectorySeparatorChar + "APIModelsTest");

            if (Directory.Exists(TempSolutionFolder))
            {
                Directory.Delete(TempSolutionFolder, true);
            }
            SR = GingerSolutionRepository.CreateGingerSolutionRepository();


            SR.CreateRepository(TempSolutionFolder);

            NewRepositorySerializer RS = new NewRepositorySerializer();

            NewRepositorySerializer.AddClassesFromAssembly(NewRepositorySerializer.eAssemblyType.GingerCoreCommon);
            SR.Open(TempSolutionFolder);
        }
        public static void ClassInitialize(TestContext TC)
        {
            string TempSolutionFolder = TestResources.GetTestTempFolder(@"Solutions\APIModelsTest");

            if (Directory.Exists(TempSolutionFolder))
            {
                Directory.Delete(TempSolutionFolder, true);
            }
            SR = GingerSolutionRepository.CreateGingerSolutionRepository();


            SR.CreateRepository(TempSolutionFolder);

            NewRepositorySerializer RS = new NewRepositorySerializer();

            NewRepositorySerializer.AddClassesFromAssembly(typeof(ApplicationAPIModel).Assembly);
            SR.Open(TempSolutionFolder);
        }
Beispiel #27
0
        private static void CreateTestSolution()
        {
            string sourceFolder = TestResources.GetTestResourcesFolder(@"Solutions\ReportSR");

            solutionFolder = TestResources.GetTestTempFolder(@"Solutions\ReportSR");
            if (Directory.Exists(solutionFolder))
            {
                Directory.Delete(solutionFolder, true);
            }
            CopyDir.Copy(sourceFolder, solutionFolder);

            SolutionRepository SR = new SolutionRepository();

            SR = GingerSolutionRepository.CreateGingerSolutionRepository();
            SR.Open(solutionFolder);

            SR.Close();
        }
Beispiel #28
0
        public static void ClassInit(TestContext context)
        {
            WorkSpace.Init(new WorkSpaceEventHandler());
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();

            // Init SR
            SolutionRepository mSolutionRepository = WorkSpace.Instance.SolutionRepository;

            Ginger.App.InitClassTypesDictionary();
            string TempRepositoryFolder = TestResources.GetTestTempFolder(Path.Combine("Solutions", "temp"));

            mSolutionRepository.Open(TempRepositoryFolder);
            Ginger.SolutionGeneral.Solution sol = new Ginger.SolutionGeneral.Solution();
            sol.ContainingFolderFullPath = TempRepositoryFolder;
            WorkSpace.Instance.Solution  = sol;

            mBF            = new BusinessFlow();
            mBF.Activities = new ObservableList <Activity>();
            mBF.Name       = "BF WebServices Web API";
            mBF.Active     = true;


            Platform p = new Platform();

            p.PlatformType = ePlatformType.WebServices;


            mDriver = new WebServicesDriver(mBF);
            mDriver.SaveRequestXML        = true;
            mDriver.SavedXMLDirectoryPath = "~\\Documents";
            mDriver.SecurityType          = @"None";

            wsAgent.DriverType = Agent.eDriverType.WebServices;
            wsAgent.Driver     = mDriver;
            ApplicationAgent mAG = new ApplicationAgent();

            mAG.Agent = wsAgent;

            mGR = new GingerRunner();
            mGR.SolutionAgents = new ObservableList <Agent>();
            mGR.SolutionAgents.Add(wsAgent);

            mGR.BusinessFlows.Add(mBF);
        }
        public static void ClassInit(TestContext context)
        {
            TargetFrameworkHelper.Helper = new DotNetFrameworkHelper();

            mBF            = new BusinessFlow();
            mBF.Activities = new ObservableList <Activity>();
            mBF.Name       = "BF Non-Driver Action Test";
            mBF.Active     = true;

            Activity activity = new Activity();

            mBF.Activities.Add(activity);
            mBF.CurrentActivity = activity;

            mGR          = new GingerRunner();
            mGR.Executor = new GingerExecutionEngine(mGR);

            mGR.Executor.CurrentSolution     = new Ginger.SolutionGeneral.Solution();
            mGR.Executor.CurrentBusinessFlow = mBF;
            mGR.Executor.BusinessFlows.Add(mBF);


            Reporter.ToLog(eLogLevel.DEBUG, "Creating the GingerCoreNET WorkSpace");
            WorkSpaceEventHandler WSEH = new WorkSpaceEventHandler();

            WorkSpace.Init(WSEH);
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();

            if (((Solution)mGR.Executor.CurrentSolution).SolutionOperations == null)
            {
                ((Solution)mGR.Executor.CurrentSolution).SolutionOperations = new SolutionOperations((Solution)mGR.Executor.CurrentSolution);
            }
            if (WorkSpace.Instance.Solution == null)
            {
                WorkSpace.Instance.Solution = (Solution)mGR.Executor.CurrentSolution;
            }
            if (WorkSpace.Instance.Solution.SolutionOperations == null)
            {
                WorkSpace.Instance.Solution.SolutionOperations = new SolutionOperations(WorkSpace.Instance.Solution);
            }
        }
Beispiel #30
0
        public static void ClassInit(TestContext context)
        {
            mGR          = new GingerRunner();
            mGR.Executor = new GingerExecutionEngine(mGR);

            mBF            = new BusinessFlow();
            mBF.Activities = new ObservableList <Activity>();
            mBF.Name       = "DB Test";
            mBF.Active     = true;

            Activity activity = new Activity();

            mBF.Activities.Add(activity);
            mBF.CurrentActivity = activity;

            mGR.Executor.CurrentBusinessFlow = mBF;

            WorkSpaceEventHandler WSEH = new WorkSpaceEventHandler();

            WorkSpace.Init(WSEH);
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();
        }