async
and await
is supported.
The output of the step is set to the final return value. This value must be serializable (e.g. you cannot return a class
or a function
).
{{ }}
expressions{{}}
expressions within JavaScript steps. There is no need to do
so since any variables and functions can be referenced directly.{{ env.USERNAME }}@gmail.com
, which might evaluate to something like johndoe@gmail.com
.
You should not include a return
statement in these expressions.
window
, document
, and other browser APIs. This is useful for interacting with the page directly, such as manipulating the DOM or accessing browser-specific features.
axios
: For making HTTP/HTTPS requests. Please see the official
documentation for usage and examples.assert
: For executing assertions based on variables and constants. Please see the official
Node.js documentation for usage and
examples.faker
: For generating mock data. Please see the official
documentation for usage and examples.moment
: For creating and manipulating Date
objects. Please see the official
documentation for usage and examples.createAppAuth
: For authenticating with the GitHub API as a GitHub app. Please see the official
documentation for usage and examples.Octokit
: For interacting with the GitHub API. Using this function may incur additional runtime. Please see the official
documentationpg
: For interacting with PostgreSQL databases. Please see the official
documentation for usage and
examples.setVariable
: For setting a variable in the test context. Read more in Variables.
sms
: For sending and receiving SMS messages. Read more in SMS.
email
: For sending and receiving email messages. Read more in Email.
ai
: For interacting with an LLM to generate text. Read more in Generating text.
extractCookiesFromResponse
: For extracting cookies from a Response object, which is the type returned from fetch
and axios
calls. The cookies are returned in a format compatible with Playwright as well as the Load auth state step.