This repository has been deprecated in favor of Testing Playground, which contains the functionality provided here and can be downloaded through the Chrome Web Store.
When using testing-library, some developers may not be aware of
which query to use. As a
result, folks will jump to using escape hatches like *ByTestId
or
querySelector
.
This chrome extension aims to enable developers to find a better query when writing tests. Right click on an element on any web page and it will copy the best possible query for that element into your clipboard. Then simply paste into your test code.
Install from the chrome web store
-
Download a release from the releases page.
-
Unzip the file
-
make sure developer mode is on
-
Click "Load Unpacked"
-
Browse to '/path/to/where/you/unzipped
-
click select
- clone & install:
git clone [email protected]:testing-library/which-query.git
cd which-query
npm i
npm run build:chrome:dev
-
in chrome navigate to chrome://extensions
-
make sure developer mode is on
-
Click "Load Unpacked"
-
Browse to '/path/to/where/you/cloned/chrome/build/unpacked'
-
click select
Use Testing Library in the browser console
Get a Query by inspecting elements in devtools
I'm not aware of any, if you are please make a pull request and add it here!
Looking to contribute? Look for the Good First Issue label.
Please file an issue for bugs, missing documentation, or unexpected behavior.
Please file an issue to suggest new features. Vote on feature requests by adding a 👍. This helps maintainers prioritize what to work on.
Thanks goes to these people (emoji key):
Ben Monro 💻 |
Stephan Meijer 🤔 |
Kent C. Dodds 🤔 |
Nick McCurdy 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT