TestCafe v0.23.1 Release Notes

  • โœจ Enhancements

    ๐Ÿ“‡ :gear: Select Tests and Fixtures to Run by Their Metadata (#2527) by @NickCis

    ๐Ÿ“š You can now run only those tests or fixtures whose metadata contains a specific set of values. Use the --test-meta and --fixture-meta flags to specify these values.

    testcafe chrome my-tests --test-meta device=mobile,env=production
    
    testcafe chrome my-tests --fixture-meta subsystem=payments,type=regression
    

    ๐Ÿ“š In the API, test and fixture metadata is now passed to the runner.filter method in the testMeta and fixtureMeta parameters. Use this metadata to build a logic that determines whether to run the current test.

    runner.filter((testName, fixtureName, fixturePath, testMeta, fixtureMeta) => {
        return testMeta.mobile === 'true' &&
            fixtureMeta.env === 'staging';
    });
    

    โœ… :gear: Run Dynamically Loaded Tests (#2074)

    โœ… You can now run tests imported from external libraries or generated dynamically even if the .js file does not contain any tests.

    ๐Ÿ“š Previously, test files had to contain the fixture and test directives. You can now add the --disable-test-syntax-validation command line flag to bypass this check.

    testcafe safari test.js --disable-test-syntax-validation
    

    โœ… In the API, use the disableTestSyntaxValidation option.

    runner.run({ disableTestSyntaxValidation: true })
    

    ๐Ÿ› Bug Fixes

    • โœ… Touch events are now simulated with correct touch properties (touches, targetTouches, changedTouches) (#2856)
    • ๐ŸŽ Google Chrome now closes correctly on macOS after tests are finished (#2860)
    • โœ… Internal attribute and node changes no longer trigger MutationObserver notifications (testcafe-hammerhead/#1769)
    • โœ… The ECONNABORTED error is no longer raised (testcafe-hammerhead/#1744)
    • โœ… Websites that use Location.ancestorOrigins are now proxied correctly (testcafe-hammerhead/#1342)