internetarchive / bookreader

The Internet Archive BookReader
https://openlibrary.org/dev/docs/bookreader
GNU Affero General Public License v3.0
997 stars 419 forks source link

Update dependency testcafe to v3 #1283

Closed renovate[bot] closed 1 year ago

renovate[bot] commented 1 year ago

Mend Renovate logo banner

This PR contains the following updates:

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

Release Notes

DevExpress/testcafe (testcafe) ### [`v3.4.0`](https://togithub.com/DevExpress/testcafe/releases/tag/v3.4.0) [Compare Source](https://togithub.com/DevExpress/testcafe/compare/v3.3.0...v3.4.0) ### TestCafe v3.4.0 Released 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. #### 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.disablePageCaching` .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-selector-picker](https://togithub.com/DevExpress/testcafe/assets/77216072/bef575c3-ba11-427d-855e-dbcc024607ce) #### 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).

Configuration

πŸ“… Schedule: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

πŸ”• Ignore: Close this PR and you won't be reminded about this update again.



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

codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (c43c5d3) 69.28% compared to head (8baaa38) 69.28%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1283 +/- ## ======================================= Coverage 69.28% 69.28% ======================================= Files 59 59 Lines 5079 5079 Branches 1068 1068 ======================================= Hits 3519 3519 Misses 1533 1533 Partials 27 27 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.