All Versions
165
Latest Version
Avg Release Cycle
24 days
Latest Release
8 days ago

Changelog History
Page 14

  • v0.23.0 Changes

    October 25, 2018

    โœจ Enhancements

    โœ… :gear: Stop Test Run After the First Test Fail (#1323)

    ๐Ÿ”ง You can now configure TestCafe to stop the entire test run after the first test fail. This saves your time when you fix problems with your tests one by one.

    ๐Ÿ“š Specify the --sf flag to enable this feature when you run tests from the command line.

    testcafe chrome my-tests --sf
    

    ๐Ÿ“š In the API, use the stopOnFirstFail option.

    runner.run({ stopOnFirstFail: true })
    

    โœ… :gear: View the JavaScript Errors' Stack Traces in Reports (#2043)

    ๐Ÿ“š Now when a JavaScript error occurs on the tested webpage, the test run report includes a stack trace for this error (only if the --skip-js-errors option is disabled).

    ๐Ÿ“„ [A report that contains a stack trace for a client JS error](docs/articles/images/client-error-stack-report.png)

    โœ… :gear: Browsers are Automatically Restarted When They Stop Responding (#1815)

    โœ… If a browser stops responding while it executes tests, TestCafe restarts the browser and reruns the current test in a new browser instance. โœ… If the same problem occurs with this test two more times, the test run finishes and an error is thrown.

    ๐Ÿ› Bug Fixes

    • โœ… An error message about an unawaited call to an async function is no longer displayed when an uncaught error occurs (#2557)
    • โœ… A request hook is no longer added multiple times when a filter rule is used (#2650)
    • โœ… Screenshot links in test run reports now contain paths specified by the --screenshot-pattern option (#2726)
    • โœ… Assertion chains no longer produce unhandled promise rejections (#2852)
    • โœ… The moment loader now works correctly in the Jest environment (#2500)
    • โœ… TestCafe no longer hangs if the screenshot directory contains forbidden symbols (#681)
    • โœ… The --ssl option's parameters are now parsed correctly (#2924)
    • โœ… TestCafe now throws a meaningful error if an assertion method is missing (#1063)
    • โœ… TestCafe no longer hangs when it clicks a custom element (#2861)
    • โœ… TestCafe now performs keyboard navigation between radio buttons/groups in a way that matches the native browser behavior (#2067, #2045)
    • โœ… The fetch method can now be used with data URLs (#2865)
    • โœ… The switchToIframe function no longer throws an error (#2956)
    • โœ… TestCafe can now scroll through fixed elements when the action has custom offsets (#2978)
    • โœ… You can now specify the current directory or its parent directories as the base path to store screenshots (#2975)
    • โœ… Tests no longer hang up when you try to debug in headless browsers (#2846)
    • ๐Ÿšš The removeEventListener function now works correctly when an object is passed as its third argument (testcafe-hammerhead/#1737)
    • โœ… Hammerhead no longer adds the event property to a null contentWindow in IE11 (testcafe-hammerhead/#1684)
    • โœ… The browser no longer resets connection with the server for no reason (testcafe-hammerhead/#1647)
    • โœ… Hammerhead now stringifies values correctly before outputting them to the console (testcafe-hammerhead/#1750)
    • โœ… A document fragment from the top window can now be correctly appended to an iframe (testcafe-hammerhead/#912)
    • โœ… Lifecycle callbacks that result from the document.registerElement method are no longer called twice (testcafe-hammerhead/#695)
  • v0.22.0 Changes

    โœจ Enhancements

    โœ… :gear: CoffeeScript Support (#1556) by @GeoffreyBooth

    โœ… TestCafe now allows you to write tests in CoffeeScript. You do not need to compile CoffeeScript manually or make any customizations - everything works out of the box.

    import { Selector } from 'testcafe'
    
    fixture 'CoffeeScript Example'
        .page 'https://devexpress.github.io/testcafe/example/'
    
    nameInput = Selector '#developer-name'
    
    test 'Test', (t) =>
        await t
            .typeText(nameInput, 'Peter')
            .typeText(nameInput, 'Paker', { replace: true })
            .typeText(nameInput, 'r', { caretPos: 2 })
            .expect(nameInput.value).eql 'Parker';
    

    โœ… :gear: Failed Selector Method Pinpointed in the Report (#2568)

    โœ… Now the test run report can identify which selector's method does not match any DOM element.

    ๐Ÿ“„ [Failed Selector Report](docs/articles/images/failed-selector-report.png)

    โœ… :gear: Fail on Uncaught Server Errors (#2546)

    โœ… Previously, TestCafe ignored uncaught errors and unhandled promise rejections that occurred on the server. Whenever an error or a promise rejection happened, test execution continued.

    ๐Ÿ“š Starting from v0.22.0, tests fail if a server error or promise rejection is unhandled. To return to the previous behavior, we have introduced the skipUncaughtErrors option. Use the --skip-uncaught-errors flag in the command line or the skipUncaughtErrors option in the API.

    testcafe chrome tests/fixture.js --skipUncaughtErrors
    
    runner.run({skipUncaughtErrors:true})
    

    โœ… :gear: Use Glob Patterns in runner.src (#980)

    ๐Ÿ“š You can now use glob patterns in the runner.src method to specify a set of test files.

    runner.src(['/home/user/tests/**/*.js', '!/home/user/tests/foo.js']);
    

    ๐Ÿ› Bug Fixes

    • โœ… RequestLogger no longer fails when it tries to stringify a null request body (#2718)
    • ๐Ÿšš Temporary directories are now correctly removed when the test run is finished (#2735)
    • โœ… TestCafe no longer throws ECONNRESET when run against a Webpack project (#2711)
    • โœ… An error is no longer thrown when TestCafe tests Sencha ExtJS applications in IE11 (#2639)
    • โœ… Firefox no longer waits for page elements to appear without necessity (#2080)
    • โœ… ${BROWSER} in the screenshot pattern now correctly resolves to the browser name (#2742)
    • โœ… The toString function now returns a native string for overridden descriptor ancestors (testcafe-hammerhead/#1713)
    • โœ… The iframe flag is no longer added when a form with target="_parent" is submitted (testcafe-hammerhead/#1680)
    • โœ… Hammerhead no longer sends request headers in lower case (testcafe-hammerhead/#1380)
    • โœ… The overridden createHTMLDocument method has the right context now (testcafe-hammerhead/#1722)
    • โœ… Tests no longer lose connection (testcafe-hammerhead/#1647)
    • โœ… The case when both the X-Frame-Options header and a CSP with frame-ancestors are set is now handled correctly (testcafe-hammerhead/#1666)
    • โœ… The mechanism that resolves URLs on the client now works correctly (testcafe-hammerhead/#1701)
    • โœ… LiveNodeListWrapper now imitates the native behavior correctly (testcafe-hammerhead/#1376)
  • v0.21.1 Changes

    ๐Ÿ› Bug fixes

    • โœ… The RequestLogger.clear method no longer raises an error if it is called during a long running request (#2688)
    • โœ… TestCafe now uses native methods to work with the fetch request (#2686)
    • โœ… A URL now resolves correctly for elements in a document.implementation instance (testcafe-hammerhead/#1673)
    • โœ… Response header names specified via the respond function are lower-cased now (testcafe-hammerhead/#1704)
    • โœ… The cookie domain validation rule on the client side has been fixed (testcafe-hammerhead/#1702)
  • v0.21.0 Changes

    โœจ Enhancements

    โœ… :gear: Test Web Pages Served Over HTTPS (#1985)

    ๐Ÿ‘ท Some browser features (like Service Workers, Geolocation API, ApplePaySession, or SubtleCrypto) require a secure origin. This means that the website should use the HTTPS protocol.

    โœ… Starting with v0.21.0, TestCafe can serve proxied web pages over HTTPS. This allows you to test pages that require a secure origin.

    To enable HTTPS when you use TestCafe through the command line, specify the --ssl flag followed by the HTTPS server options. The most commonly used options are described in the TLS topic in the Node.js documentation.

    testcafe --ssl pfx=path/to/file.pfx;rejectUnauthorized=true;...
    

    ๐Ÿ“š When you use a programming API, pass the HTTPS server options to the createTestCafe method.

    'use strict';
    
    const createTestCafe        = require('testcafe');
    const selfSignedSertificate = require('openssl-self-signed-certificate');
    let runner                  = null;
    
    const sslOptions = {
        key:  selfSignedSertificate.key,
        cert: selfSignedSertificate.cert
    };
    
    createTestCafe('localhost', 1337, 1338, sslOptions)
        .then(testcafe => {
            runner = testcafe.createRunner();
        })
        .then(() => {
            return runner
                .src('test.js')
    
                // Browsers restrict self-signed certificate usage unless you
                // explicitly set a flag specific to each browser.
                // For Chrome, this is '--allow-insecure-localhost'.
                .browsers('chrome --allow-insecure-localhost')
                .run();
        });
    

    ๐Ÿ“š See Connect to TestCafe Server over HTTPS for more information.

    โœ… :gear: Construct Screenshot Paths with Patterns (#2152)

    ๐Ÿ“š You can include placeholders in the path, for example, ${DATE}, ${TIME}, ${USERAGENT}, etc. For a complete list, refer to Path Pattern Placeholders.

    โœ… You should specify a screenshot path pattern when you run tests. Each time TestCafe takes a screenshot, it substitutes the placeholders with actual values and saves the screenshot to the resulting path.

    ๐Ÿ’ป The following example shows how to specify a screenshot path pattern through the command line:

    testcafe all test.js -s path=screenshots,pathPattern=${DATE}_${TIME}/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png
    

    ๐Ÿ“š When you use a programming API, pass the screenshot path pattern to the runner.screenshots method.

    runner.screenshots({
        path: 'reports/screenshots/',
        takeOnFails: true,
        pathPattern: '${TEST_INDEX}/${OS}/${BROWSER}-v${BROWSER_VERSION}/${FILE_INDEX}.png'
    });
    

    โœ… :gear: Add Info About Screenshots and Quarantine Attempts to Custom Reports (#2216)

    โœ… Custom reporters can now access screenshots' data and the history of quarantine attempts (if the test run in the quarantine mode).

    The following information about screenshots is now available:

    • the path to the screenshot file,
    • the path to the thumbnail image,
    • ๐Ÿ’ป the browser's user agent,
    • the quarantine attempt number (if the screenshot was taken in the quarantine mode),
    • โœ… whether the screenshot was taken because the test failed.

    โœ… If the test was run in the quarantine mode, you can also determine which attempts failed and passed.

    ๐Ÿ“š Refer to the reportTestDone method description for details on how to access this information.

    ๐Ÿ› Bug Fixes

    • โœ… HTML5 drag events are no longer simulated if event.preventDefault is called for the mousedown event (#2529)
    • โœ… File upload no longer causes an exception when there are several file inputs on the page (#2642)
    • โœ… File upload now works with inputs that have the required attribute (#2509)
    • โœ… The load event listener is no longer triggered when added to an image (testcafe-hammerhead/#1688)
  • v0.20.5 Changes

    ๐Ÿ› Bug fixes

    • ๐Ÿ‘€ The buttons property was added to the MouseEvent instance (#2056)
    • โœ… Response headers were converted to lowercase (#2534)
    • โšก๏ธ Updated flow definitions (#2053)
    • โšก๏ธ An AttributesWrapper instance is now updated when the the element's property specifies the disabled attribute (#2539)
    • โœ… TestCafe no longer hangs when it redirects from a tested page to the 'about:error' page with a hash (#2371)
    • โœ… TestCafe now reports a warning for a mocked request if CORS validation failed (#2482)
    • โœ… Prevented situations when a request logger tries to stringify a body that is not logged (#2555)
    • โœ… The Selector API now reports NaN instead of integer when type validation fails (#2470)
    • โœ… Enabled noImplicitAny and disabled skipLibCheck in the TypeScript compiler (#2497)
    • โœ… Pages with rel=prefetch links no longer hang during test execution (#2528)
    • ๐Ÿ›  Fixed the TypeError: this.res.setHeader is not a function error in Firefox (#2438)
    • โœ… The formtarget attribute was overridden (testcafe-hammerhead/#1513)
    • โœ… fetch.toString() now equals function fetch() { [native code] } (testcafe-hammerhead/#1662)
  • v0.20.4 Changes

    โœจ Enhancements

    โœ… TestCafe now takes screenshots using browsers' debug protocols (#2492)

    ๐Ÿ› Bug fixes

    • โœ… fetch requests now correctly proxied in a specific case (testcafe-hammerhead/#1613)
    • โœ… Resources responding with 304 HTTP status code and with the 'content-length: ' header are proxied correctly now (testcafe-hammerhead/#1602)
    • โœ… The transfer argument of window.postMessage is passed correctly now (testcafe-hammerhead/#1535)
    • โœ… Incorrect focus events order in IE has been fixed (#2072)
  • v0.20.3 Changes

    โœจ Enhancements

    ๐Ÿณ :gear: Add TS definitions to the Docker image (#2481)

    ๐Ÿ› Bug fixes

    • โœ… Selection in a contenteditable div now works properly in a specific scenario (#2365)
    • ๐Ÿ“ฆ A collision related to several moment-duration-format package versions is now fixed (#1750)
    • โœ… TestCafe now reports a warning when saving several screenshots at the same path (#2213)
    • โœ… A regression related to wrongly processed document.write in IE11 is now fixed (#2469)
    • โœ… An out of memory crash on calling console methods is now fixed (testcafe-hammerhead/#1546)
    • โœ… Click action for an element with 1px height or width works properly now (#2020)
    • โœ… Touch emulation for the latest Google Chrome was fixed (#2448)
  • v0.20.2 Changes

    ๐Ÿ”’ :gear: Package dependencies have been upgraded to avoid CVEs reported by Node Security Platform

    ๐Ÿ› Bug fixes

    • ๐ŸŽ Enabled the screenshot and window resizing functionalities in the concurrency mode for Firefox and Chrome on macOS #2095
  • v0.20.1

  • v0.20.0 Changes

    โœ… 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)