public static void ClassInitialize(TestContext TC)
        {
            string TempSolutionFolder = TestResources.GetTestTempFolder(@"Solutions\APIModelsTest");

            if (Directory.Exists(TempSolutionFolder))
            {
                Directory.Delete(TempSolutionFolder, true);
            }
            SR = new SolutionRepository();

            SR.AddItemInfo <ApplicationAPIModel>("*.Ginger.ApplicationAPIModel.xml", @"~\Applications Models\API Models", true, "API Models", PropertyNameForFileName: nameof(ApplicationAPIModel.Name));
            // SR.AddItemInfo<GlobalAppModelParameter>("*.Ginger.GlobalAppModelParameter.xml", @"~\Applications Models\Global Models Parameters", true, "Global Model Parameters", addToRootFolders: true, PropertyNameForFileName: nameof(GlobalAppModelParameter.PlaceHolder));

            SR.CreateRepository(TempSolutionFolder);

            NewRepositorySerializer RS = new NewRepositorySerializer();

            NewRepositorySerializer.AddClassesFromAssembly(typeof(ApplicationAPIModel).Assembly);
            SR.Open(TempSolutionFolder);
        }
Esempio n. 2
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
            });

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

            WorkSpace.Instance.Solution = sol;
        }
Esempio n. 3
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);

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

            SR.AddRepositoryItem(E1);

            SR.Close();
        }
Esempio n. 4
0
        public void InstalledPluginPackageFromOnline()
        {
            //Arrange

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

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

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

            SolutionRepository solutionRepository = new SolutionRepository();

            solutionRepository.AddItemInfo <PluginPackage>("*.Ginger.PluginPackage.xml", @"~\Plugins", true, "Plugins", PropertyNameForFileName: nameof(PluginPackage.PluginId));
            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);
        }
Esempio n. 5
0
        public static void ClassInitialize(TestContext TC)
        {
            TempRepositoryFolder = TestResources.GetTestTempFolder("Solutions", "SRMultiThreadTestTemp");
            Console.WriteLine("SolutionRepositoryTest folder: " + TempRepositoryFolder);

            Console.WriteLine("===> Creating test solution");
            CreateTestSolution();
            Console.WriteLine("===> test solution created");

            mRepositorySerializer = new NewRepositorySerializer();
            // Init SR
            mSolutionRepository = new SolutionRepository();
            mSolutionRepository.AddItemInfo <MyRepositoryItem>(pattern: "*.Ginger.MyRepositoryItem.xml",   // Need to use for file name
                                                               rootFolder: SolutionRepository.cSolutionRootFolderSign + "MyRepositoryItems",
                                                               containRepositoryItems: true,
                                                               displayName: "My Repository Item",
                                                               PropertyNameForFileName: nameof(MyRepositoryItem.Name)
                                                               );

            NewRepositorySerializer RS = new NewRepositorySerializer();

            NewRepositorySerializer.AddClassesFromAssembly(typeof(MyRepositoryItem).Assembly);
            mSolutionRepository.Open(TempRepositoryFolder);
        }
Esempio n. 6
0
        public static void ClassInitialize(TestContext TestContext)
        {
            WorkspaceHelper.CreateDummyWorkSpace();

            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.Init(SR);
            WorkSpace.Instance.PlugInsManager.AddPluginPackage(pluginFolder);
        }
Esempio n. 7
0
        public void VerifyButtonsOnStartThenCancel()
        {
            //Arrange
            string folder = TestResources.GetTestTempFolder("MyWizardItemsFolder1");

            //Act
            WizardPOM mWizard             = ShowMyWizard(folder);
            bool      nextButtonEnabled   = mWizard.NextButton.IsEnabled;
            bool      prevButtonEnabled   = mWizard.PrevButton.IsEnabled;
            bool      finishButtonEnabled = mWizard.FinishButton.IsEnabled;

            mWizard.CancelButton.Click();
            bool WizardOpen = WizardPOM.IsWizardOpen;

            mGingerAutomator.MainWindowPOM.TakeScreenShot(mTestHelper.GetTempFileName("Wizard Screen Shot.png"));
            //Artifacts


            //Assert
            Assert.IsTrue(nextButtonEnabled, "Next button is enabled");
            Assert.IsFalse(prevButtonEnabled, "Prev button is disabled");
            Assert.IsTrue(finishButtonEnabled, "Finish button is enabled");
            Assert.IsFalse(WizardOpen, "Wizard was closed");
        }
        public static void ClassInit(TestContext context)
        {
            BF1        = new BusinessFlow();
            BF1.Name   = "VariableDependancyTest";
            BF1.Active = true;

            ActivitiesGroup activityGroup = new ActivitiesGroup();

            Activity activity1 = new Activity();

            activity1.Active = true;

            ActDummy actDummy1 = new ActDummy();

            actDummy1.Active = true;
            ActDummy actDummy2 = new ActDummy();

            actDummy2.Active = true;

            activity1.Acts.Add(actDummy1);
            activity1.Acts.Add(actDummy2);


            Activity activity2 = new Activity();

            activity2.Active = true;

            ActDummy actDummy3 = new ActDummy();

            actDummy3.Active = true;
            ActDummy actDummy4 = new ActDummy();

            actDummy4.Active = true;

            ActDummy actDummy7 = new ActDummy();

            actDummy7.Active = true;
            ActDummy actDummy8 = new ActDummy();

            actDummy8.Active = true;

            activity2.Acts.Add(actDummy3);
            activity2.Acts.Add(actDummy4);
            activity2.Acts.Add(actDummy7);
            activity2.Acts.Add(actDummy8);

            Activity activity3 = new Activity();

            activity3.Active = true;

            ActDummy actDummy5 = new ActDummy();

            actDummy5.Active = true;
            ActDummy actDummy6 = new ActDummy();

            actDummy6.Active = true;

            activity3.Acts.Add(actDummy5);
            activity3.Acts.Add(actDummy6);

            activityGroup.AddActivityToGroup(activity1);
            activityGroup.AddActivityToGroup(activity2);
            activityGroup.AddActivityToGroup(activity3);

            BF1.Activities.Add(activity1);
            BF1.Activities.Add(activity2);
            BF1.Activities.Add(activity3);

            BF1.ActivitiesGroups.Add(activityGroup);

            Platform p = new Platform();

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

            if (WorkSpace.Instance != null && WorkSpace.Instance.Solution != null && WorkSpace.Instance.Solution.LoggerConfigurations != null)
            {
                string TempRepositoryFolder = TestResources.GetTestTempFolder(Path.Combine("Solutions", "temp"));
                WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder = Path.Combine(TempRepositoryFolder, "ExecutionResults");
                WorkSpace.Instance.Solution.SolutionOperations = new SolutionOperations(WorkSpace.Instance.Solution);
            }



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

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

            ProjEnvironment environment = new ProjEnvironment();

            environment.Name = "Default";
            BF1.Environment  = environment.Name;

            Agent a = new Agent();

            a.DriverType = Agent.eDriverType.SeleniumChrome;

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

            Context context1 = new Context();

            context1.BusinessFlow = BF1;
            context1.Activity     = BF1.Activities[0];

            mGR.Executor.CurrentBusinessFlow = BF1;
            mGR.Executor.CurrentBusinessFlow.CurrentActivity = BF1.Activities[0];
            mGR.Executor.Context = context1;
        }
Esempio n. 9
0
        public void TestInitialize()
        {
            WorkSpace.Init(new WorkSpaceEventHandler());
            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();

            // Init SR
            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;
            mSolutionRepository.StopAllRepositoryFolderWatchers();

            WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder = Path.Combine(TempRepositoryFolder, "ExecutionResults");

            runset      = new RunSetConfig();
            runset.Name = "NewRunset1";
            WorkSpace.Instance.RunsetExecutor.RunSetConfig = runset;
            runner                 = new GingerRunner();
            runner.Name            = "Runner1";
            runner.CurrentSolution = new Ginger.SolutionGeneral.Solution();
            WorkSpace.Instance.RunsetExecutor.Runners.Add(runner);
            mEnv      = new ProjEnvironment();
            mEnv.Name = "Environment1";
            EnvApplication app1 = new EnvApplication();

            app1.Name = "App1";
            app1.Url  = "URL123";
            mEnv.Applications.Add(app1);
            GeneralParam GP1 = new GeneralParam();

            GP1.Name  = "GP1";
            GP1.Value = "GP1Value";
            app1.GeneralParams.Add(GP1);

            mBF      = new BusinessFlow();
            mBF.Name = "Businessflow1";
            runner.BusinessFlows.Add(mBF);
            mActivity              = new GingerCore.Activity();
            mActivity.Active       = true;
            mActivity.ActivityName = "Activity1";
            mAct             = new ActDummy();
            mAct.Active      = true;
            mAct.Description = "Action1";
            mActivity.Acts.Add(mAct);
            mActivity.Acts.CurrentItem = mAct;
            mBF.AddActivity(mActivity);


            BusinessFlow BF1 = new BusinessFlow();

            BF1.Name = "Businessflow2";
            runner.BusinessFlows.Add(BF1);
            GingerCore.Activity activity = new GingerCore.Activity();
            activity.Active       = true;
            activity.ActivityName = "Activity1";
            ActDummy dummy = new ActDummy();

            dummy.Active      = true;
            dummy.Description = "Dummy1";
            activity.Acts.Add(dummy);
            activity.Acts.CurrentItem = dummy;
            BF1.AddActivity(activity);
        }