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

Adding date-specific Filters #1309

Closed
fabricereix opened this issue Feb 24, 2023 · 2 comments · Fixed by #1373
Closed

Adding date-specific Filters #1309

fabricereix opened this issue Feb 24, 2023 · 2 comments · Fixed by #1373
Labels
enhancement New feature or request
Milestone

Comments

@fabricereix
Copy link
Collaborator

We can add data-specific filters to make it easier to use our new date type in our asserts.

To test a date value than can change (such an SSL certification expiration date), we can use the interval between this date and the current execution time (now)

Starting with a duration in days: daysFromNow and/or daysUntilNow

Should we allow negative value?
daysFromNow would be positive if the date in the future while daysUntilNow would be positive if the date is in the past.

Or provide these 2 filters and only allow positive value?

@fabricereix fabricereix added the enhancement New feature or request label Feb 24, 2023
@jcamiel
Copy link
Collaborator

jcamiel commented Feb 27, 2023

daysAfterNow daysBeforeNow?

@fabricereix
Copy link
Collaborator Author

we will therefore implement the 2 flavors xxxAfterNow/xxxBeforeNow for each duration unit: days, hours, minutes, ....
They can both return negative value, but using the one returning the positive value will be recommended.

For example, assert that the certificate is still valid for the next 30 days.

[Asserts]
certificate "Expire-Date" daysAfterNow > 30

@fabricereix fabricereix linked a pull request Mar 17, 2023 that will close this issue
@jcamiel jcamiel added this to the 3.0.0 milestone Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants