taiko-react
taiko-react
allows you to select React components on the webpage that you want to perform tests on.
It uses resq to find the React components.
Pre-requisites
- The webpage that is being tested needs to be using React.
- React needs to be running in development mode (not production).
Install
npm i taiko-react
Usage
Load up the plugin and navigate to the React powered webpage ⚡️
const openBrowser goto loadPlugin = const ID clientHandler react = await await await
Now you may use various selectors to find React elements on the page 🔎
Select using a string
const selection = await
Select using a React component class
Component /* ... */ const selection = await
Select using a function
{ return <div>Hello world!</div>} const selection = await
Select using a React component instance
const selection = await
API
.exists()
-> Boolean
Checks whether the component exists.
const selection = await
.length()
-> Number
Finds the number of said components.
const list = await const listItem = await
Functional tests
Status
Repository
taiko-react/taiko-react-functional-tests
Made with 💟 + ☕️ from 🇮🇳