can not use function getReact on some components
See original GitHub issueI tried to use the component to get props of some react component in the site: http://demo.keystonejs.com/keystone/signin , but it is always return null on some react components: SigninView, AlertView, Brand, LoginForm. Please take a look at my script as below:
import ReactSelector from 'testcafe-react-selectors';
fixture `Todo App test`
.page `http://demo.keystonejs.com/keystone/signin`;
test('[demo]: login failed', async t => {
const allProps = await ReactSelector('SigninView').getReact(({props}) => {
let string
Object.keys(props).forEach((key) => {
string = string + `${key} --`;
})
return string;
})
console.log(allProps);
const allProps1 = await ReactSelector('AlertView').getReact(({props}) => {
let string
Object.keys(props).forEach((key) => {
string = string + `${key} --`;
})
return string;
})
console.log(allProps1);
const allProps2 = await ReactSelector('Brand').getReact(({props}) => {
let string
Object.keys(props).forEach((key) => {
string = string + `${key} --`;
})
return string;
})
console.log(allProps2);
const allProps3 = await ReactSelector('LoginForm').getReact(({props}) => {
let string
Object.keys(props).forEach((key) => {
string = string + `${key} --`;
})
return string;
})
console.log(allProps3);
const allProps4 = await ReactSelector('Form').getReact(({props}) => {
let string
Object.keys(props).forEach((key) => {
string = string + `${key} --`;
})
return string;
})
console.log(allProps4);
const allProps5 = await ReactSelector('FormField').getReact(({props}) => {
let string
Object.keys(props).forEach((key) => {
string = string + `${key} --`;
})
return string;
})
console.log(allProps5);
const allProps6 = await ReactSelector('Button').getReact(({props}) => {
let string
Object.keys(props).forEach((key) => {
string = string + `${key} --`;
})
return string;
})
console.log(allProps6);
})
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Get React Hook Value from outside the functional component
E.g. define your hook in the parent App component, and pass your time and setTime as prop to CountDownTimer component.
Read more >Understanding common frustrations with React Hooks
React Hooks can be frustrating despite their popularity and widespread use. Learn about some of the drawbacks to using React Hooks.
Read more >Don't call a React function component - Kent C. Dodds
I ran into an issue where if I provided a function that used hooks in its implementation and returned some JSX to the...
Read more >Find Specific Elements from the DOM in React - Pluralsight
In this guide, you are going to learn a few approaches that can help you access some specific DOM elements. Access a DOM...
Read more >Platform Specific Code - React Native
Certain components may have properties that work on one platform only. ... If those are not specified, native key will be used and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Published the new version -
testcafe-react-selectors@0.0.5
.Thanks @kirovboris ,
the latest version - testcafe-react-selectors@0.0.5 works well. This issue was fixed.