Open tommyiswhoiam opened 1 year ago
Hi @tommyiswhoiam That would indeed be a good feature to have.
Relating to the implementation, we could maybe fit it in the existing format with filters. We could also apply them to predicate value.
Relating to operators, we have already used them for predicates (eg ==
for equals)
.
Similarly for filters +
for add
.
The first step would be therefore to try to apply filters to predicate value.
That would be useful to create literals.
eg.
cookie "SESSION_ID[Expired]" == "2023-02-13T12:37:53+00:00" toDateIso8601
I open #1872 a few hours ago.
Looks like this is the answer.. Looking forward for this new feature.
Any updates?
Problem to solve
The problem is that the hurl library does not currently support math operations in the Assets section of a test case. This makes it difficult for users to perform calculations on captured data and use it to make assertions in their tests.
Proposal
The proposal is to add support for basic math operations (e.g. addition, subtraction, multiplication, division) in the Assets section of a test case. This will allow users to perform calculations on captured data and use it to make assertions in their tests.
For example, the following code will be possible:
Additional context and resources
This feature would be useful for users who need to perform calculations on captured data and make assertions based on the results. It is a common use case in API testing, where users need to perform calculations on returned data to verify that it meets certain conditions.
There are other API testing tools that already support this feature, such as Postman and SoapUI. Adding this feature to the hurl library will make it more competitive with these tools.
Tasks to complete