Serenity/JS with Mocha
Home > Math-js API > POST /v4 supports calculating multiple expressions in one request
Report generated 21-11-2024 00:51

Math-Js API

  Math-Js API (feature)   Under 1 Second (Duration)

POST /v4 supports calculating multiple expressions in one request
 

Cast

 

Apisitt can:
  • PerformActivities
  • AnswerQuestions
  • RaiseErrors
  • ScheduleWork { scheduler: { clock: { timeAdjustment: { milliseconds: 0 } }, interactionTimeout: { milliseconds: 5000 } } }
  • CallAnApi { baseURL: "http://api.mathjs.org/v4/", headers: { common: { Accept: "application/json, text/plain, */*" } }, timeout: 10000 }
  • TakeNotes { notepad: {} }
Steps Outcome
Apisitt sends a request to calculate 2 + 2, 5 - 3

Response

URL: http://api.mathjs.org/v4

Status code: 200

Content Type: application/json

Request Headers

Accept: application/json, text/plain, */*
Content-Type: application/json
User-Agent: axios/1.7.7
Content-Length: 26
Accept-Encoding: gzip, compress, deflate, br

Content Body

{"expr":["2 + 2","5 - 3"]}

Response Headers

server: Cowboy
report-to: {"group":"heroku-nel","max_age":3600,"endpoints":[{"url":"https://nel.heroku.com/reports?ts=1732150306&sid=c46efe9b-d3d2-4a0c-8c76-bfafa16c5add&s=xTFPoYP39xQF2llqEyfJ7HXOVEVJxDYPR4sC0jSLC5Y%3D"}]}
reporting-endpoints: heroku-nel=https://nel.heroku.com/reports?ts=1732150306&sid=c46efe9b-d3d2-4a0c-8c76-bfafa16c5add&s=xTFPoYP39xQF2llqEyfJ7HXOVEVJxDYPR4sC0jSLC5Y%3D
nel: {"report_to":"heroku-nel","max_age":3600,"success_fraction":0.005,"failure_fraction":0.05,"response_headers":["Via"]}
connection: close
x-powered-by: Express
x-ratelimit-limit: 100000
x-ratelimit-remaining: 96017
date: Thu, 21 Nov 2024 00:51:46 GMT
x-ratelimit-reset: 1732194328
access-control-allow-origin: *
access-control-allow-headers: Content-Type, X-Requested-With
access-control-allow-methods: GET, POST, OPTIONS
content-type: application/json; charset=utf-8
content-length: 33
etag: W/"21-PDaWl99xbv/H4ay/y9fMm3Dv4GM"
vary: Accept-Encoding
via: 1.1 vegur

Response Body

{
"result": [
"4",
"2"
],
"error": null
}
SUCCESS 083ms
Apisitt ensures that the body of the last response does equal { result: [ "4", "2" ], error: null }
SUCCESS
SUCCESS 0.12s
Serenity BDD version 4.1.20