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

extract Conditions to separate classes #912

Merged
merged 1 commit into from May 3, 2019

Conversation

Projects
None yet
3 participants
@asolntsev
Copy link
Contributor

commented Feb 19, 2019

Proposed changes

split big Condition class to many small classes.

Checklist

  • Checkstyle and unit tests pass locally with my changes by running gradle check chrome htmlunit command
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@asolntsev asolntsev self-assigned this Feb 19, 2019

@rosolko rosolko added this to the 5.3.0 milestone Apr 3, 2019

@muescha
Copy link

left a comment

some nitpicks

return getName() + " '" + expectedCssClass + '\'';
}

private <T> boolean contains(T[] objects, T object) {

This comment has been minimized.

Copy link
@muescha

muescha Apr 17, 2019

this generic should better go into a util or helper class

This comment has been minimized.

This comment has been minimized.

Copy link
@asolntsev

asolntsev May 11, 2019

Author Contributor

@muescha Thank you for your comments! I will try to make these improvements in a next pull request.


private String getAttributeValue(WebElement element, String attributeName) {
String attr = element.getAttribute(attributeName);
return attr == null ? "" : attr;

This comment has been minimized.

Copy link
@muescha

muescha Apr 17, 2019

this can also be into a util or helper class
or just use org.apache.commons.lang3.StringUtils.defaultString


private String getValueAttribute(WebElement element) {
String attr = element.getAttribute("value");
return attr == null ? "" : attr;

This comment has been minimized.

Copy link
@muescha

muescha Apr 17, 2019

StringUtils.defaultString


@Override
public String toString() {
return getName() + " '" + expectedText + '\'';

This comment has been minimized.

Copy link
@muescha

muescha Apr 17, 2019

why sometimes "'" (3 lines above) and sometimes '\''?

@rosolko rosolko merged commit c5efb14 into master May 3, 2019

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build failed
Details

@rosolko rosolko deleted the extract-condition-to-classes branch May 3, 2019

@asolntsev asolntsev modified the milestones: 5.3.0, 5.2.3 May 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.