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
{{ message }}
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
This guide gives you all the info to create your first Multistep check with Checkly. You should have some prior
22
-
knowledge of working with JavaScript and/or Node.js.
22
+
knowledge of working with JavaScript/TypeScript and/or Node.js.
23
23
24
24
## What is a Multistep check?
25
25
26
-
Multistep checks enable you to write Node.js scripts that can run multiple API requests in sequence. They allow you to monitor entire API user flows with a single check. Make requests, parse response data and perform more requests to mimic and test API user behavior. Multistep checks ensure that combined API interactions lead to the correct results.
26
+
Multistep checks enable you to write Node.js Playwright scripts that can run multiple API requests in sequence. They allow you to monitor entire API user flows with a single check. Make requests, parse response data and perform more requests to mimic and test API user behavior. Multistep checks ensure that combined API interactions lead to the correct results.
27
27
28
28
Examples of API sequences might be:
29
29
@@ -77,7 +77,7 @@ Let's look at the code above step-by-step.
77
77
78
78
**1. Initial declarations:** To run any Multistep check, import the Playwright test framework.
79
79
80
-
**2. Define our headers:** In many cases you will have to authenticate when requesting data by providing authorization headers. Use [environment variables](/docs/browser-checks/variables/) to avoid having any confidential data in our test.
80
+
**2. Define our headers:** In many cases, you will have to authenticate when requesting data by providing authorization headers. Use [environment variables](/docs/browser-checks/variables/) to avoid having any confidential data in your test.
81
81
82
82
**3. Establish environment:** Create a new test and leverage the Playwright `request` fixture to make API requests in the test steps.
83
83
@@ -86,7 +86,7 @@ Let's look at the code above step-by-step.
86
86
>[!NOTE]
87
87
> Always use `await` before `test.step`, otherwise the test will fail.
88
88
89
-
**5. Define our assertion:** Use the `expect(response)` method to assert if the response was successful (the response code is in the range of 200 - 299) with `toBeOK()`. Should the request return anything outside of the 'OK' range, this will cause the check to fail and in a production scenario trigger any configured alerts.
89
+
**5. Define our assertion:** Use the `expect(response)` method to assert if the response was successful (the response code is in the range of 200 - 299) with `toBeOK()`. Should the request return anything outside of the 'OK' range, the check will fail and in a production scenario, trigger any configured alerts.
90
90
91
91
**6. Return the response for future usage:** Return the request response in JSON format, so we can use it in the next test step.
92
92
@@ -174,8 +174,7 @@ You can run your check as an [E2E test](/docs/testing) locally or from your CI/C
174
174
175
175
## Built-in runtime variables
176
176
177
-
The Multistep check [runtime](/docs/runtimes/) exposes a set of environment variables (e.g. `process.env.CHECK_NAME`)
178
-
to figure out what check, check type etc. you are running.
177
+
The Multistep check [runtime](/docs/runtimes/) exposes a set of environment variables (e.g. `process.env.CHECK_NAME`) that indicate what check, check type etc. you are running.
@@ -186,7 +185,7 @@ As with Browser checks, Checkly runs Multistep checks for a maximum of 240s. Scr
186
185
187
186
The [Checkly CLI](/docs/cli/) gives you a JavaScript/TypeScript-native workflow for coding, testing and deploying synthetic monitoring at scale, from your code base.
188
187
189
-
You can define a Multistep check via the CLI. Unlike Browser checks, Multistep checks always need to be defined in a construct before assigning a `spec.js|ts` file. For example:
188
+
You can define a Multistep check via the CLI. Unlike Browser checks, Multistep checks always need to be defined in a construct. For example:
0 commit comments