Skip to content
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

update JSErrorsCollectorListener and JSErrorsExtension #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

update JSErrorsCollectorListener and JSErrorsExtension #3

wants to merge 4 commits into from

Conversation

mkulikov
Copy link

No description provided.

&& context.getTestClass().toString().contains("com.github.automatedowl")
&& context.getRequiredTestMethod().getName().equals("referenceErrorTest")) {
assertThrows(WebDriverException.class, ()->{
throw new WebDriverException(JS_ERRORS_EXCEPTION_STRING);
});
} 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
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
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

logger.severe(JS_ERRORS_EXCEPTION_STRING);
iTestResult.setStatus(ITestResult.FAILURE);
Assert.fail(getJSErrorsFromLogEntries(logEntries).map(LogEntry::getMessage).collect(Collectors.joining("\n")));
Copy link
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
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

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