Code Overview
- Click on "Code" from the sidebar
- Write the code inside the
validate
function - Click "Save & Run"
What is validate()
function?
All the custom-code and logic would go inside the validate()
function in the editor.
This function is then executed in a sandbox environment (for security) and we conclude
if the step has passed/failed.
Args passed to this function:
crusherSdk
ctx
: Context object shared across the test
note
The initial code in the modal should not be edited or deleted. Press Enter at the end of line 6 to start writing the code.
Crusher SDK
Crusher SDK is our wrapper over playwright to simplfiy writing code and provide other important utilities. This is how it looks:
playwright
utils
test
- includes sleep, etc.,page
- includes verifyLink, etc.,
For more information, you can checkout the full SDK reference
Usecases
If you are interested in different use-cases you can use code for, checkout Code Usecases