public static void ClassInit(TestContext TC) { mTC = TC; string sampleSolutionFolder = TestResources.GetTestResourcesFolder(@"Solutions\EnvsTest"); SolutionFolder = TestResources.getGingerUnitTesterTempFolder(@"Solutions\EnvsTest"); if (Directory.Exists(SolutionFolder)) { Directory.Delete(SolutionFolder, true); } CopyDir.Copy(sampleSolutionFolder, SolutionFolder); mGingerAutomator = GingerAutomator.StartSession(); mGingerAutomator.OpenSolution(SolutionFolder); }
static int SessionCount = 0; // count how many seesions are waiting in queue public static GingerAutomator StartSession() { SessionCount++; TestMutex.WaitOne(); // Make sure we run one session at a time, wait for session to be free if (app == null) { gingerAutomatorInstance = new GingerAutomator(); gingerAutomatorInstance.StartGinger(); while (!isReady) { Thread.Sleep(100); } } return(gingerAutomatorInstance); }
public static void ClassInit(TestContext TC) { TC.WriteLine("@@@@@@@@@@@@@@@@@@@@@@ ClassInit @@@@@@@@@@@@@@@@@@@@@@@@@@@@"); mTC = TC; Console.WriteLine("===> Starting Ginger"); mGingerAutomator = new GingerAutomator(); mGingerAutomator.StartGinger(); string sampleSolutionFolder = TestResources.GetTestResourcesFolder(@"Solutions\EnvsTest"); SolutionFolder = TestResources.getGingerUnitTesterTempFolder(@"Solutions\EnvsTest"); if (Directory.Exists(SolutionFolder)) { Directory.Delete(SolutionFolder, true); } CopyDir.Copy(sampleSolutionFolder, SolutionFolder); Console.WriteLine("===> Open solution"); TC.WriteLine("@@@@@@@@@@@@@@@@@@@@@@ Open solution @@@@@@@@@@@@@@@@@@@@@@@@@@@@"); mGingerAutomator.OpenSolution(SolutionFolder); LogFile = mTC.TestLogsDir + @"\Ginger_BasicsTest.txt"; }
public static void ClassCleanup() { GingerAutomator.EndSession(); }