DevExpress / testcafe-react-selectors

TestCafe selector extensions for React apps.
https://testcafe.io
MIT License
205 stars 43 forks source link

Allow optional argument for boundTestRun #147

Closed theoinglis closed 5 years ago

theoinglis commented 5 years ago

There is an error running waitForReact in a node callback instead of a testcafe test due to the ClientFunction not being able to automatically pick up the testController.

ClientFunction cannot implicitly resolve the test run in context of which it should be executed. If you need to call ClientFunction from the Node.js API callback, pass the test controller manually via ClientFunction's .with({ boundTestRun: t }) method first. Note that you cannot execute ClientFunction outside the test code.

Here is the issue as described in the testcafe documentation: https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors/edge-cases-and-limitations.html#calling-selectors-from-nodejs-callbacks

And by allowing an optional argument to pass in the testController it allows people to fix this issue and use it in different use cases (in my case I am using gherkin-testcafe)

Please let me know if you need any more details.