Specifically, the testController.navigateTo
function throws a Cannot read property 'destUrl' of null
if the Testing Library TestCafe extension has been loaded. The fixture.page
method behaves as expected.
- There are 2 .testcaferc.json files: one which attempts to load Testing Library as a module, and one which does not. They both fail with the same underlying error, but one first throws an additional "injecting module" error.
- Clone the repo
git clone git@github.com:SamuelDavis/testing-library-testcafe-integration.git;
- Change into the created directory
cd testing-library-testcafe-integration;
- Install dependencies
npm install;
- Run the test script locally...
npx testcafe chrome tests.js;
...or via docker...
docker run --rm -it -v $PWD:/mnt -w /mnt --env NODE_PATH=/mnt/node_modules testcafe/testcafe chromium tests.js;
This is as described in the docs; see .testcaferc.from-the-docs.json for reference)
An error occurred in the '@testing-library/dom/dist/@testing-library/dom.umd.js' module injected into the tested page. Make sure that this module can be executed in the browser environment.
Error details:
TypeError: Cannot read property 'destUrl' of null
An error occurred in a script injected into the tested page:
TypeError: Cannot read property 'destUrl' of null