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

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

Merged
merged 1 commit into from
Aug 14, 2023
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 21, 2023

Mend Renovate

This PR contains the following updates:

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

Release Notes

DevExpress/testcafe (testcafe)

v3.1.0

Compare Source

TestCafe v3.1.0 Released

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


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

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/testcafe-3.x branch 6 times, most recently from e0acd60 to c5f9f9b Compare June 28, 2023 23:13
@renovate renovate bot force-pushed the renovate/testcafe-3.x branch 8 times, most recently from 1a4417b to 364ae45 Compare July 5, 2023 18:35
@renovate renovate bot force-pushed the renovate/testcafe-3.x branch 4 times, most recently from a06c6f6 to b05a268 Compare July 12, 2023 21:19
@renovate renovate bot force-pushed the renovate/testcafe-3.x branch 3 times, most recently from 54c13b1 to 5cda748 Compare July 18, 2023 06:05
@renovate renovate bot force-pushed the renovate/testcafe-3.x branch 4 times, most recently from a063f83 to eae0791 Compare July 29, 2023 00:42
@renovate renovate bot force-pushed the renovate/testcafe-3.x branch 4 times, most recently from c23fde1 to 1259a7e Compare August 9, 2023 09:19
@renovate renovate bot force-pushed the renovate/testcafe-3.x branch 2 times, most recently from ab059db to 590b82c Compare August 10, 2023 23:05
@pubkey pubkey merged commit aac43a4 into master Aug 14, 2023
3 checks passed
@renovate renovate bot deleted the renovate/testcafe-3.x branch August 14, 2023 11:17
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.

1 participant