Top AI Repos โ open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
puppeteer + dom-testing-library = ๐
| Date | Stars |
|---|---|
| 2026-07-24 | 290 |
| 2026-07-25 | 290 |
| 2026-07-28 | 290 |
| 2026-07-30 | 290 |
| 2026-08-06 | 290 |
Today
โ stars today
This week
โ stars this week
This month
โ stars this month
Momentum
0.0
growth rate 0.00%/day
# pptr-testing-library
[](https://www.npmjs.com/package/pptr-testing-library)

[](https://david-dm.org/testing-library/pptr-testing-library)
[](https://discord.gg/testing-library)
[puppeteer](https://github.com/GoogleChrome/puppeteer) + [@testing-library/dom](https://github.com/testing-library/dom-testing-library) = ๐
All your favorite user-centric querying functions from @testing-library/react & @testing-library/library available from Puppeteer!
## Install
`npm install --save-dev pptr-testing-library`
## Use
```js
const puppeteer = require('puppeteer')
const {getDocument, queries, waitFor} = require('pptr-testing-library')
const {getByTestId, getByLabelText} = queries
const browser = await puppeteer.launch()
const page = await browser.newPage()
// Grab ElementHandle for document
const $document = await getDocument(page)
// Your favorite query methods are available
const $form = await getByTestId($document, 'my-form')
// returned elements are ElementHandles too!
const $email = await getByLabelText($form, 'Email')
// interact with puppeteer like usual
await $email.type('[email protected]')
// waiting works too!
await waitFor(() => getByText($document, 'Loading...'))
```
A little too un-puppeteer for you? We've got prototype-mucking covered too :)
```js
const puppeteer = require('puppeteer')
require('pptr-testing-library/extend')
const browser = await puppeteer.launch()
const page = await browser.newPage()
// getDocument is added to prototype of Page
const $document = await page.getDocument()
// query methods are added directly to prototype of ElementHandle
const $form = await $document.getByTestId('my-form')
// destructing works if you explicitly call getQueriesForElement
const {getByText} = $form.getQueriesForElement()
// ...
```
## Version Compat
| Puppeteer Version | pptr-testing-library Version |
| ----------------- | ---------------------------- |
| 17+ | >0.8.0 |
| <17 | 0.7.x |
## API
Unique methods, not part of `@testing-library/dom`
- `getDocument(page: puppeteer.Page): ElementHandle` - get an ElementHandle for the document
- `wait(conditionFn: () => {}): Promise<{}>` - wait for the condition to not throw (wrapper around `waitForExpect`)
---
[@testing-library/dom API](https://github.com/testing-library/dom-testing-library#usage). All `get*`/`query*` methods are supported.
- `getQueriesForElement(handle: ElementHandle): ElementHandle & QueryUtils` - extend the input object with the query API and return it
- `getNodeText(handle: ElementHandle): Promise<string>` - get the text content of the element
- `queries: QueryUtils` - the query subset of `@testing-library/dom` exports
- `queryByPlaceholderText`
- `queryAllByPlaceholderText`
- `getByPlaceholderText`
- `getAllByPlaceholderText`
- `findByPlaceholderText`
- `findAllByPlaceholderText`
- `queryByText`
- `queryAllByText`
- `getByText`
- `getAllByText`
- `findByText`
- `findAllByText`
- `queryByLabelText`
- `queryAllByLabelText`
- `getByLabelText`
- `getAllByLabelText`
- `findByLabelText`
- `findAllByLabelText`
- `queryByAltText`
- `queryAllByAltText`
- `getByAltText`
- `getAllByAltText`
- `findByAltText`
- `findAllByAltText`
- `queryByTestId`
- `queryAllByTestId`
- `getByTestId`
- `getAllByTestId`
- `findByTestId`
- `findAllByTestId`
- `queryByTitle`
- `queryAllByTitle`
- `getByTitle`
- `getAllByTitle`
- `findByTitle`
- `findAllByTitle`
- `queryByRole`
- `queryAllByRole`
- `getByRole`
- `getAllByRole`
- `findBExcerpt of 4,739 characters
Read on GitHubWould you bet a product on this? Bounded 0โ100 and slow moving.
matched fp:9b0cb4a2e1756d3e, topic:testing