question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can not use function getReact on some components

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kirovboriscommented, May 24, 2017

Published the new version - testcafe-react-selectors@0.0.5.

1reaction
mario8xcommented, May 25, 2017

Thanks @kirovboris ,

the latest version - testcafe-react-selectors@0.0.5 works well. This issue was fixed.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found