testing-library / testcafe-testing-library

:ox: Simple and complete custom Selectors for Testcafe that encourage good testing practices.
http://npm.im/@testing-library/testcafe
MIT License
71 stars 15 forks source link

Error: Cannot call method 'queryByRole' of undefined(experimentalProxyless: true) #379

Open Roy412 opened 1 year ago

Roy412 commented 1 year ago

Describe the bug Unable to use the testing-library selector with the experimentalProxyless option of testcafe enabled, which is previously proxyless.

To Reproduce Steps to reproduce the behavior:

  1. Clone the demo repo: https://github.com/Roy412/msw-testcafe-error/tree/testing_library_compatibility
  2. Install the packages: yarn
  3. Run the testcafe test: yarn testcafe
  4. You can see the failure with the error Error: Cannot call method 'queryByRole' of undefined

Expected behavior The selectors should work with the experimentalProxyless option enabled.

Screenshots

Screenshot 2022-12-21 at 4 27 31 PM

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Note that it uses 2.2.0-rc.1 version of TestCafe. For older versions, the option name is proxyless. Interestingly, withexperimentalProxyless option disabled, the test passes. And of course, the selectors from testcafe library work too.