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

Add karate end to end test for reminder feature (#6385) #6443

Merged
merged 1 commit into from May 14, 2024

Conversation

quinarygio
Copy link
Contributor

Fix #6385

Comment on lines 66 to 69
* 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())
Copy link
Contributor

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)'}
Copy link
Contributor

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)

Comment on lines 67 to 69
* 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())
Copy link
Contributor

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

Suggested change
* 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>
Copy link

sonarcloud bot commented May 13, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@freddidierRTE freddidierRTE self-assigned this May 14, 2024
@freddidierRTE freddidierRTE merged commit 7d262b2 into develop May 14, 2024
8 checks passed
@freddidierRTE freddidierRTE deleted the FE-6385-card-reminder-test branch May 14, 2024 11:33
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.

End to end test for reminder feature
2 participants