All Versions
145
Latest Version
Avg Release Cycle
11 days
Latest Release
37 days ago

Changelog History
Page 1

  • v1.14.2

    May 13, 2021
  • v1.14.1

    May 12, 2021
  • v1.14.0

  • v1.13.0 Changes

    March 22, 2021

    πŸ›  This release adds support for custom paths to the configuration file, support for Microsoft Edge on Linux systems, and multiple bugfixes.

    ✨ Enhancements

    πŸ”§ :gear: Specify Custom Path to the TestCafe Configuration File (PR #6035 by @Chris-Greaves)

    πŸ“š TestCafe now allows you to specify a custom configuration file path.

    To set this path, use one of the following options:

    βž• Add Support for Microsoft Edge on Linux (PR testcafe-browser-tools/#210 by @dcsaszar)

    🐧 If you follow the Microsoft Edge Insider Channels for Linux and have Microsoft Edge installed on your Linux machine, you can now launch TestCafe tests in this browser.

    testcafe edge tests/test.js
    

    βœ… :gear: Deprecated the t.setPageLoadTimeout method (PR #5979)

    πŸ“š Starting with v1.13.0, the t.setPageLoadTimeout method is deprecated. To set the page load timeout, use the new test.timeouts method.

    fixture`Setting Timeouts`
        .page`http://devexpress.github.io/testcafe/example`;
    
    test
        .timeouts({
            pageLoadTimeout: 2000
        })
        ('My test', async t => {
            //test actions
        })
    

    πŸ“š You can also use test.timeouts to set the pageRequestTimeout and ajaxRequestTimeout.

    fixture`Setting Timeouts`
        .page`http://devexpress.github.io/testcafe/example`;
    
    test
        .timeouts({
            pageLoadTimeout:    2000,
            pageRequestTimeout: 60000,
            ajaxRequestTimeout: 60000
        })
        ('My test', async t => {
            //test actions
        })
    

    πŸ› Bug Fixes

    • πŸ›  Fixed a bug where TestCafe would sometimes be unable to trigger a hover event on a radio element (#5916)
    • πŸ›  Fixed a bug where TestCafe was unable to register a Service Worker due to the wrong currentScope calculation inside a Window.postMessage call (testcafe-hammerhead/#2524)
    • βœ… RequestLogger now shows a correct protocol for WebSocket requests (testcafe-hammerhead/#2591)
    • βœ… Test execution now pauses when the browser window is in the background (testcafe-browser-tools/#158)
    • βœ… TestCafe now appends an extension to screenshot filenames (#5103)
    • πŸ›  Fixed a bug where TestCafe would emit test action events after the end of a test run (#5650)
    • βœ… TestCafe now closes if the No tests to run error occurs in Live mode (#4257)
    • πŸ›  Fixed a freeze that happened when you run a test suite with skipped tests (#4967)
    • πŸ›  Fixed an error where a documentElement.transform.translate call moved the TestCafe UI in the browser window (#5606)
    • βœ… TestCafe now emits a warning if you pass an unawaited selector to an assertion (#5554)
    • πŸ›  Fixed a crash that sometimes occurred in Chrome v85 and earlier on pages with scripts (PR testcafe-hammerhead/#2590)
  • v1.12.0 Changes

    March 03, 2021

    ✨ Enhancements

    🍱 :gear: Server-Side Web Assets Caching (testcafe-hammerhead/#863)

    🍱 TestCafe's proxy server can now cache web assets (like images, scripts and videos). When TestCafe revisits a website, it loads assets from this cache to save time on repetetive network requests.

    To enable server-side caching, use any of the following:

    πŸŽ‰ Initialize Request Hooks with Async Predicates

    The following request hooks now support asynchronous predicate functions:

    Example

    const logger = RequestLogger(async request => {
        return await myAsyncFunction();
    });
    

    πŸ› Bug Fixes

    • πŸ›  Fixed a bug in Multiple Windows mode where TestCafe was sometime unable to switch to the main browser window (#5930)
    • πŸ›  Fixed the Illegal invocation error thrown by TestCafe when calling Storage.prototype methods on a StorageWrapper object (#2526)
  • v1.11.0 Changes

    March 02, 2021

    ✨ Enhancements

    βœ… :gear: Set Request Timeouts (PR #5692)

    βœ… TestCafe now enables you to set request timeouts. If TestCafe receives no response within the specified period, it throws an error.

    CLI

    testcafe chrome my-tests --ajax-request-timeout 40000 --page-request-timeout 8000
    

    πŸ”§ Configuration file

    {
        "pageRequestTimeout": 8000,
        "ajaxRequestTimeout": 40000
    }
    

    JavaScript API

    πŸ“š These options are available in the runner.run Method.

    const createTestCafe = require('testcafe');
    
    const testcafe = await createTestCafe('localhost', 1337, 1338);
    
    try {
        const runner = testcafe.createRunner();
    
        const failed = await runner.run({
            pageRequestTimeout: 8000,
            ajaxRequestTimeout: 40000
        });
    
        console.log('Tests failed: ' + failed);
    }
    finally {
        await testcafe.close();
    }
    

    βœ… :gear: Set Browser Initialization Timeout (PR #5720)

    πŸš€ This release introduces an option to control browser initialization timeout. This timeout controls the time browsers have to connect to TestCafe before an error is thrown. You can control this timeout in one of the following ways:

    testcafe chrome my-tests --browser-init-timeout 180000
    
    {
        "browserInitTimeout": 180000
    }
    
    runner.run({ "browserInitTimeout": 180000 })
    

    πŸ“š This setting sets an equal timeout for local and remote browsers.

    πŸ‘Œ Improved Unable To Establish Browser Connection Error Message (PR #5720)

    βœ… TestCafe raises this error when at least one local or remote browser was not able to connect. The error message now includes the number of browsers that have not established a connection.

    🐎 TestCafe raises a warning if low system performance is causing the connectivity issue.

    βœ… :gear: An Option to Retry Requests for the Test Page (PR #5738)

    βœ… If a tested webpage was not served after the first request, TestCafe can now retry the request.

    πŸ”§ You can enable this functionality with a command line, API, or configuration file option:

    • πŸ“š the --retry-test-pages command line argument

      testcafe chrome test.js --retry-test-pages
      
    • πŸ“š the createTestCafe function parameter

      const createTestCafe = require('testcafe');
      
      const testcafe = await createTestCafe('localhost', 1337, 1338, retryTestPages)
      
    • πŸ“š the retryTestPages configuration file property

      {
          "retryTestPages": true
      }
      

    πŸ› Bug Fixes

    • πŸ›  Fixed a bug where Selector.withText couldn't locate elements inside an iframe (#5886)
    • πŸ›  Fixed a bug where TestCafe was sometimes unable to detect when a browser instance closes (#5857)
    • βœ… You can now install TestCafe with Yarn 2 (PR #5872 by @NiavlysB)
    • πŸ›  Fixed a bug where the typeText action does not always replace existing text (PR #5942 by @rueyaa332266)
    • πŸ›  Fixed a bug where TestCafe was sometimes unable to create a Web Worker from an object (testcafe-hammerhead/#2512)
    • πŸ›  Fixed an error thrown by TestCafe proxy when trying to delete an object property that does not exist (testcafe-hammerhead/#2504)
    • πŸ›  Fixed an error thrown by TestCafe proxy when a Service Worker overwrites properties of a window object (testcafe-hammerhead/#2538)
    • πŸ›  Fixed a bug where t.openWindow method requested a URL twice (testcafe-hammerhead/#2544)
    • πŸ›  Fixed an error (TypeError: Illegal invocation) thrown by TestCafe on pages that contain an XMLDocument with an iframe (testcafe-hammerhead/#2554)
    • πŸ›  Fixed an error (SyntaxError: Identifier has already been declared) thrown by TestCafe on pages with scripts that create nested JavaScript objects (testcafe-hammerhead/#2506)
    • πŸ›  Fixed a bug where TestCafe was unable to focus elements within shadow DOM (testcafe-hammerhead/#2408)
    • βœ… TestCafe now throws an error when an entity of type other than Error is thrown in a test script (PR testcafe-hammerhead/#2536)
    • πŸ›  Fixed a bug where TestCafe was sometimes unable to resolve relative URLs (testcafe-hammerhead/#2399)
    • βœ… Properties of window.location.constructor are now shadowed correctly by TestCafe proxy (testcafe-hammerhead/#2423)
    • βœ… TestCafe proxy now correctly handles requests that are not permitted by the CORS policy (testcafe-hammerhead/#1263)
    • πŸ‘Œ Improved compatibility with test pages that use with statements (testcafe-hammerhead/#2434)
    • βœ… TestCafe proxy can now properly parse statements that use a comma operator in for..of loops (testcafe-hammerhead/#2573)
    • πŸ›  Fixed a bug where TestCafe would open a new window even if preventDefault is present in element's event handler (testcafe-hammerhead/#2582)

    βœ… Vulnerability Fix (PR #5843, PR testcafe-hammerhead#2531)

    πŸ“¦ We have fixed a vulnerability found in the debug module we use for debugging. βœ… The vulnerability was a ReDos Vulnerability Regression that affected all TestCafe users. TestCafe now uses [email protected], where the issue is fixed.

  • v1.10.1 Changes

    December 24, 2020

    πŸ› Bug Fixes

    • πŸ›  Fixed an error thrown when TestCafe runs TypeScript tests (#5808)
    • βœ… Implemented a Service Worker that allows TestCafe to re-try failed requests to the tested page. This improves test stability (#5239)
    • πŸ›  Fixed an error thrown when you call the t.getBrowserConsoleMessages method (#5600)
  • v1.10.0 Changes

    December 15, 2020

    ✨ Enhancements

    🏁 Window Resize and Screenshot Support for Child Windows in Chrome (PR #5661, PR #5567)

    πŸ“š You can now use the following actions in Google Chrome when you switch the test context to a child window:

    πŸ†• New API to Specify Compiler Options (#5519)

    In previous versions, you used the following methods to specify TypeScript compiler options:

    • πŸ“š the --ts-config-path command line flag

      testcafe chrome my-tests --ts-config-path path/to/config.json
      
    • πŸ“š the runner.tsConfigPath method

      runner.tsConfigPath('path/to/config.json');
      
    • πŸ“š the tsConfigPath configuration file property

      {
          "tsConfigPath": "path/to/config.json"
      }
      

    πŸš€ In v1.10.0, we introduced a new easy-to-use API that allows you to specify the compiler options in the command line, API or TestCafe configuration file, without creating a separate JSON file. The new API is also designed to accept options for more compilers (for instance, Babel) in future releases.

    The API consists of the following members:

    • πŸ“š the --compiler-options command line flag

      testcafe chrome my-tests --compiler-options typescript.experimentalDecorators=true
      
    • πŸ“š the runner.compilerOptions method

      runner.compilerOptions({
          typescript: {
              experimentalDecorators: true
          }
      });
      
    • πŸ“š the compilerOptions configuration file property

      {
          "compilerOptions": {
              "typescript": {
                  "experimentalDecorators": true
              }
          }
      }
      

    πŸ”§ If you prefer to keep compiler settings in a configuration file, you can use the new API to specify the path to this file:

    testcafe chrome my-tests --compiler-options typescript.configPath='path/to/config.json'
    

    In v1.10.0, you can customize TypeScript compiler options only.

    πŸ“š For more information, see TypeScript and CoffeeScript.

    βž• Added a Selector Method to Access Shadow DOM (PR #5560 by @mostlyfabulous)

    πŸ“š This release introduces the selector.shadowRoot method that allows you to access and interact with the shadow DOM elements. This method returns a shadow DOM root hosted in the selector's matched element.

    import { Selector } from 'testcafe'
    
    fixture `Target Shadow DOM elements`
        .page('https://devexpress.github.io/testcafe/example')
    
    test('Get text within shadow tree', async t => {
        const shadowRoot = Selector('div').withAttribute('id', 'shadow-host').shadowRoot();
        const paragraph  = shadowRoot.child('p');
    
        await t.expect(paragraph.textContent).eql('This paragraph is in the shadow tree');
    });
    

    πŸ“š Note that you should chain other selector methods to selector.shadowRoot to access elements in the shadow DOM. You cannot interact with the root element (an error occurs if you specify selector.shadowRoot as an action's target element).

    πŸ› Bug Fixes

    • βœ… Browsers now restart correctly on BrowserStack when the connection is lost (#5238)
    • πŸ›  Fixed an error that occurs if a child window is opened in an iframe (#5033)
    • 🏁 TestCafe can now switch between the child and parent windows after the parent window is reloaded (#5463, #5597)
    • πŸ›  Fixed an issue when touch and mouse events fired on mobile devices even though the mouse event was prevented in page code (#5380)
    • βœ… Cross-domain iframes are now focused correctly in Safari (#4793)
    • πŸ›  Fixed an excessive warning displayed when an assertion is executed in a loop or against an element returned by a selector.xxxSibling method (#5449, #5389)
    • βœ… A page error is no longer emitted if the destination server responded with the 304 status (#5025)
    • πŸ›  Fixed an issue when TestCafe could not authenticate websites that use MSAL (#4834)
    • βœ… The srcdoc attributes for iframes are now processed (testcafe-hammerhead/#1237)
    • βœ… The authorization header is now preserved in response headers of fetch requests (testcafe-hammerhead/#2334)
    • βœ… The document.title for an iframe without src can now be correctly obtained in Firefox (PR testcafe-hammerhead/#2466)
    • βœ… TestCafe UI is now displayed correctly if the tested page's body content is added dynamically (PR testcafe-hammerhead/#2454)
    • βœ… Service Workers now receive fetch events (testcafe-hammerhead/#2412)
    • πŸ›  Fixed the case of headers sent to the web app server (testcafe-hammerhead/#2344)
    • βœ… Location objects in iframes without src now contain the correct data (PR testcafe-hammerhead/#2448)
    • βœ… Native function wrappers are now converted to strings correctly (testcafe-hammerhead/#2394)
    • βœ… Values retrieved from the local storage are now converted to strings (testcafe-hammerhead/#2313)
    • πŸ›  Fixed an issue when relative URLs were resolved incorrectly in iframes (testcafe-hammerhead/#2461)
    • πŸ›  Fixed an issue when TestCafe took a very long time to process large CSS files (testcafe-hammerhead/#2475)
    • πŸ›  Fixed an issue with client-side JavaScript processing (testcafe-hammerhead/#2442)
    • πŸ›  Fixed an issue that suppressed Adobe Launch Analytics requests (testcafe-hammerhead/#2453)
    • βž• Added support for Web Workers created from Blob URLs (testcafe-hammerhead/#1221)
    • πŸ›  Fixed an issue when network requests were not received by the server (testcafe-hammerhead/#2467)
    • βœ… Cross-domain iframe source links now have the correct protocol when SSL is used (PR testcafe-hammerhead/#2478)
  • v1.10.0-rc.6 Changes

    December 07, 2020

    What’s Changed

    • ⬆️ Bump version (v1.10.0-rc.6), bump testcafe-hammerhead (v17.1.25) (#5769) @Farfurix
    • ⚑️ [docs] Update the CircleCI guide (#5743) @DIRECTcut
    • βœ… [docs] Describe difference between Selector and assertion timeouts (#5755) @DIRECTcut
    • πŸš€ [docs] Add an announcement post for the v1.10.0 release (#5763) @VasilyStrelyaev
  • v1.10.0-rc.5 Changes

    December 02, 2020

    What’s Changed

    • πŸ›  Fix BC in test action result definitions (#5761) @AndreyBelym
    • πŸ›  Fix the 'cleanLoc' function (#5760) @miherlosev
    • ⚑️ [docs] Update the TypeScript guide, describe the 'compiler options' feature (#5664) @titerman