Serenity/JS with Playwright Test
Home > API Testing > JSON placeholder /todos should retrieve a todo item by id
Report generated 17-12-2024 17:36

API Testing

  API Testing (feature)   Retried   Firefox 132.0 (browser)   1 To 10 Seconds (Duration)   Linux 6.8.0-1017-Azure (platform)

JSON Placeholder /todos should retrieve a todo item by id
 

Cast

 

Alice can:
  • PerformActivities (PerformActivitiesAsPlaywrightSteps)
  • AnswerQuestions
  • RaiseErrors
  • ScheduleWork { scheduler: { clock: { timeAdjustment: { milliseconds: 0 } }, interactionTimeout: { milliseconds: 5000 } } }
  • BrowseTheWeb (BrowseTheWebWithPlaywright)
  • TakeNotes { notepad: {} }
  • CallAnApi { baseURL: "https://jsonplaceholder.typicode.com", headers: { common: { Accept: "application/json, text/plain, */*" } }, timeout: 10000 }
Steps Outcome
Alice sends a GET request to '/todos/1'

Response

URL: https://jsonplaceholder.typicode.com/todos/1

Status code: 200

Request Headers

Accept: application/json, text/plain, */*
User-Agent: axios/1.7.9
Accept-Encoding: gzip, compress, deflate, br

Response Headers

date: Tue, 17 Dec 2024 17:36:44 GMT
content-type: application/json; charset=utf-8
transfer-encoding: chunked
connection: close
report-to: {"group":"heroku-nel","max_age":3600,"endpoints":[{"url":"https://nel.heroku.com/reports?ts=1732623056&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&s=th%2BW2M%2FapJKmQqnrXipOe5fJuCpNSkg%2FbaRXtQauxsI%3D"}]}
reporting-endpoints: heroku-nel=https://nel.heroku.com/reports?ts=1732623056&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&s=th%2BW2M%2FapJKmQqnrXipOe5fJuCpNSkg%2FbaRXtQauxsI%3D
nel: {"report_to":"heroku-nel","max_age":3600,"success_fraction":0.005,"failure_fraction":0.05,"response_headers":["Via"]}
x-powered-by: Express
x-ratelimit-limit: 1000
x-ratelimit-remaining: 999
x-ratelimit-reset: 1732623096
vary: Origin, Accept-Encoding
access-control-allow-credentials: true
cache-control: max-age=43200
pragma: no-cache
expires: -1
x-content-type-options: nosniff
etag: W/"53-hfEnumeNh6YirfjyjaujcOPPT+s"
via: 1.1 vegur
cf-cache-status: HIT
age: 19484
server: cloudflare
cf-ray: 8f38ad587b4561a6-ORD
alt-svc: h3=":443"; ma=86400
server-timing: cfL4;desc="?proto=TCP&rtt=2100&min_rtt=2097&rtt_var=792&sent=3&recv=5&lost=0&retrans=0&sent_bytes=2825&recv_bytes=682&delivery_rate=1346534&cwnd=251&unsent_bytes=0&cid=74e469b84cf87fd6&ts=24&x=0"

Response Body

{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}
SUCCESS 139ms
Alice ensures that the status of the last response does equal 200
SUCCESS 003ms
Alice ensures that 1 does equal 1
SUCCESS 001ms
SUCCESS 1.3s
Serenity BDD version 4.1.20