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

API Testing

  API Testing (feature)   Retried   Firefox 131.0 (browser)   1 To 10 Seconds (Duration)   Linux 6.5.0-1025-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.7
Accept-Encoding: gzip, compress, deflate, br

Response Headers

date: Mon, 11 Nov 2024 22:34:58 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=1730850344&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&s=WgYs5NpA2xvOMlGQrJx10XwKdh8Rd4A8fzVRNzzIaF4%3D"}]}
reporting-endpoints: heroku-nel=https://nel.heroku.com/reports?ts=1730850344&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&s=WgYs5NpA2xvOMlGQrJx10XwKdh8Rd4A8fzVRNzzIaF4%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: 1730850397
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: 24537
server: cloudflare
cf-ray: 8e11c0b1ebefd634-IAD
alt-svc: h3=":443"; ma=86400
server-timing: cfL4;desc="?proto=TCP&rtt=5249&sent=3&recv=5&lost=0&retrans=0&sent_bytes=2828&recv_bytes=682&delivery_rate=559890&cwnd=245&unsent_bytes=0&cid=2da761a67030903a&ts=25&x=0"

Response Body

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