You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a way to run Lightweight API based journeys that does not involve launching browsers for every run, instead rely on the APIRequest API provided by Playwright core to do Web API testing.
Proposal
The agent will introduce a new API for registering and running these API based checks.
Users would import this API and configure the tests.
import{apijourney,monitor,expect}from"@elastic/synthetics";apijourney('test example.com',async({ request, params })=>{// monitor configurations would still work as usualmonitor.use({schedule: 10,locations: ["us_east1"]});constresp=awaitrequest.get('https://example.com/api/getText',{params: {id: params.id},});constdata=resp.json();expect(data).toEqual({text: 'Hello, World!'});});
difference with journey API and request context exposed.
Does not require spinning a new browser instance, instead each api journey will create a separate APIRequestContext which have its own cookie storage.
The request object exposed by the browser journey API does share the same context configurations meaning the cookies will be shared based between API requests and Page requests.
Summary
Introduce a way to run Lightweight API based journeys that does not involve launching browsers for every run, instead rely on the
APIRequest
API provided by Playwright core to do Web API testing.Proposal
The agent will introduce a new API for registering and running these API based checks.
DSL
Usage
Users would import this API and configure the tests.
difference with
journey
API and request context exposed.request
object exposed by the browser journey API does share the same context configurations meaning the cookies will be shared based between API requests and Page requests.Addresses #137
The text was updated successfully, but these errors were encountered: