-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When an alert handler fails to run, log useful information #230
Changes from 4 commits
487fa9a
53231a9
e38828f
b3eaa67
79e55af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,10 +155,15 @@ + (void)parseEventType:(SISLLogEventType *)type subtype:(SISLLogEventSubtype *)s | |
} else { | ||
subtypeValue = SISLLogEventSubtypeTestFailure; | ||
|
||
// message format: "SLKeyboardTest.m:62: ..." | ||
NSArray *messageComponents = [message componentsSeparatedByString:@":"]; | ||
infoValue[@"fileName"] = messageComponents[0]; | ||
infoValue[@"lineNumber"] = @([messageComponents[1] integerValue]); | ||
|
||
// In some rare circumstances, Subliminal may log an error with no call site, | ||
// for example when an error is raised within the JS code. | ||
if (messageComponents.count > 2) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah good catch. I guess some of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I think a more apt description would be: "In rare circumstances, Subliminal may log an error with no call site." (the error's not coming from |
||
// Subliminal standard message format: "SLKeyboardTest.m:62: ..." | ||
infoValue[@"fileName"] = messageComponents[0]; | ||
infoValue[@"lineNumber"] = @([messageComponents[1] integerValue]); | ||
} | ||
} | ||
} else { | ||
typeValue = SISLLogEventTypeDefault; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about the
onAlert
function pushing/popping the timeout? Then that would cover any handler, not just-dismissWithButtonTitled:
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also let's make the timeout 5 seconds--that's the default (used by UIAutomation absent Subliminal; and by all of Subliminal's APIs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with this is that we're going to wait 5 seconds for each registered alert that doesn't match on the title. I think I can fix it by modifying the dismissWithButton logic though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wrong, thanks for correcting me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, thanks for double-checking!