https://github.com/rickcedwhat/playwright-smart-table
Production-ready table testing for Playwright with smart column-aware locators.
https://github.com/rickcedwhat/playwright-smart-table
automation e2e playwright qa table testing typescript
Last synced: 1 day ago
JSON representation
Production-ready table testing for Playwright with smart column-aware locators.
- Host: GitHub
- URL: https://github.com/rickcedwhat/playwright-smart-table
- Owner: rickcedwhat
- License: mit
- Created: 2025-12-11T00:24:23.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2026-06-20T23:42:49.000Z (8 days ago)
- Last Synced: 2026-06-21T00:18:44.659Z (8 days ago)
- Topics: automation, e2e, playwright, qa, table, testing, typescript
- Language: HTML
- Homepage: https://rickcedwhat.github.io/playwright-smart-table/
- Size: 7.82 MB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
- Roadmap: ROADMAP.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# Playwright Smart Table
**Dealing with tables sucks. Locators are brittle, hard to read, and break the moment a column moves or pagination kicks in.**
Playwright Smart Table lets you find rows by column name instead of fragile DOM positions. You describe your table — it does the rest.
[](https://www.npmjs.com/package/@rickcedwhat/playwright-smart-table)
[](https://opensource.org/licenses/MIT)
## 📚 [Full Documentation →](https://rickcedwhat.github.io/playwright-smart-table/)
---
```typescript
// ❌ Before — breaks if columns reorder
const row = page.locator('tbody tr')
.filter({ has: page.locator('td:nth-child(1)', { hasText: 'John' }) })
.filter({ has: page.locator('td:nth-child(2)', { hasText: 'Doe' }) })
const email = await row.locator('td:nth-child(3)').innerText()
```
```typescript
// ✅ After — column-aware, survives reordering
const row = table.getRow({ firstName: 'John', lastName: 'Doe' })
const email = await row.getCell('Email').innerText()
```
---
## Installation
```bash
npm install @rickcedwhat/playwright-smart-table
```
## Quick Start
```typescript
import { useTable } from '@rickcedwhat/playwright-smart-table';
const table = await useTable(page.locator('#my-table')).init();
const row = table.getRow({ Name: 'John Doe' });
const email = await row.getCell('Email').innerText();
```
## Features
- [Row access](https://rickcedwhat.github.io/playwright-smart-table/guide/query/) — find rows by column name, not DOM index
- [Pagination search](https://rickcedwhat.github.io/playwright-smart-table/guide/query/find-rows) — `findRow` and `findRows` scan across pages automatically
- [Iteration](https://rickcedwhat.github.io/playwright-smart-table/guide/query/iterate) — `forEach`, `map`, `filter`, with early exit via `stop()`
- [Table config](https://rickcedwhat.github.io/playwright-smart-table/guide/describe/) — plug in any pagination shape, virtual scroll, or custom header logic
- [Fill / edit cells](https://rickcedwhat.github.io/playwright-smart-table/guide/query/write) — write values back into table cells
---
- [Documentation](https://rickcedwhat.github.io/playwright-smart-table/)
- [npm Package](https://www.npmjs.com/package/@rickcedwhat/playwright-smart-table)
- [GitHub Repository](https://github.com/rickcedwhat/playwright-smart-table)
- [Issues](https://github.com/rickcedwhat/playwright-smart-table/issues)
- [Discussions](https://github.com/rickcedwhat/playwright-smart-table/discussions) — questions and ideas
MIT © Cedrick Catalan