Exemplo n.º 1
0
        public static void ClassInit(TestContext context)
        {
            string solutionfolder = TestResources.GetTempFolder("GingerVariableTests");

            WorkspaceHelper.CreateWorkspaceWithTempSolution(solutionfolder);


            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.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

            mGR.SolutionAgents = new ObservableList <Agent>();
            mGR.SolutionAgents.Add(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);
        }
Exemplo n.º 2
0
        static void Prep()
        {
            // 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);

            WorkspaceHelper.CreateWorkspaceWithTempSolution("sol1");

            // Add the plugin to solution
            string pluginFolder = TestResources.GetTestResourcesFolder(@"Plugins" + Path.DirectorySeparatorChar + "PluginDriverExample4");

            WorkSpace.Instance.PlugInsManager.Init(WorkSpace.Instance.SolutionRepository);
            WorkSpace.Instance.PlugInsManager.AddPluginPackage(pluginFolder);


            Console.WriteLine("LocalGingerGrid Status: " + WorkSpace.Instance.LocalGingerGrid.Status);
        }
Exemplo n.º 3
0
        public static void ClassInitialize(TestContext TestContext)
        {
            mTestHelper.ClassInitialize(TestContext);

            mTestHelper.Log("Creating temp solution");
            // Init workspace
            string solutionFolder = TestResources.GetTempFolder("WebPlatformPluginTest");

            WorkspaceHelper.CreateWorkspaceWithTempSolution(solutionFolder);


            // To debug SeleniumPlugin start the plugin from VS to register to LocalGrid
            string pluginFolder = TestResources.GetTestResourcesFolder("Plugins" + Path.DirectorySeparatorChar + "SeleniumPlugin");

            WorkSpace.Instance.PlugInsManager.Init(WorkSpace.Instance.SolutionRepository);
            mTestHelper.Log("Adding SeleniumPlugin from: " + pluginFolder);
            WorkSpace.Instance.PlugInsManager.AddPluginPackage(pluginFolder);

            // Start Agent

            agent           = new Agent();
            agent.AgentType = Agent.eAgentType.Service;
            agent.PluginId  = "SeleniumPlugin";
            agent.ServiceId = "SeleniumChromeService";
            mTestHelper.Log("StartDriver SeleniumPlugin SeleniumChromeService");
            agent.AgentOperations.StartDriver();

            GingerGrid GG        = WorkSpace.Instance.LocalGingerGrid;
            Stopwatch  stopwatch = Stopwatch.StartNew();

            mTestHelper.Log("Waiting for node to connect");
            while (GG.NodeList.Count == 0 && stopwatch.ElapsedMilliseconds < 10000)   // wait max 10 seconds
            {
                mTestHelper.Log("GG.NodeList.Count == 0");
                Thread.Sleep(100);
            }

            if (GG.NodeList.Count == 0)
            {
                throw new Exception("GG.NodeList.Count == 0");
            }

            mTestHelper.Log("Done Waiting");
        }