Provides legacy API support for TestCafe, allowing the use of older TestCafe APIs (e.g., `fixture.page`, `test.page`, `t.setSpeed`, `t.navigateTo`, etc.) in test scripts. Current stable version is 5.1.9. The package is maintained by DevExpress and is required when migrating tests from TestCafe v1.x to v2.x or higher, where the legacy APIs were removed. It acts as a compatibility layer and is only needed if you have existing tests that rely on deprecated TestCafe APIs. Key differentiator: it enables gradual migration without rewriting all tests at once, but is not intended for new projects.
npm install testcafe-legacy-apiVerified import paths — ran on the pinned version, not inferred.
Shows how to import legacyApi and use it in a TestCafe fixture to set test speed and skip JS errors, and how to use legacy t.setSpeed in a test.
Ensure you are using TestCafe v2.0.0 or later with this package.
Migrate tests to use modern TestCafe API (e.g., t.click, t.typeText) instead of legacy methods.
Add `import 'testcafe-legacy-api'` at the top of your test file to ensure the plugin is loaded before fixtures.
Update your project to use ES modules or use dynamic import if necessary.
Run `npm install testcafe-legacy-api` and add `import 'testcafe-legacy-api'` at the top of your test file.
Ensure the legacy API plugin is imported and registered before the test runs.
Add "type": "module" to your package.json or use dynamic import: `import('testcafe-legacy-api')`.