CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

React locator types are throwing an error when passing props/state

Open MichaelDeBoey opened this issue 4 years ago • 3 comments

What are you trying to achieve?

When using the React locator examples from the docs, TypeScript is throwing an error at me.

What do you get instead?

Provide console output if related. Use --verbose mode for more details.

Provide test source code if related

I.click({ react: 'Tab', props: { title: 'Click Me!' }});

Details

  • CodeceptJS version: ^3.0.7
  • NodeJS Version: v16.5.0
  • Operating System: macOS
  • puppeteer

MichaelDeBoey avatar Jul 27 '21 08:07 MichaelDeBoey

Confirming, same issue with typings

codefo avatar Aug 05 '21 08:08 codefo

I'm having similar issue with playwright. It's a great feature to catch react components, I hope it's fixed ASAP

Following error is taken: page.waitForSelector: Unknown engine "react" while parsing selector react=v

erdem-atg avatar Dec 25 '21 15:12 erdem-atg

I overcame this by casting the locator to CodeceptJS.LocatorOrString, see https://github.com/codeceptjs/CodeceptJS/issues/3297

Mufasa avatar Apr 21 '22 16:04 Mufasa