Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency testcafe to v3 #454

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 4, 2024

This PR contains the following updates:

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

Release Notes

DevExpress/testcafe (testcafe)

v3.7.0

Compare Source

The TestCafe v3.7.0 update includes the capability to use Metadata as an interface, esm configuration file option, and a number of bug fixes.

meta-readmore

Declare Metadata Interface

Earlier versions of TestCafe supported Metadata as a type. In TestCafe v3.7.0 and higher, you should declare Metadata as an interface.

// testcafe.global.d.ts
declare module "testcafe" {
	global {
		interface Metadata {
			manual?: boolean,
		}
	}
}
New Configuration File Option: esm

Earlier versions of TestCafe supported the ESM Module from the CLI only. In TestCafe v3.7.0 and higher, you can use the esm configuration file option. Note that this option only works with Node.js 18.19-18.xx, and 20.8.0 and up.

Bug Fixes
  • CDP client tab creation causes a WebSocket connection closed error in Chrome v130 (#​8286).
  • An unhandled promise rejection occurs while launching sub-windows (#​8258).
  • Assertions that perform visibility checks fail despite elements being visible on the page (#​8237).
  • The t.getCurrentCDPSession method returns unknown (#​8228).
  • [Native Automation] Request hooks are applied to skipped tests (#​8229).
  • A WebSocket connection closed error occurs while running TestCafe in Chrome v127. The updated version includes the --disable-search-engine-choice-screen flag (#​8240).
  • A leaveElement method call causes an error when the prevElement object is removed from the DOM (#​8264).

v3.6.2

Compare Source

Bug Fixes
  • [Native Automation] TestCafe incorrectly uploads files in Chrome v125 and up. (#​8198)
  • TestCafe dependencies include the vulnerable endpoint-utils package (#​8207). The updated version includes the address package instead.

v3.6.1

Compare Source

Bug Fixes
  • TestCafe incorrectly calculates the dimensions of multi-line elements. (#​8179)
  • TestCafe incorrectly executes the resizeWindow method if you maximize the target window first. (#​8157)

v3.6.0

Compare Source

The TestCafe v3.6.0 update includes two minor changes and a number of bug fixes.

v3.5.0

Compare Source

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() method, TestCafe uses the query to populate the input field of the Visual Selector Debugger. The debugger highlights page elements that match the query.

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 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.

{
    "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 action to specify a custom naming pattern for an individual screenshot:

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 --- 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 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' v7.23.3 or greater (#​8091).
  • If you enable concurrent test execution, TestCafe launches tests before the conclusion of the fixture.before hook (#​6999).
  • The Fixture.disableConcurrency method does not disable concurrent test execution (8087).
  • TestCafe ignores the fullPage option when it takes screenshots on test failure (#​7761).
  • [Native Automation] TestCafe cannot populate file input fields with the required attribute (#​8079).
  • [Native Automation] TestCafe fails to execute tests that use service workers (#​8005, #​8054).
  • When an action target is obscured by a sticky element, TestCafe incorrectly calculates the scroll distance necessary to interact with the target. (#​7377).
  • Incorrect processing of front-end scripts causes automation errors (#​7713, #​8067, testcafe-hammerhead#2969).
  • TestCafe incorrectly processes failing network requests when it runs on Node.js v16 and greater (#​7097).
  • TestCafe incorrectly handles native dialogs in Mozilla Firefox (#​6815).

v3.4.0

Compare Source

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. In TestCafe v3.4.0 and higher, if you set the baseUrl configuration file parameter or the --base-url CLI option, you can set a relative URL for a Role log-in page:

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 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 fixture method.

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.

Debug Panel Enhancements

The debug panel 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

Bug Fixes
  • TestCafe incorrectly logs requests during concurrent test execution (#​7977).
  • TestCafe does not load images with non-lowercase srcset attribute declarations (testcafe-hammerhead#2958).
  • TestCafe raises an unexpected client-side error when the application opens an ngx-formly form (#​7758).
  • TestCafe cannot interact with page items at the edge of the viewport when the browser emulates a mobile device (#​8057).

v3.3.0

Compare Source

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).
  • Firefox throws an unexpected error when TestCafe attempts to close the browser window (#​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).
  • [Native Automation] TestCafe ignores the clientScripts directive when you mock HTTP requests (#​7914).
  • [Native Automation] TestCafe hangs when it runs tests in the headless version of Google Chrome (#​7898).
  • [Native Automation] TestCafe doesn't throw an error when the user attempts to enable the userProfile option (#​7925).

v3.2.0

Compare Source

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 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:

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 by @​sethidden).
  • TestCafe does not clear cookie storage if a Role activation URL is the same as the page URL (#​7874).
  • [Native Automation] TestCafe incorrectly processes web pages with file inputs (#​7886).

v3.1.0

Compare Source

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

Use the t.setNativeDialogHandler method to respond to geolocation requests.

  • Return an Error type object to Block geolocation requests.
  • Return an object with coordinates to trigger the success callback of the getCurrentPosition method.
// 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

Earlier versions of TestCafe could output the framework's version number to the console:

CLI version

TestCafe 3.1.0 and up allows you to access the framework's version number in test code:

import { version } from 'testcafe';
console.log(`TestCafe version: ${version}`);

API version

To access the framework's version number in your custom reporter, reference the first argument (version) of the init method:

init (version) {
   this
      .write(`Using TestCafe ${version}`)
      .newline()
}
Bug fixes
  • TestCafe incorrectly reports test duration in concurrency mode (#​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).
  • [Native Automation] The setFileUpload method does not work (#​7832).
  • [Native Automation] Request hooks cause tests to crash (#​7846).
  • [Native Automation] TestCafe overrides page titles (#​7833).
  • [Native Automation] If a website redirects the user to a new page before basic HTTP authentication is complete, the authentication process fails (#​7852).
  • [Native Automation] The t.click action fails if the event handler accounts for pointer input pressure (#​7867).
  • [Native Automation] TestCafe hangs when the browser yields a "Session with given ID not found" error (#​7865,#​7810).
  • [Native Automation] TestCafe cannot set the httpOnly flag when you use the t.setCookies method (#​7793).

v3.0.1

Compare Source

Bug fixes
  • The TestCafe status bar overlaps page elements, which leads to test execution issues (#​7797)
  • TestCafe outputs an unhelpful warning message when it cannot apply the artifact path template (#​7256)
  • A bug in the testcafe-browser-tools package causes TestCafe tests to hang on Ubuntu (#​7752)

v3.0.0

Compare Source

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.

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
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 for more information.

Dismiss the print dialog

You can now use the t.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. The browser came out more than 9 years ago, and has a worldwide market of less than 0.5%. 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).
  • TestCafe fails to correctly modify certain request headers when it uses native automation (#​7748).
  • A bug in the CDP protocol causes TestCafe to incorrectly process request hooks (#​7743).
  • TestCafe outputs a vague error message if the framework fails to read or process the configuration file (#​7208, #​6437).
  • TestCafe cannot select content with the "Ctrl+A" shortcut when the framework uses native automation (#​7667).
  • The Monaco editor does not display code completion hints when TestCafe automates it with CDP #​7770.

Configuration

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

🚦 Automerge: Enabled.

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.


  • If you want to rebase/retry this PR, check this box

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

@renovate renovate bot force-pushed the renovate/testcafe-3.x branch 13 times, most recently from dcff847 to 9744557 Compare February 9, 2024 04:00
@renovate renovate bot force-pushed the renovate/testcafe-3.x branch 12 times, most recently from 75891f6 to 1842998 Compare February 19, 2024 22:31
@renovate renovate bot force-pushed the renovate/testcafe-3.x branch 5 times, most recently from e98ccee to 73c06ab Compare March 15, 2024 10:33
@renovate renovate bot force-pushed the renovate/testcafe-3.x branch 3 times, most recently from 5703c92 to b1ea2dc Compare September 10, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants