[request] Sikuli logs to HTML test runner report
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Won't Fix
|
Wishlist
|
RaiMan |
Bug Description
-------
I actually found a solution on how to write my custom logs into html test runner report.For this you need: sikulixIDE,
if __name__ == "__main__":
suite = suite()
unittest.
output = open(r"your html.file report location","w+")
runner = HTMLTestRunner.
runner.
The most important thing is the Logger file, let's say MyLogger, the code looks like this:
from sikuli import *
# Severity of logged behaviour
LEVEL_FATAL, LEVEL_WARNING, LEVEL_INFO = range(0, 3)
class Messenger:
@staticmethod
def Log(severity,
switcher = {
}
messageLong = severityMessage + message
if severity == LEVEL_FATAL:
print Exception(
else:
print messageLong
Now just import MyLogger file into your tests or where you need this logger and use it like this:
import MyLogger
reload(MyLogger)
#your code
//logger call example for fatal
MyLogger.
Now when the htmlfile is generated by HTMLTestreport, the logs should be displayed there for each test(ofc based on how you organized them in your suites in TestRunner file.
I hope this works for you as for me it's really good and helpful.
-------
Hello, I am using sikuli IDE to automate a desktop app. I'm also using html-testRunner 1.1.2 to generate reports and the sikuli logger to write to a file. Here is my code for this:
Settings.
Settings.
Settings.
Debug.
Debug.
How can I write my logs directly to the HTML file generated by htlm test runner? And if possible can i write the logs separately for each test?
Thank you!
Changed in sikuli: | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → RaiMan (raimund-hocke) |
milestone: | none → 1.1.4 |
Changed in sikuli: | |
importance: | Medium → Wishlist |
Changed in sikuli: | |
status: | In Progress → Won't Fix |
milestone: | 1.1.4 → none |