TestCafe v1.18.0 Released

TestCafe v1.18.0 includes a new experimental Selector debugging capability, important improvements for macOS users and a number of routine bug fixes.

Note

If you run TestCafe on macOS, follow the Upgrade Guide to make sure your upgrade goes smoothly.

New Debugging Capabilities (Experimental)

If you launch TestCafe with the --experimental-debug flag, you can debug Selectors and Client Functions in the Watch panel of a Node.js debugger.

macOS improvements

TestCafe Browser Tools on Apple Silicon

The TestCafe Browser Tools package is a communication layer that automates browsers on behalf of TestCafe. Both the TestCafe framework and TestCafe Studio include the TestCafe Browser Tools binary.

Earlier versions of TestCafe Browser Tools were optimized for the x86-64 architecture. Apple Silicon Macs ran those binaries through the Rosetta 2 translation layer. Rosetta 2 took up additional space and prevented TestCafe from taking full advantage of the processor.

TestCafe v1.18.0 includes a Universal TestCafe Browser Tools binary that runs natively on both x64 Macs and Apple Silicon Macs.

Follow the Upgrade Instructions to make sure your version of TestCafe Browser Tools is up to date.

TestCafe Browser Tools macOS Permission Fix

The TestCafe Browser Tools binary requires special privileges to automate browsers and take screenshots. Security improvements in recent versions of macOS made these privileges harder to obtain.

Prior to TestCafe v1.18.0, each installation of TestCafe and TestCafe Studio included a TestCafe Browser Tools binary. macOS users with multiple sets of TestCafe Browser Tools had to go through a lengthy process to obtain the necessary permissions.

TestCafe v1.18.0 and TestCafe Studio v1.7 address this issue. Beginning with this version, all TestCafe installations share a single TestCafe Browser Tools binary. TestCafe stores this binary in the user’s Home directory, inside the hidden ~/.testcafe-browser-tools folder.

Follow the Upgrade Instructions to reset TestCafe Browser Tools’ permissions and enable the new binary.

Upgrade Instructions

Step 1. Reset Application Permissions

  1. Execute the following shell command to reset screen recording permissions: tccutil reset ScreenCapture com.devexpress.testcafe-browser-tools
  2. Execute the following shell command to reset automation permissions: tccutil reset AppleEvents com.devexpress.testcafe-browser-tools

Step 2. Install The New Version and Run it

  1. Install TestCafe v1.18.0 or greater: npm i -g testcafe
  2. Check the version string to confirm the installation: testcafe --version.
  3. Launch a TestCafe test with the newly installed version.

Step 3. Re-Authorize TestCafe Browser Tools

Demonstration

  1. Open the “Security and Privacy” pane of the “System Preferences” dialog.
  2. Click the lock in the bottom left of the dialog. Log in when the system prompts you.
  3. Select the “Screen Recording” item in the “Privacy” tab sidebar.
  4. If the application list on the right contains the “TestCafe Browser Tools” entry, remove it.
  5. Click the “+” button to add a new entry.
  6. Navigate to your home folder. Press "Cmd"+"Shift"+"." to view hidden files and folders.
  7. Enter the .testcafe-browser-tools folder and select the TestCafe Browser Tools application.

Bug Fixes

  • TestCafe immediately closes new windows (#6680)
  • Tests fail with the TypeError: Invalid value used as weak map key. error (#6563)
  • The latest version of the TestCafe Docker image cannot connect to Chrome and Chromium (#6436)
  • TestCafe loses test error call stack and outputs the following message instead: "Uncaught object "[object Object]" (Issue #6624. Discovered by @danieltroger, PR by @rob4629.)
  • Lack of definitions for two new timeout options results in TypeScript compilation errors (#6713)
  • TypeScript filter functions erroneously require a Promise return value (#6705)