All Versions
167
Latest Version
Avg Release Cycle
24 days
Latest Release
555 days ago

Changelog History
Page 14

  • v0.23.2 Changes

    November 12, 2018

    ๐Ÿ› Bug Fixes

    • โœ… TestCafe no longer posts internal messages to the browser console (#3099)
    • โœ… The TestCafe process no longer terminates before the report is written to a file (#2502)
  • v0.23.1 Changes

    โœจ 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)
  • 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