Skip to content

API Reference

Use the API reference when you already know the method, config option, or strategy you need. If you are still learning the library, start with Getting Started or Examples.

Main References

  • TableConfig: selectors, strategies, debug, pagination limits, and column overrides.
  • Table Methods: getRow, findRow, findRows, map, forEach, sorting, reset, and more.
  • SmartRow: row-level helpers like getCell, toJSON, smartFill, and bringIntoView.
  • SmartRowArray: array returned by findRows() and filter().
  • Strategies: built-in and custom pagination, sorting, header, cell, fill, and viewport behavior.

Quick Method Map

NeedAPI
Configure selectors or behaviorTableConfig
Find rows and iterate pagesTable Methods
Read or interact with a rowSmartRow
Convert many rows to JSONSmartRowArray
Adapt custom table behaviorStrategies

Minimal Usage

typescript
import { useTable } from '@rickcedwhat/playwright-smart-table';

const table = await useTable(page.locator('#my-table')).init();
const row = table.getRow({ Name: 'John Doe' });

await expect(row.getCell('Email')).toHaveText('john@example.com');

Type Safety

Pass a row type to useTable<T>() when you want TypeScript to check filter keys and toJSON() output.

typescript
type UserRow = {
  Name: string;
  Email: string;
  Status: string;
};

const table = useTable<UserRow>(page.locator('#table'));
const user = await table.findRow({ Status: 'Active' });
const data = await user.toJSON(); // UserRow