Skip to content

update JSErrorsCollectorListener and JSErrorsExtension#3

Open
mkulikov wants to merge 4 commits intoAutomatedOwl:masterfrom
mkulikov:master
Open

update JSErrorsCollectorListener and JSErrorsExtension#3
mkulikov wants to merge 4 commits intoAutomatedOwl:masterfrom
mkulikov:master

Conversation

@mkulikov
Copy link
Copy Markdown

No description provided.

});
} else if (isAssertJSErrorsEnabled(context) && getJSErrorsFromLogEntries(logEntries).anyMatch(e -> true)) {
throw new WebDriverException(JS_ERRORS_EXCEPTION_STRING);
} else if (isAssertJSErrorsEnabled(context) && getJSErrorsFromLogEntries(logEntries).count()!=0) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of the change from anyMatch to count? @mkulikov

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic above returns true when there is items in list, which is more confusing than simple check for count != 0

iInvokedMethod) && getJSErrorsFromLogEntries(logEntries).count()!=0) {
logger.severe(JS_ERRORS_EXCEPTION_STRING);
iTestResult.setStatus(ITestResult.FAILURE);
Assert.fail(getJSErrorsFromLogEntries(logEntries).map(LogEntry::getMessage).collect(Collectors.joining("\n")));
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you made sure that this addition works well with closing the driver in afterMethod call? @mkulikov

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I'm sure

@mgladchenko
Copy link
Copy Markdown

Going to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants