Skip to main content

Code Usecases

Extend your test with code steps
note

Crusher uses Playwright at the base for automation + modified wrapper on top of it (a.k.a CrusherSDK).
We currently support this only in low-code mode, code steps files are coming soon.

Core utilities
Selecting
Click
Hover
Screenshot
Assertions
const { page } = crusherSdk;
// Waits till the element is visible, with default timeout (30s)
let element = await page.waitForSelector("#button");

// Waits till the element is visible, with 5s timeout
let element = await page.waitForSelector("#button", { timeout: 5000 });
Default timeout (30s)
Page utilities
Mouse
Keyboard
// Using ‘page.mouse’ to trace a 100x100 square.
const { page } = crusherSdk;
await page.mouse.move(0, 0);
await page.mouse.down();
await page.mouse.move(0, 100);
await page.mouse.move(100, 100);
await page.mouse.move(100, 0);
await page.mouse.up();
Default timeout (30s)
Was this doc helpful?
yes
could be better
by