paralleldrive / cuid

Collision-resistant ids optimized for horizontal scaling and performance.
Other
3.42k stars 123 forks source link

chore(deps): update dependency testcafe to v3 #286

Open renovate[bot] opened 1 year ago

renovate[bot] commented 1 year ago

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
testcafe (source) 2.2.0 -> 3.6.2 age adoption passing confidence

Release Notes

DevExpress/testcafe (testcafe) ### [`v3.6.2`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v362-2024-07-02) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v3.6.1...v3.6.2) ##### Bug Fixes - \[Native Automation] TestCafe incorrectly uploads files in Chrome v125 and up. ([#​8198](https://togithub.com/DevExpress/testcafe/issues/8198)) - TestCafe dependencies include the vulnerable endpoint-utils package ([#​8207](https://togithub.com/DevExpress/testcafe/issues/8207)). The updated version includes the address package instead. ### [`v3.6.1`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v361-2024-06-10) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v3.6.0...v3.6.1) ##### Bug Fixes - TestCafe incorrectly calculates the dimensions of multi-line elements. ([#​8179](https://togithub.com/DevExpress/testcafe/issues/8179)) - TestCafe incorrectly executes the `resizeWindow` method if you maximize the target window first. ([#​8157](https://togithub.com/DevExpress/testcafe/issues/8157)) ### [`v3.6.0`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#TestCafe-v360-Released) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v3.5.0...v3.6.0) The TestCafe v3.6.0 update includes two minor changes and a number of bug fixes. ### [`v3.5.0`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v350-2023-12-26) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v3.4.0...v3.5.0) TestCafe v3.5.0 includes multiple enhancements and bug fixes. Pass Selector queries to the Visual Selector Debugger, explore new ways to specify screenshot path patterns, and use a new *experimental* flag to run multi-window tests with native automation! meta-readmore ##### Pass Selector queries to the Visual Selector Debugger When you pass a Selector query to the [t.debug()](xref:402707) method, TestCafe uses the query to populate the input field of the Visual Selector Debugger. The debugger highlights page elements that match the query. ```js t.debug(Selector('#header')); ``` > \[!Video https://www.screencast.com/users/testcafe/folders/Default/media/4274d757-f7a4-4982-add4-43bb0ba35cff/embed] ##### Use a custom path pattern for screenshots of failed tests The `pathPatternOnFails` [screenshot option](xref:402639#-s---screenshots-optionvalueoption2value2) allows TestCafe users to define a separate set of naming rules for screenshots taken on test failure. You can store these screenshots in a different folder, or add a common, recognizable element to their filenames. You can use this option on its own, or in conjunction with the `pathPattern` property. ```json { "screenshots": { "pathPatternOnFails": "${DATE}_${TIME}/failedTests/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png" } } ``` ##### Specify a path pattern for individual screenshots Use the `pathPattern` option of the [t.takeScreenshot](xref:402675) action to specify a custom naming pattern for an individual screenshot: ```js t.takeScreenshot({ pathPattern: "${DATE}_${TIME}/checkout-screenshot.png", fullPage: true }) ``` ##### (Experimental) Run multi-window tests with native automation TestCafe v2.5.0 was the first version of TestCafe to include [native automation](xref:404237) --- the capability to automate Chromium-based browsers with the native Chrome Debugging Protocol. This approach offers greater test stability and speed, but has a fair share of limitations. One of them is its incompatibility with multi-window tests. TestCafe v3.5.0 offers an experimental solution for this issue --- the [--experimental-multiple-windows](xref:402639#--experimental-multiple-windows) CLI flag. If you enable this flag, you can run multi-window tests with the native automation engine. The `--experimental-multiple-windows` mode does not support tests that include the following: - Pop-up windows that launch file downloads. - Browser window resizing. - Screenshots. - Video recording. Please do not use the `--experimental-multiple-windows` flag in production or for business-critical tasks. ##### Bug Fixes - TypeScript compilation fails if project dependencies include '[@​babel/plugin-transorm-runtime](https://togithub.com/babel/plugin-transorm-runtime)' v7.23.3 or greater ([#​8091](https://togithub.com/DevExpress/testcafe/issues/8091)). - If you enable concurrent test execution, TestCafe launches tests before the conclusion of the `fixture.before` hook ([#​6999](https://togithub.com/DevExpress/testcafe/issues/6999)). - The `Fixture.disableConcurrency` method does not disable concurrent test execution ([8087](https://togithub.com/DevExpress/testcafe/issues/8087)). - TestCafe ignores the fullPage option when it takes screenshots on test failure ([#​7761](https://togithub.com/DevExpress/testcafe/issues/7761)). - \[Native Automation] TestCafe cannot populate file input fields with the `required` attribute ([#​8079](https://togithub.com/DevExpress/testcafe/issues/8079)). - \[Native Automation] TestCafe fails to execute tests that use service workers ([#​8005](https://togithub.com/DevExpress/testcafe/issues/8005), [#​8054](https://togithub.com/DevExpress/testcafe/issues/8054)). - When an action target is obscured by a sticky element, TestCafe incorrectly calculates the scroll distance necessary to interact with the target. ([#​7377](https://togithub.com/DevExpress/testcafe/issues/7377)). - Incorrect processing of front-end scripts causes automation errors ([#​7713](https://togithub.com/DevExpress/testcafe/issues/7713), [#​8067](https://togithub.com/DevExpress/testcafe/issues/8067), [testcafe-hammerhead#2969](https://togithub.com/DevExpress/testcafe-hammerhead/issues/2969)). - TestCafe incorrectly processes failing network requests when it runs on Node.js v16 and greater ([#​7097](https://togithub.com/DevExpress/testcafe/issues/7097)). - TestCafe incorrectly handles native dialogs in Mozilla Firefox ([#​6815](https://togithub.com/DevExpress/testcafe/issues/6815)). ### [`v3.4.0`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v340-2023-11-09) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v3.3.0...v3.4.0) TestCafe v3.4.0 introduces relative Role URLs, the ability to disable concurrency on a per-fixture basis, as well as other improvements and bug fixes. meta-readmore ##### Enhancements ##### Relative Role URLs Earlier versions of TestCafe did not support relative URLs for [Role log-in pages](xref:402845). In TestCafe v3.4.0 and higher, if you set the [baseUrl](xref:402638#base-url) configuration file parameter or the [--base-url](xref:402639#--base-url) CLI option, you can set a relative URL for a Role log-in page: ```js import { Role } from 'testcafe'; const userOne = Role('./login', async t => { /* log-in actions go here */ }); ``` ##### Disable concurrency on a per-fixture basis [Concurrent test execution](xref:403626) is not suitable for tests that can only run in a certain order. To ignore the global concurrency setting for a particular fixture, use the [disableConcurrency](xref:404618) fixture method. ```js fixture`Fixture.disableConcurrency` .page`https://devexpress.github.io/testcafe/example/` .disableConcurrency; ``` ##### Development Mode Enhancements When you debug code inside a browser, the browser can appear unresponsive. Earlier versions of TestCafe automatically relaunched unresponsive browsers, including browsers that were used for debugging. TestCafe v3.4.0 *does not* relaunch unresponsive browsers if you enter [development mode](xref:402638#developmentmode). ##### Debug Panel Enhancements The [debug panel](xref:404288) includes a new "Hide Picker" button. Click this button to disable the Selector Debugger and hide the Selector input field. ![Hide the Selector input field](https://testcafe.io/images/inspector/hide-selector-picker.gif) ##### Bug Fixes - TestCafe incorrectly logs requests during concurrent test execution ([#​7977](https://togithub.com/DevExpress/testcafe/issues/7977)). - TestCafe does not load images with non-lowercase `srcset` attribute declarations ([testcafe-hammerhead#2958](https://togithub.com/DevExpress/testcafe-hammerhead/issues/2958)). - TestCafe raises an unexpected client-side error when the application opens an `ngx-formly` form ([#​7758](https://togithub.com/DevExpress/testcafe/issues/7758)). - TestCafe cannot interact with page items at the edge of the viewport when the browser emulates a mobile device ([#​8057](https://togithub.com/DevExpress/testcafe/issues/8057)). ### [`v3.3.0`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v330-2023-08-29) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v3.2.0...v3.3.0) TestCafe v3.3.0 includes important bug fixes and quality of life improvements. ##### Bug Fixes - TestCafe terminates the test run when it attempts to parse an empty JSON file ([#​7935](https://togithub.com/DevExpress/testcafe/issues/7935)). - Firefox throws an unexpected error when TestCafe attempts to close the browser window ([#​7285](https://togithub.com/DevExpress/testcafe/issues/7285)). - \[Native Automation] TestCafe ignores the `--disable-multiple-windows` option when you interact with a link that points to "target=\_blank", or open a new window with the `window.open` method ([#​7916](https://togithub.com/DevExpress/testcafe/issues/7916)). - \[Native Automation] TestCafe ignores the clientScripts directive when you mock HTTP requests ([#​7914](https://togithub.com/DevExpress/testcafe/issues/7914)). - \[Native Automation] TestCafe hangs when it runs tests in the headless version of Google Chrome ([#​7898](https://togithub.com/DevExpress/testcafe/issues/7898)). - \[Native Automation] TestCafe doesn't throw an error when the user attempts to enable the `userProfile` option ([#​7925](https://togithub.com/DevExpress/testcafe/issues/7925)). ### [`v3.2.0`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v320-2023-08-17) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v3.1.0...v3.2.0) TestCafe v3.2.0 allows you to check whether TestCafe uses native automation to control the browser. ##### Check your native automation status The `nativeAutomation` property of the [t.browser](https://testcafe.io/documentation/402712/reference/test-api/testcontroller/browser) object indicates whether TestCafe uses native automation to control the browser. The property's value is `true` when TestCafe uses native automation and `false` when TestCafe uses the Hammerhead proxy. You can check the browser's native automation status before you start the test: ```js import { Selector } from 'testcafe'; fixture`TestController.browser` .page`https://example.com`; test('Native automation check', async t => { await t.expect(t.browser.nativeAutomation).ok(); //the test continues only if you use native automation }); ``` ##### Bug Fixes - TestCafe uses a version of the `error-stack-parser` package that contains a vulnerable dependency ([PR #​7919](https://togithub.com/DevExpress/testcafe/pull/7919) by [@​sethidden](https://togithub.com/sethidden)). - TestCafe does not clear cookie storage if a Role activation URL is the same as the page URL ([#​7874](https://togithub.com/DevExpress/testcafe/issues/7874)). - \[Native Automation] TestCafe incorrectly processes web pages with file inputs ([#​7886](https://togithub.com/DevExpress/testcafe/issues/7886)). ### [`v3.1.0`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v310-2023-07-27) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v3.0.1...v3.1.0) TestCafe v3.1.0 introduces two enhancements: - You can now respond to geolocation requests with the `t.setNativeDialogHandler` method. - Your tests and test reports can now reference a variable that stores the framework's version number. ##### Respond to geolocation requests > Main article: [t.setNativeDialogHandler](https://testcafe.io/documentation/402684/reference/test-api/testcontroller/setnativedialoghandler) Use the `t.setNativeDialogHandler` method to respond to `geolocation` requests. - Return an `Error` type object to **Block** geolocation requests. - Return an object with [coordinates](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationPosition) to trigger the `success` callback of the [getCurrentPosition](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) method. ```js // Test test('Switch from "allow" to "block"', async t => { await t .setNativeDialogHandler((type) => { if (type === 'geolocation') return { timestamp: 12356, accuracy: 20, coords: {latitude: '34.15321262322903', longitude: '-118.25543996370723'}; // Passes this data to geolocation requests return null; }); .click('#buttonGeo') .setNativeDialogHandler((type) => { if (type !== 'geolocation') return null; const err = new Error('Some error'); err.code = 1; return err; // Blocks geolocation requests }) .click('#buttonGeo'); ``` ##### Reference the framework's version in tests and test reports > Main article: [Version Logger API](https://testcafe.io/documentation/404469/reference/version-logger-api) Earlier versions of TestCafe could output the framework's version number to the console: ![CLI version](https://testcafe.io/images/testcafe-version.png) TestCafe 3.1.0 and up allows you to access the framework's version number in test code: ```js import { version } from 'testcafe'; console.log(`TestCafe version: ${version}`); ``` ![API version](https://testcafe.io/images/output-testcafe-version.png) To access the framework's version number in your custom reporter, reference the first argument (`version`) of the `init` method: ```js init (version) { this .write(`Using TestCafe ${version}`) .newline() } ``` ##### Bug fixes - TestCafe incorrectly reports test duration in concurrency mode ([#​1816](https://togithub.com/DevExpress/testcafe/issues/1816)). - TestCafe assigns a non-zero duration value to skipped tests, which leads to an unexpected increase in the total test run duration value ([#​7731](https://togithub.com/DevExpress/testcafe/issues/7731)). - \[Native Automation] The `setFileUpload` method does not work ([#​7832](https://togithub.com/DevExpress/testcafe/issues/7832)). - \[Native Automation] Request hooks cause tests to crash ([#​7846](https://togithub.com/DevExpress/testcafe/issues/7846)). - \[Native Automation] TestCafe overrides page titles ([#​7833](https://togithub.com/DevExpress/testcafe/issues/7833)). - \[Native Automation] If a website redirects the user to a new page before basic HTTP authentication is complete, the authentication process fails ([#​7852](https://togithub.com/DevExpress/testcafe/issues/7852)). - \[Native Automation] The `t.click` action fails if the event handler accounts for [pointer input pressure](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure) ([#​7867](https://togithub.com/DevExpress/testcafe/issues/7867)). - \[Native Automation] TestCafe hangs when the browser yields a "Session with given ID not found" error ([#​7865](https://togithub.com/DevExpress/testcafe/issues/7865),[#​7810](https://togithub.com/DevExpress/testcafe/issues/7810)). - \[Native Automation] TestCafe cannot set the `httpOnly` flag when you use the `t.setCookies` method ([#​7793](https://togithub.com/DevExpress/testcafe/issues/7793)). ### [`v3.0.1`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v301-2023-06-29) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v3.0.0...v3.0.1) ##### Bug fixes - The TestCafe status bar overlaps page elements, which leads to test execution issues ([#​7797](https://togithub.com/DevExpress/testcafe/issues/7797)) - TestCafe outputs an unhelpful warning message when it cannot apply the artifact path template ([#​7256](https://togithub.com/DevExpress/testcafe/issues/7256)) - A bug in the testcafe-browser-tools package causes TestCafe tests to hang on Ubuntu ([#​7752](https://togithub.com/DevExpress/testcafe/issues/7752)) ### [`v3.0.0`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v300-2023-06-21) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v2.6.2...v3.0.0) This major update includes two **breaking changes**: - TestCafe v3.0.0 uses native CDP automation to run tests in Chromium-based browsers. - TestCafe v3.0.0 removes support for Internet Explorer. Other changes include: - You can now access test and fixture data in hooks. - You can now dismiss the `print` dialog with the native dialog handler. ##### Native automation TestCafe v2.5.0 introduced an *experimental* mode that allows users to automate Chromium-based browsers, such as Google Chrome and Microsoft Edge, with the native CDP protocol. TestCafe v3.0.0 and up enables this capability out of the box. Native automation increases test quality, stability, and speed. - Read the ["TestCafe goes native"](https://testcafe.io/404431/resources/blog/2023-6-21-testcafe-goes-native) announcement for more information on the benefits of the new approach. - Read the [Native Automation FAQ](https://testcafe.io/documentation/404237/guides/intermediate-guides/native-automation-mode) for more information on the practical aspects of this capability. ##### Access Test and Fixture data in hooks You can now access the following data in fixture hooks (`fixture.before`, `fixture.after`) : - Fixture name - Fixture metadata - Fixture path Test hooks (`fixture.beforeEach`, `fixture.afterEach`, `test.before`, `test.after`) can access fixture data **and** the following test data: - Test name - Test metadata ```js fixture `Example Fixture` .page `http://example.com` .meta({ fixtureMeta: 'v' }) .before( async (ctx, info) => { const fixtureName = info.name; /* Example Fixture */ const fixtureMeta = info.meta; /* { fixtureMeta: 'v' } */ const fixturePath = info.path /* /Users/dan/testcafe/fixture.js */ }); .beforeEach( async t => { const fixtureName = t.fixture.name; /* Example Fixture */ const fixtureMeta = t.fixture.meta; /* { fixtureMeta: 'v' } */ const fixturePath = t.fixture.path /* /Users/dan/testcafe/fixture.js */ const testName = t.test.name; /* MyTest */ const testMeta = t.test.meta; /* { 'key': 'value' } */ }) ``` Read the [Hooks guide](https://testcafe.io/documentation/403435/guides/intermediate-guides/hooks#access-fixture-and-test-data-in-hooks) for more information. ##### Dismiss the print dialog You can now use the [t.setNativeDialogHandler](https://testcafe.io/documentation/402684/reference/test-api/testcontroller/setnativedialoghandler) method to dismiss the print dialog. ##### Removed: Internet Explorer support TestCafe v3.0.0 removes support for Internet Explorer 11, six months after the browser's official [retirement](https://techcommunity.microsoft.com/t5/windows-it-pro-blog/internet-explorer-11-desktop-app-retirement-faq/ba-p/2366549). The browser came out more than 9 years ago, and has a worldwide market of less than [0.5%](https://gs.statcounter.com/browser-market-share). It is survived by Edge, a popular Chromium-based browser that ships with modern versions of Windows. ##### Bug fixes - Some client functions yield a fatal error when the test navigates to a new page or removes an iframe ([#​7707](https://togithub.com/DevExpress/testcafe/issues/7707)). - TestCafe fails to correctly modify certain request headers when it uses native automation ([#​7748](https://togithub.com/DevExpress/testcafe/issues/7748)). - A bug in the CDP protocol causes TestCafe to incorrectly process request hooks ([#​7743](https://togithub.com/DevExpress/testcafe/issues/7743)). - TestCafe outputs a vague error message if the framework fails to read or process the configuration file ([#​7208](https://togithub.com/DevExpress/testcafe/issues/7208), [#​6437](https://togithub.com/DevExpress/testcafe/issues/6437)). - TestCafe cannot select content with the "Ctrl+A" shortcut when the framework uses native automation ([#​7667](https://togithub.com/DevExpress/testcafe/issues/7667)). - The Monaco editor does not display code completion hints when TestCafe automates it with CDP [#​7770](https://togithub.com/DevExpress/testcafe/issues/7770). ### [`v2.6.2`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v262-2023-06-01) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v2.6.1...v2.6.2) TestCafe v2.6.2 introduces a number of bug fixes. ##### Bug fixes - Internet Explorer 11 hangs because it cannot process client-side scripts that ship with TestCafe v2.6.1 ([#​7741](https://togithub.com/DevExpress/testcafe/issues/7741)). - The `pressKey('space')` action doesn't affect checkbox status in Firefox ([#​6969](https://togithub.com/DevExpress/testcafe/issues/6969)). ### [`v2.6.1`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v261-2023-05-29) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v2.6.0...v2.6.1) TestCafe v2.6.1 retires **Experimental Debug** mode, and introduces a number of important bug fixes. ##### Removed: Experimental debug mode TestCafe v1.18.0 introduced [Experimental Debug mode](https://testcafe.io/403664/release-notes/framework/2021-12-22-testcafe-v1-18-0-released) --- a way to debug Selectors and Client Functions in the text editor. TestCafe v2.4.0 shipped with the [Visual Selector Debugger](https://testcafe.io/documentation/404288/guides/intermediate-guides/visual-selector-debugger), which allows users to troubleshoot Selector queries directly in the browser. The two capabilities serve the same purpose, but the Visual Selector Debugger is more user-friendly. As such, beginning with TestCafe v2.6.1, the framework **no longer includes** Experimental Debug mode. Thank you to all the TestCafe users who tried out the capability. ##### Bug fixes - When TestCafe runs in Native Automation mode, Request Hooks yield an error ([#​7683](https://togithub.com/DevExpress/testcafe/issues/7683)). - When TestCafe runs in Native Automation mode, the framework incorrectly processes pages with the pound sign ("#") in the URL ([#​7652](https://togithub.com/DevExpress/testcafe/issues/7652)). - TestCafe incorrectly handles XHR headers in Native Automation mode ([#​7664](https://togithub.com/DevExpress/testcafe/issues/7664), [#​7686](https://togithub.com/DevExpress/testcafe/issues/7686), [#​7645](https://togithub.com/DevExpress/testcafe/issues/7645)). - TestCafe reports an incorrect browser alias when it runs tests in Microsoft Edge ([#​7647](https://togithub.com/DevExpress/testcafe/issues/7647)). - TestCafe fails to intercept all HTTP requests when it runs in Native Automation mode. ([#​7640](https://togithub.com/DevExpress/testcafe/issues/7640)). - TestCafe cannot resize browser windows in the latest version of Chrome for macOS ([#​7684](https://togithub.com/DevExpress/testcafe/issues/7684)). - TestCafe incorrectly processes client-side styles, causing slowdowns and errors ([#​6726](https://togithub.com/DevExpress/testcafe/issues/6726), [#​6747](https://togithub.com/DevExpress/testcafe/issues/6747)). - TestCafe crashes when you use the TestCafe Test Runner API to launch multiple tests simultaneously ([#​7711](https://togithub.com/DevExpress/testcafe/issues/7711)). ### [`v2.6.0`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v260-2023-05-11) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v2.5.0...v2.6.0) TestCafe v2.6.0 introduces two enhancements: a new hook that allows users to modify reporter output, and support for JavaScript configuration files with the `.cjs` extension. ##### New reporter hook The [onBeforeWrite](https://testcafe.io/documentation/404388/guides/advanced-guides/modify-reporter-output) hook allows you to modify the output of a reporter. If you want your test reports to include custom content, you can create a custom reporter from scratch. However, this approach takes time and effort. Use the `onBeforeWrite` hook if you want to make minor changes to the output of an existing reporter. Define an `onBeforeWrite` hook in a JavaScript configuration file. The following hook adds the duration in milliseconds to every test entry in the report: ```js //.testcaferc.js or .testcaferc.cjs function onBeforeWriteHook(writeInfo) { // This function will fire every time the reporter calls the "write" method. if (writeInfo.initiator === 'reportTestDone') { // The "initiator" property contains the name of the reporter event that triggered the hook. const { name, testRunInfo, meta } = writeInfo.data || {}; // If you attached this hook to a compatible reporter (such as "spec" or "list"), the hook can process data related to the event. const testDuration = testRunInfo.durationMs; // Save the duration of the test. writeInfo.formattedText = writeInfo.formattedText + ' (' + testDuration + 'ms)'; // Add test duration to the reporter output. }; } module.exports = { // Attach the hook hooks: { reporter: { onBeforeWrite: { 'spec': onBeforeWriteHook, // This hook will fire when you use the default "spec" reporter. }, }, }, }; ``` ![Reporter hook demonstration](https://testcafe.io/images/reporter-hook.png) ##### CJS support If you run TestCafe v2.6.0 and higher, you can now use a configuration file with the `.cjs` file extension. TestCafe detects the `.testcaferc.cjs` file on startup, alongside its `.js` and `.json` counterparts. [TestCafe configuration files](https://testcafe.io/documentation/402638/reference/configuration-file) **only** support CommonJS syntax. Meanwhile, modern JavaScript tools often default to ESM syntax. If a JavaScript project is of type `module`, Node.js expects the project's `.js` files to contain ESM syntax. Use the `.cjs` configuration file extension to let Node.js know that the file contains CommonJS syntax. Many thanks to the TestCafe contributor Damien Guérin ([@​gigaga](https://togithub.com/DevExpress/testcafe/pull/7614)) for the implementation of this capability. ##### Bug fixes - If you call the `t.skipJsErrors` method without arguments, TestCafe passes a `false` value to the method. This behavior is inconsistent with similar methods of a greater scope --- `test.skipJsErrors` and `fixture.skipJsErrors` ([#​7648](https://togithub.com/DevExpress/testcafe/issues/7648)). - Users cannot disable the "quarantine mode" or "skipJsErrors" settings from the command line ([#​7077](https://togithub.com/DevExpress/testcafe/issues/7077)). - TestCafe incorrectly processes exceptions of types other than `Error` ([#​7627](https://togithub.com/DevExpress/testcafe/issues/7627)). - TestCafe does not consistently execute the `t.pressKey` action in Mozilla Firefox. Attempts to press the "backspace" key and the "tab" key, among others, may fail. ([#​7623](https://togithub.com/DevExpress/testcafe/pull/7623)) - When TestCafe runs in Native Automation mode, it incorrectly executes some instances of the `t.request` method. ([#​7609](https://togithub.com/DevExpress/testcafe/issues/7609)) - The TestCafe proxy incorrectly processes private class properties in client-side scripts, which leads to page load failure ([#​7632](https://togithub.com/DevExpress/testcafe/issues/7632), PR by [@​sorin-davidoi](https://togithub.com/sorin-davidoi)). ### [`v2.5.0`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v250-2023-04-06) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v2.4.0...v2.5.0) TestCafe v2.5.0 introduces three major enhancements: - The new `t.report` method passes custom data to the test reporter. - The new `--native-automation` flag enables TestCafe to automate all Chromium-based browsers with the native CDP protocol. - The new `--esm` flag allows users to import ESM modules in test files. ##### t.report Include the [t.report()](https://testcafe.io/documentation/404350/reference/test-api/testcontroller/report) method in your test to pass custom data to the reporter. Specify arguments of any type (string, array, Object, etc). Separate arguments with a comma: ```js await t.report( 'text', {'key': 'value'}, ['arrayItem1', 'arrayItem2'] ); ``` The default `spec` reporter displays custom data after test completion, once for each browser that runs the test. ![Report with custom data](https://testcafe.io/images/treport.png) ##### CDP Automation: Now Stable TestCafe v2.2.0 introduced an experimental [proxyless mode](https://testcafe.io/documentation/404237/guides/intermediate-guides/native-automation-mode) that automated Google Chrome with the native CDP protocol. For the v2.5.0 release, the TestCafe team addressed most issues that our users discovered when the capability was "experimental", and gave it a new name --- Native Automation mode. Unlike its predecessor, the Native Automation mode supports **all** Chromium-based browsers, including Microsoft Edge. Enable the `nativeAutomation` option in the [command line interface](https://testcafe.io/documentation/402639/reference/command-line-interface#--native-automation), the [configuration file](https://testcafe.io/documentation/402638/reference/configuration-file#nativeautomation), or the [runner.run()](https://testcafe.io/documentation/402655/reference/testcafe-api/runner/run#nativeautomation) function to try this capability. > \[!IMPORTANT] > TestCafe v2.5.0 removed the `experimentalProxyless` option from the [createTestCafe](https://testcafe.io/documentation/402662/reference/testcafe-api/global/createtestcafe) function. Use the [runner.run()](https://testcafe.io/documentation/402655/reference/testcafe-api/runner/run#nativeautomation) function to enable Native Automation mode from the TestCafe Test Runner API. ##### ESM Module Support: Now Stable TestCafe v2.5.0 **drops** the `experimental` prefix from the `--esm` [CLI flag](https://testcafe.io/documentation/402639/reference/command-line-interface#--esm). Enable the `--esm` flag to import modules that do not support CommonJS. ```sh testcafe chrome test.js --esm ``` ### [`v2.4.0`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v240-2023-03-06) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v2.3.1...v2.4.0) TestCafe v2.4.0 introduces the Visual Selector Debugger. You can now create and debug Selector queries in the browser window. ##### Visual Selector Debugger TestCafe v2.4.0 displays the Visual Selector Debugger panel when you activate [Debug Mode](https://testcafe.io/documentation/402835/guides/basic-guides/debug-tests). Use the panel to debug Selector queries from your test, or generate new Selector queries. ![](https://testcafe.io/images/inspector/enter-query.gif) If a Selector query causes your test to fail, add the [t.debug()](https://testcafe.io/documentation/402707/reference/test-api/testcontroller/debug) command after the last successful action, and launch the test. When the test reaches the breakpoint, the window that runs the test displays the Selector Debugger panel. Copy the failing Selector query from test code to the Selector Debugger input field. - TestCafe highlights page elements that match the Selector query. - If no elements match the Selector query, the panel displays the **No Matching Elements** warning. - If your Selector query contians a syntax error, the panel displays the **Invalid Selector** warning. To interactively generate a Selector query, click the **Pick** button, and select the target element on the page. For more information on the panel, its capabilities, and limitations, read the [Visual Selector Debugger Guide](https://testcafe.io/documentation/404288/guides/intermediate-guides/visual-selector-debugger). ##### Bug Fixes - TestCafe cannot execute the [t.request](https://testcafe.io/documentation/403981/reference/test-api/testcontroller/request) action in [proxyless mode](https://testcafe.io/documentation/404237/guides/experimental-capabilities/proxyless-mode) ([#​7523](https://togithub.com/DevExpress/testcafe/issues/7523)). ### [`v2.3.1`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v231-2023-02-09) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v2.3.0...v2.3.1) TestCafe v2.3.1 introduces a number of bug fixes. ##### Bug Fixes - Client-side code with optional chaining may trigger a TestCafe error ([#​7387](https://togithub.com/DevExpress/testcafe/issues/7387)). - TestCafe cannot interact with images from the Shadow DOM ([#​7454](https://togithub.com/DevExpress/testcafe/issues/7454)). - TestCafe v2.3.0 fails to launch when the `test.meta` method precedes test code ([#​7482](https://togithub.com/DevExpress/testcafe/issues/7482)). - When TestCafe launches a headless instance of Google Chrome in proxyless mode, it cannot interact with elements that are overlapped by the status bar ([#​7483](https://togithub.com/DevExpress/testcafe/issues/7483)). ### [`v2.3.0`](https://togithub.com/DevExpress/testcafe/blob/HEAD/CHANGELOG.md#v230-2023-01-30) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v2.2.0...v2.3.0) TestCafe v2.3.0 introduces `create-testcafe` --- an interactive tool that allows you to initialize a new TestCafe project in seconds. The update also includes *experimental* ECMAScript module support and a number of bug fixes. > ***IMPORTANT:*** > TestCafe v2.3.0 ends support for Node.js 14 due to a known vulnerability in the `babel-plugin-module-resolver` module. > > Install an up-to-date version of the Node.js runtime to use TestCafe v2.3.0 and up. > > The official maintenance period for Node.js 14 [elapses](https://endoflife.date/nodejs) on April 1st, 2023. ##### create-testcafe Use the [create-testcafe](https://togithub.com/devexpress/create-testcafe) tool to initialize a new TestCafe project, or *add* TestCafe to an existing Node.js application. Execute the following command to launch `create-testcafe`: ```sh npx create-testcafe ``` ![example](https://testcafe.io/images/create-testcafe/wizard.gif) The `create-testcafe` tool allows you to perform the following actions with a single command: 1. Create a new folder for the TestCafe project *(optional)*. 2. Create a new local installation of TestCafe and its dependencies. 3. Create and initialize a TestCafe configuration file. 4. Create a separate subfolder for tests. 5. Populate the test folder with test examples *(optional)*. 6. Create a YAML file with a GitLab Actions workflow that runs TestCafe tests *(optional)*. Read the [TestCafe Setup Wizard guide](https://testcafe.io/documentation/404259/guides/best-practices/create-testcafe) for more information on the create-testcafe tool. ##### Experimental: ECMAScript module support > ***IMPORTANT:*** > ESM module suppport works with Node.js 16 and up. TestCafe has always used *CommonJS* syntax for module imports: ```js const { x } = require('y'); ``` An increasing number of Node.JS packages abandon CommonJS in favour of [ECMAScript module syntax](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c): ```js import {x} from 'y' ``` Enable the `--experimental-esm` [CLI flag](https://testcafe.io/documentation/402639/reference/command-line-interface#--experimental-esm) to import modules that do not support CommonJS. Note: tests with ECMASCript module syntax are subject to [additional requirements](https://testcafe.io/404257/release-notes/framework/2023-1-30-testcafe-v2-3-0-released#additional-reuqirements). ```sh testcafe chrome test.js --experimental-esm ``` ##### Additional Reuqirements To run tests with ECMAScript `import` statements, make sure that your project meets at least one of the following requirements: 1. The value of the `type` key in your project's [package.json file](https://nodejs.org/api/packages.html#packagejson-and-file-extensions) is `module`. 2. The test files in your project use the `.mjs` extension. ##### Bug Fixes - TestCafe doesn't delete expired cookies ([#​7432](https://togithub.com/DevExpress/testcafe/issues/7432)). - TestCafe cannot handle windows that appear when the user clicks a link with a `_blank` target ([#​6926](https://togithub.com/DevExpress/testcafe/issues/6926)). - TestCafe fails to start because it triggers the `dns.setDefaultResultOrder` method in older Node.js environments ([#​7447](https://togithub.com/DevExpress/testcafe/issues/7447)). - TestCafe depends on a vulnerable, outdated version of the `babel-plugin-module-resolver` package ([#​7456](https://togithub.com/DevExpress/testcafe/issues/7456)).

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.



This PR was generated by Mend Renovate. View the repository job log.

adaptly-bot commented 1 year ago

:warning:  testcafe

 Breaking changes
1: End of support for Node.js 14 > TestCafe v2.3.0 ends support for Node.js 14 due to a known vulnerability in the `babel-plugin-module-resolver` module. You need to install an up-to-date version of the Node.js runtime to use TestCafe v2.3.0 and up.
2: Experimental: ECMAScript module support > TestCafe has introduced experimental ECMAScript module support which works with Node.js 16 and up. This means if you are using CommonJS syntax for module imports, you may need to switch to ECMAScript module syntax. Enable the `--experimental-esm` CLI flag to import modules that do not support CommonJS. Additionally, to run tests with ECMAScript `import` statements, your project must meet at least one of the following requirements: The value of the `type` key in your project's package.json file is `module`, or the test files in your project use the `.mjs` extension.

:bust_in_silhouette: Who am I? I am a bot that helps developers to update dependencies by informing if changelogs contain breaking changes or not.

:wave: See you again? If you want my help with other dependency updates, add me to your repository.

PS. I hope I didn't bother you - my purpose is to help developers and I won't comment anymore without your request. Feel free to shoot me a message about anything support@adaptly.dev. Cheers.