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
Add karate end to end test for reminder feature (#6385) #6443
Conversation
d8a0be3
to
2dcc515
Compare
* def hours = new java.lang.Integer(new Date().getHours()) | ||
* def minutes = new java.lang.Integer(new Date().getMinutes() + 2) | ||
* def seconds = new java.lang.Integer(new Date().getSeconds()) |
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.
I think it s gone to create problems particularly when the current time is close to the end of the hour (e.g., 10:59). In such cases, adding 2 minutes would result in a time with 61 minutes, which is not valid.
I suggest to first create a date + 2 min ( new Date().valueOf() + 2*60*1000
)
and then extract hours/minutes/seconds from this new object
|
||
|
||
#Create new perimeter | ||
* callonce read('../common/createPerimeter.feature') {perimeter: '#(perimeter)', token: '#(authTokenAdmin)'} |
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.
i realize that we are using every where callonce
, but we can use call
instead in a lot of place (callonce just cache the result , so it is interesting when getting token)
2dcc515
to
0aa1a31
Compare
* def hours = new java.lang.Integer(new Date().getHours()) | ||
* def minutes = new java.lang.Integer(new Date(now + 2*60*1000).getMinutes()) | ||
* def seconds = new java.lang.Integer(new Date().getSeconds()) |
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.
As for minutes it has to be the same for hours otherwise 9:59 will ends up to 9:01
* def hours = new java.lang.Integer(new Date().getHours()) | |
* def minutes = new java.lang.Integer(new Date(now + 2*60*1000).getMinutes()) | |
* def seconds = new java.lang.Integer(new Date().getSeconds()) | |
* def datePlus2Min = new java.lang.Integer(new Date(now + 2*60*1000)) | |
* def hours = new java.lang.Integer(datePlus2Min.getHours()) | |
* def minutes = new java.lang.Integer(datePlus2Min.getMinutes()) | |
* def seconds = new java.lang.Integer(datePlus2Min.getSeconds()) | |
Signed-off-by: Giovanni Ferrari <giovanni.ferrari@soft.it>
0aa1a31
to
86085b7
Compare
Quality Gate passedIssues Measures |
Fix #6385