public static void SetupLogging(Eyes eyes, [CallerMemberName] string testName = null) { ILogHandler logHandler; if (!RUNS_ON_CI) { string path = InitLogPath(testName); eyes.DebugScreenshotProvider = new FileDebugScreenshotProvider() { Path = path, Prefix = testName + "_" }; logHandler = new FileLogHandler(Path.Combine(path, testName + ".log"), true, true); //if (eyes.runner_ is VisualGridRunner visualGridRunner) //{ // visualGridRunner.DebugResourceWriter = new FileDebugResourceWriter(path); // ((VisualGridEyes)eyes.activeEyes_).debugResourceWriter_ = visualGridRunner.DebugResourceWriter; //} } else { logHandler = new NunitLogHandler(false); } if (logHandler != null) { eyes.SetLogHandler(logHandler); } Eyes.moveWindow_ = !Debugger.IsAttached; }
public static void SetupLogging(EyesRunner runner, [CallerMemberName] string testName = null, string path = null) { ILogHandler logHandler; if (!RUNS_ON_CI) { path = path ?? InitLogPath(testName); logHandler = new FileLogHandler(Path.Combine(path, testName + ".log"), true, true); //if (eyes.runner_ is VisualGridRunner visualGridRunner) //{ // visualGridRunner.DebugResourceWriter = new FileDebugResourceWriter(path); // ((VisualGridEyes)eyes.activeEyes_).debugResourceWriter_ = visualGridRunner.DebugResourceWriter; //} } else { logHandler = new NunitLogHandler(false); } if (logHandler != null) { runner.SetLogHandler(logHandler); logHandler.Open(); } }
public static void SetupLogging(EyesBase eyes, [CallerMemberName] string testName = null) { ILogHandler logHandler = null; if (!RUNS_ON_CI) { string path = InitLogPath(testName); eyes.DebugScreenshotProvider = new FileDebugScreenshotProvider() { Path = path, Prefix = testName + "_" }; logHandler = new FileLogHandler(Path.Combine(path, testName + ".log"), true, true); } else { logHandler = new NunitLogHandler(false); } if (logHandler != null) { eyes.SetLogHandler(logHandler); } }