Skip to content

An example repo demonstrating that Testing Library and TestCafe don't integrate successfully.

Notifications You must be signed in to change notification settings

SamuelDavis/testing-library-testcafe-integration

Repository files navigation

@TestingLibrary/TestCafe Breaks TestCafe Navigation

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.

Caveats

  • 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.

Steps to Reproduce

  1. Clone the repo
git clone git@github.com:SamuelDavis/testing-library-testcafe-integration.git;
  1. Change into the created directory
cd testing-library-testcafe-integration;
  1. Install dependencies
npm install;
  1. 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;

Error output (trying to load Testing Library as a module):

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

Error output (loading Testing Library directly from node_modules):

An error occurred in a script injected into the tested page:

TypeError: Cannot read property 'destUrl' of null

About

An example repo demonstrating that Testing Library and TestCafe don't integrate successfully.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published