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

#280 configuration for selenide messages #281

Merged
merged 7 commits into from
Nov 22, 2024

Conversation

wurzelkuchen
Copy link
Contributor

No description provided.

@wurzelkuchen wurzelkuchen linked an issue Aug 2, 2024 that may be closed by this pull request
4 tasks

Choose a reason for hiding this comment

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

I think it is better to set the showSelenideErrorDetails property to true in testErrorDetailesActived and to false in testErrorDetailesDeActived and I would change the name of the tests (Actived to Activated).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair enough, changed it

Choose a reason for hiding this comment

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

what is this? :o

Copy link
Contributor

Choose a reason for hiding this comment

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

required to make it work, therefore, should stay

Choose a reason for hiding this comment

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

what is this? :o

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like it's really not required here. Please, remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Contributor

@oomelianchuk oomelianchuk left a comment

Choose a reason for hiding this comment

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

cosmetic changes requested

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like it's really not required here. Please, remove


if (Neodymium.configuration().showSelenideErrorDetails())
{
return Strings.join(super.generateErrorDetails(error, driver, screenshot, timeoutMs));
Copy link
Contributor

Choose a reason for hiding this comment

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

return value is a string, so we probably don't need Strings.join here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct. removed it.

Comment on lines +25 to +29
StringBuilder sb = new StringBuilder();
return sb.append("(")
.append(timeout(timeoutMs))
.append(")")
.toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

can we reuse the functionality Selenide offers?

Suggested change
StringBuilder sb = new StringBuilder();
return sb.append("(")
.append(timeout(timeoutMs))
.append(")")
.toString();
return join("(" + timeout(timeoutMs) + ")");

or maybe with cause (because sometimes SERE may appear in cause instead of actual message and it may be useful to know that the exception was cause by SERE)

Suggested change
StringBuilder sb = new StringBuilder();
return sb.append("(")
.append(timeout(timeoutMs))
.append(")")
.toString();
return join("(" + timeout(timeoutMs) + ")", causedBy(error.getCause()));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as agreed in the call, we keep the stringbuilder as is

Copy link
Contributor

Choose a reason for hiding this comment

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

required to make it work, therefore, should stay

@wurzelkuchen wurzelkuchen merged commit 97d7a2e into develop Nov 22, 2024
@wurzelkuchen wurzelkuchen deleted the #280-configuration-for-selenide-messages branch November 22, 2024 13:03
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.

Improvement: Add Configuration for Selenide Error Messages
3 participants