-
Notifications
You must be signed in to change notification settings - Fork 116
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
remove hardcoded implicitlywait #82
Conversation
|
||
public static int getTimeOutInSeconds() { | ||
try { | ||
return Integer.valueOf(System.getProperty("webdriver.timeouts.implicitlywait")); |
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.
It would be great if this can be overridden on per-element level using a @Timeout
annotation for example.
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.
Timeout annotation have been added
@artkoshelev is there any updates? |
test this please |
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { | ||
} | ||
|
||
return 1; |
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.
we should return 5 here to keep backward compatibility with previous implementation
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.
we should return 5 here to keep backward compatibility with previous implementation
in that case I have to add annotations for all elements in my project for changing value less than 5 seconds. It's redundant for 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.
can you suggest any solution to this problem?
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.
Will be this solution good for you?
private int getDefaultTimeOut() {
try {
return Integer.valueOf(System.getProperty("webdriver.timeouts.implicitlywait"));
} catch (NumberFormatException ex) {
return 5;
}
}
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.
There is default method to get integer from property with default value
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.
Do you mean this case?
Integer.getInteger(System.getProperty("webdriver.timeouts.implicitlywait"), 5);
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.
Just Integer.getInteger("webdriver.timeouts.implicitlywait", 5);
test this please |
|
||
public int getTimeOut(Field field) { | ||
if (field.isAnnotationPresent(Timeout.class)) { | ||
return field.getDeclaredAnnotation(Timeout.class).value(); |
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.
getDelcaredAnnotation(Class) method is not available in java7, please refactor this place to keep java7-compatible
@eroshenkoam @artkoshelev |
@emaks don't worry about 'test this please' it's just a phrase to run jenkins build |
@artkoshelev |
@emaks Please add test with system property usage |
done |
LGTM |
remove hardcoded implicitlywait
good job, landed! |
@artkoshelev Could you, please, tell me when next release will be? |
pull request for issue #78