cypress-react-selector
Advanced tools
Comparing version 0.1.8 to 1.0.1
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
const waitForReact = (timeout = 10000, reactRoot = '#root') => { | ||
const waitForReact = (timeout = 10000, reactRoot) => { | ||
cy.readFile('node_modules/resq/dist/index.js', 'utf8', { log: false }).then( | ||
@@ -9,0 +9,0 @@ (script) => { |
{ | ||
"name": "cypress-react-selector", | ||
"version": "0.1.8", | ||
"version": "1.0.1", | ||
"description": "cypress plugin to locate react elements by component, props and state", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
# cypress-react-selector | ||
[![Build Status](https://circleci.com/gh/abhinaba-ghosh/cypress-react-selector.svg?style=shield&branch-=master)](https://app.circleci.com/pipelines/github/abhinaba-ghosh/cypress-react-selector) | ||
[![NPM release](https://img.shields.io/npm/v/cypress-react-selector.svg 'NPM release')](https://www.npmjs.com/package/cypress-react-selector) | ||
[![PayPal donation](https://github.com/jaymoulin/jaymoulin.github.io/raw/master/ppl.png 'PayPal donation')](https://paypal.me/abhinabaghosh) | ||
_cypress-react-selector_ is a lightweight plugin to help you to locate web elements in your REACT app using components, props and states.. This extension allow you to select page elements in a way that is native to React. This will help you in functional UI tests and E2E tests. | ||
_cypress-react-selector_ is a lightweight plugin to help you to locate web elements in your REACT app using components, props and states. This extension allow you to select page elements in a way that is native to React. This will help you in functional UI tests and E2E tests. | ||
@@ -104,3 +106,3 @@ Internally, cypress-react-selector uses a library called [resq](https://github.com/baruchvlz/resq) to query React's VirtualDOM in order to retrieve the nodes. | ||
this will wait to load react inside your app. By-default it will assume that the react root is set to '#root'. In the example above the id of the root element is set to 'root'. So, you don't need to pass the the root selector | ||
this will wait to load react inside your app. `waitForReact` automatically find out the react root of your application. | ||
@@ -115,3 +117,3 @@ The default timeout for `waitForReact` is `10000` ms. You can specify a custom timeout value: | ||
It is always not true that the root of React app is set to 'root', may be your root element is 'mount', like: | ||
It may even possible that you have different REACT roots (different REACT instances in same application). In this case, you can specify the `CSS Selector` of the target `root`. | ||
@@ -127,3 +129,3 @@ ```js | ||
There is some application which displays react components asynchronously. The cypress-react-selector by-default assumes the react root element is set to 'root', if you have different root element, you need to pass that information to the react selector. | ||
There is some application which displays react components asynchronously. You need to pass `root selector` information to the react selector. | ||
@@ -130,0 +132,0 @@ ```ts |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
21128
0
272