public void TestLogAllWindows() { var myLogger = new Stf.Utilities.StfLogger { FileName = @"c:\temp\unittestlogger_TestLogAllWindows.html", LogLevel = LogLevel.Internal }; myLogger.LogTrace("Just before logging all windows"); myLogger.LogAllWindows(LogLevel.Info, "Grabbed all windows"); myLogger.LogTrace("right after logging all windows"); }
public void TestLogScreenshot() { var myLogger = new Stf.Utilities.StfLogger { FileName = @"c:\temp\unittestlogger_TestLogScreenshot.html", LogLevel = LogLevel.Internal }; myLogger.LogTrace("Just before a screenshot is taken"); myLogger.LogScreenshot(LogLevel.Info, "Grabbed screenshot"); myLogger.LogTrace("right after a screenshot is taken"); }
public void TestMethodAllLogType() { var myLogger = new Stf.Utilities.StfLogger { FileName = @"c:\temp\unittestlogger_TestMethodAllLogType.html", LogLevel = LogLevel.Internal }; myLogger.LogError("LogError"); myLogger.LogWarning("LogWarning"); myLogger.LogInfo("LogInfo"); myLogger.LogDebug("LogDebug"); // normal logging functions - models and adapters myLogger.LogTrace("LogTrace"); myLogger.LogInternal("LogInternal"); // Header logging functions - testscripts myLogger.LogHeader("LogHeader"); myLogger.LogSubHeader("LogSubHeader"); myLogger.LogFunctionEnter(LogLevel.Info, "Int", "NameOfFunction", new[] { "arg1", "arg2" }, new object[] { null }); myLogger.LogFunctionExit(LogLevel.Info, "NameOfFunction", 42); myLogger.LogFunctionEnter(LogLevel.Info, "Int", "NameOfFunctionShort"); myLogger.LogFunctionExit(LogLevel.Info, "NameOfFunctionShort"); // used solely by Assert functions myLogger.LogPass("testStepName LogPass", "LogPass"); myLogger.LogFail("testStepName LogFail", "LogFail"); myLogger.LogKeyValue("SomeKey", "SomeValue", "LogKeyValue"); myLogger.LogGet(LogLevel.Info, "MyTestProperty", myLogger); myLogger.LogSet(LogLevel.Info, "MyTestProperty", myLogger); myLogger.LogAutomationIdObject(LogLevel.Internal, myLogger, "Using myLogger as AID for test"); myLogger.SetRunStatus(); }