TestCafe v0.20.0 Release Notes

  • โœ… Request Hooks: Intercepting HTTP requests (#1341)

    TestCafe now allows you to record HTTP request data or mock responses. You can also create a custom HTTP request hook to emulate authentications like Kerberos or Client Certificate Authentication.

    ๐Ÿ“š See Intercepting HTTP Requests for more information.

    โœจ Enhancements

    โœ… :gear: Specifying resources accessed by bypassing a proxy server (#1791)

    โœ… TestCafe now allows you to bypass the proxy server when accessing specific resources.

    ๐Ÿ“š To specify resources that require direct access, use the --proxy-bypass flag in the command line or the useProxy API method's parameters.

    testcafe chrome my-tests/**/*.js --proxy proxy.corp.mycompany.com --proxy-bypass localhost:8080,internal-resource.corp.mycompany.com
    
    runner.useProxy('172.0.10.10:8080', ['localhost:8080', 'internal-resource.corp.mycompany.com']);
    

    ๐Ÿ“‡ :gear: Specifying testing metadata (#2242)

    ๐Ÿ“‡ TestCafe allows you to specify additional information for tests in the form of key-value metadata and use it in reports.

    ๐Ÿ“š You can define metadata for a fixture or a test using the meta method:

    fixture `My Fixture`
        .meta('fixtureID', 'f-0001')
        .meta({ author: 'John', creationDate: '05/03/2018' });
    
    test
        .meta('testID', 't-0005')
        .meta({ severity: 'critical', testedAPIVersion: '1.0' })
        ('MyTest', async t => { /* ... */});
    

    ๐Ÿ“š To include testing metadata to reports, use the custom reporter methods.

    โœ… :gear: Passing a regular promise to t.expect is deprecated now (#2207)

    โœ… TestCafe now throws an error if you pass a regular promise to the assertion's expect method.

    ๐Ÿ“š If you need to assert a regular promise, set the allowUnawaitedPromise option to true.

    await t.expect(doSomethingAsync()).ok('check that a promise is returned', { allowUnawaitedPromise: true });
    

    ๐Ÿ› Bug Fixes

    • โœ… The session recovery bubble in Firefox is disabled (#2341)
    • ๐Ÿ’… TestCafe works properly if a body element has the pointer-events: none; css style rule (#2251)
    • โœ… Resizing Chrome in the emulation mode works correctly (#2154)
    • โœ… The location port is used for service messages (#2308)
    • โœ… A browser instance shuts down correctly on Unix systems (#2226)
    • ๐Ÿšš An Integrity attribute is removed from script and link tags (testcafe-hammerhead/#235)
    • โœ… The event.preventDefault() method call changes the event.defaultPrevented property value (testcafe-hammerhead/#1588)
    • โœ… It is possible to set the meta element's content attribute (testcafe-hammerhead/#1586)
    • โœ… TestCafe no longer overrides attributes used in a non-standard way with null (testcafe-hammerhead/#1583)
    • โœ… The Change event fires correctly if the target.value changes (#2319)
    • ๐Ÿ‘€ MouseEvent.screenX and MouseEvent.screenY are added to the emulated events (#2325)
    • โœ… Cookies on localhost are processed correctly (testcafe-hammerhead/#1491)
    • โœ… Setting the // url for an image works correctly (#2312)
    • โœ… shadowUI internal elements are no longer processed (#2281)
    • โœ… typeInput event is raised correctly (#1956)
    • โœ… Selecting text in contenteditable elements works properly (#2301)