Changelog History
Page 3
-
v1.15.1 Changes
July 28, 2021๐ Bug Fixes
- โ
The
Element.getAttribute
method returns an incorrect value (#5984). - โ
TestCafe test fails when you forget to include the
await
keyword before the assertion statement (#4613). - โ TestCafe fails to focus an element inside a shadow DOM (#4988).
- โ TestCafe fails to focus SVG elements (#6262).
- โ TestCafe raises the blur event when you focus a non-focusable element (#6236).
- โ TestCafe test hangs when you click a link within a cross-domain iframe (#6331).
- โ TestCafe loads the Babel compiler libraries multiple times (#6310).
- โ TestCafe incorrectly parses the meta refresh tags (PR testcafe-hammerhead/#2663)
- โ TestCafe incorrectly processes iframe elements with the "srcdoc" attribute (testcafe-hammerhead/#2647).
- โ TestCafe incorrectly specifies the Referer HTTP request header if you use the "navigateTo" action (testcafe-hammerhead/#2607).
- โ An error related to the bug in Node.js occurs (testcafe-hammerhead/#2655).
- โ
The
-
v1.15.0 Changes
July 08, 2021โจ Enhancements
โ Dispatch DOM events (PR #6103)
t.dispatchEvent(target, eventName[, options])
๐ The
t.dispatchEvent
method lets you interact with the page in ways that TestCafe does not support out of the box. To implement an unsupported user action, break it down into discrete DOM events, and use thet.dispatchEvent
method to fire them.โ >Internet Explorer does not support event constructors. As such, TestCafe cannot dispatch DOM events in this browser.
The following example fires a
touchstart
action on an element with the 'button' id:await t.dispatchEvent('#button', 'touchstart', { eventConstructor: 'TouchEvent' });
๐ Read the Custom Actions Guide for more information on DOM events and event constructors.
โ Quarantine mode customization (PR #6073 by @rob4629)
๐ New settings are available in quarantine mode. Quarantine mode repeats failing tests to help users get conclusive test results in sub-optimal conditions. TestCafe v1.15 adds two variables -
successThreshold
andattemptLimit
- that allow you specify when TestCafe must stop.โ The
attemptLimit
variable determines the maximum possible number of test attempts. โ ThesuccessThreshold
variable determines the number of successful attempts necessary for the test to pass.testcafe chrome ./tests/ -q attemptLimit=5, successThreshold=2
โ Password obfuscation (#6014)
๐ TestCafe reporters no longer receive the contents of
password
input fields, unless you explicitly specify otherwise. This improves security for users that store their test results online.๐ Support for non-HTML documents (#1471)
โ TestCafe now has the capability to proxy non-HTML documents such as XML and text files. Tests no longer hang upon redirection to a non-HTML address.
๐ Bug Fixes
- โ TestCafe doesn't raise an error if users specify the CDP port but do not enable concurrency (PR #6268).
- โ TestCafe incorrectly processes elements with negative tabIndex values (#4848).
- โ TestCafe incorrectly processes some eventListeners in multi-window mode (#5621).
- โ TestCafe incorrectly processes the <base> HTML tag (testcafe-hammerhead/#1965).
- โ
TestCafe doesn't intercept
Navigator.prototype
requests (PR testcafe-hammerhead/#2643 by @michaelficarra). - โ
TestCafe doesn't intercept
WorkerGlobalScope.importScripts()
arguments (testcafe-hammerhead/#2521). - โ A website parsing error causes test failure (testcafe-hammerhead/#2650).
- โ TestCafe stops recording test videos after you skip a fixture (#6163).
- ๐ Links with empty
download
attributes cause TestCafe to hang (#6132). - โ TestCafe reports incorrect line numbers (#5642).
- โ TestCafe incorrectly processes some for-of statements (PR testcafe-hammerhead/#2632).
- โ TestCafe sometimes directs window location queries to non-window objects (testcafe-hammerhead/#2611).
- ๐ Performance enhancement: obtaining element attributes (#6117)
-
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:
- ๐ the --config-file CLI flag
- ๐ the configFile parameter of the createTestCafe function
โ 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 aradio
element (#5916) - ๐ Fixed a bug where TestCafe was unable to register a Service Worker due to the wrong
currentScope
calculation inside aWindow.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:
- ๐ the
--cache
CLI flag - ๐ the
cache
configuration file property - ๐ the
createTestCafe
function parameter
๐ Initialize Request Hooks with Async Predicates
The following request hooks now support asynchronous predicate functions:
- ๐ RequestHook
- ๐ RequestMock.onRequestTo
- ๐ RequestLogger
Example
const logger = RequestLogger(async request => { return await myAsyncFunction(); });
๐ Bug Fixes
- ๐ the
-
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
- ๐ --ajax-request-timeout controls the timeout for fetch/XHR requests
- ๐ --page-request-timeout sets the timeout for webpage requests
testcafe chrome my-tests --ajax-request-timeout 40000 --page-request-timeout 8000
๐ง Configuration file
- ๐ ajaxRequestTimeout
- ๐ pageRequestTimeout
{ "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:
- ๐ --browser-init-timeout CLI option
testcafe chrome my-tests --browser-init-timeout 180000
- ๐ browserInitTimeout configuration option
{ "browserInitTimeout": 180000 }
- ๐ runner.run Method parameter
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 aniframe
(#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 aniframe
(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
-
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:
- ๐ t.maximizeWindow
- ๐ t.resizeWindow
- ๐ t.resizeWindowToFitDevice
- ๐ t.takeElementScreenshot
- ๐ t.takeScreenshot
๐ 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 foriframes
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 aniframe
withoutsrc
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 iniframes
withoutsrc
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)