From 0aa73c44d52039b4202666ad6f4316193c1837f4 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Fri, 1 Nov 2024 11:04:00 -0400 Subject: [PATCH] breaking: remove logic around min supported browsers (#30462) * remove logic around min supported browsers BREAKING: remove logic around min supported browsers * changelog entry * forgot to save some changed files * update broken tests * remove another test testing unsupported browsers * Add back logic for browser validator * return if validator is undefined * update called browser * fix failing tests * fix logic of unsupported showing * add parens --- cli/CHANGELOG.md | 1 + cli/types/cypress.d.ts | 6 +- .../src/settings/project/ConfigCode.cy.tsx | 1 - .../UNSUPPORTED_BROWSER_VERSION.html | 38 ---- packages/errors/src/errors.ts | 1 + .../cypress/fixtures/config.json | 2 - .../support/mock-graphql/longBrowsersList.ts | 14 +- .../gql-components/HeaderBarContent.cy.tsx | 5 - .../topnav/VerticalBrowserListItems.vue | 17 +- .../frontend-shared/src/locales/en-US.json | 1 - .../__snapshots__/browsers_spec.ts.js | 11 - .../launcher/__snapshots__/darwin_spec.ts.js | 11 - .../launcher/__snapshots__/windows_spec.ts.js | 14 -- packages/launcher/lib/detect.ts | 11 +- packages/launcher/lib/known-browsers.ts | 66 ++---- packages/launcher/test/unit/browsers_spec.ts | 189 ++++-------------- packages/launcher/test/unit/detect_spec.ts | 45 +---- packages/launcher/test/unit/linux_spec.ts | 2 - .../src/setup/OpenBrowserList.cy.tsx | 26 --- .../launchpad/src/setup/OpenBrowserList.vue | 14 +- packages/types/src/browser.ts | 2 - 21 files changed, 81 insertions(+), 396 deletions(-) delete mode 100644 packages/errors/__snapshot-html__/UNSUPPORTED_BROWSER_VERSION.html diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 55105c0d409a..3894a778092f 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -7,6 +7,7 @@ _Released 12/3/2024 (PENDING)_ - Removed support for Node.js 16 and Node.js 21. Addresses [#29930](https://github.com/cypress-io/cypress/issues/29930). - Prebuilt binaries for Linux are no longer compatible with Linux distributions based on glibc <2.28, for example: Ubuntu 14-18, RHEL 7, CentOS 7, Amazon Linux 2. Addresses [#29601](https://github.com/cypress-io/cypress/issues/29601). +- Cypress now only officially supports the latest 3 major versions of Chrome, Firefox, and Edge - older browser versions may still work, but we recommend keeping your browsers up to date to ensure compatibility with Cypress. A warning will no longer be displayed on browser selection in the Launchpad for any 'unsupported' browser versions. Additionally, the undocumented `minSupportedVersion` property has been removed from `Cypress.browser`. Addressed in [#30462](https://github.com/cypress-io/cypress/pull/30462). - The `delayMs` option of `cy.intercept()` has been removed. This option was deprecated in Cypress 6.4.0. Please use the `delay` option instead. Addressed in [#30463](https://github.com/cypress-io/cypress/pull/30463). - The `experimentalFetchPolyfill` configuration option was removed. This option was deprecated in Cypress 6.0.0. We recommend using `cy.intercept()` for handling fetch requests. Addressed in [#30466](https://github.com/cypress-io/cypress/pull/30466). - We removed yielding the second argument of `before:browser:launch` as an array of browser arguments. This behavior has been deprecated since Cypress 4.0.0. Addressed in [#30460](https://github.com/cypress-io/cypress/pull/30460). diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index 49369e731007..16064021ddcf 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -118,11 +118,7 @@ declare namespace Cypress { */ warning?: string /** - * The minimum majorVersion of this browser supported by Cypress. - */ - minSupportedVersion?: number - /** - * If `true`, this browser is too old to be supported by Cypress. + * If `true`, this browser version is not supported in Cypress. */ unsupportedVersion?: boolean } diff --git a/packages/app/src/settings/project/ConfigCode.cy.tsx b/packages/app/src/settings/project/ConfigCode.cy.tsx index 900c20468adc..7ff925041368 100644 --- a/packages/app/src/settings/project/ConfigCode.cy.tsx +++ b/packages/app/src/settings/project/ConfigCode.cy.tsx @@ -190,7 +190,6 @@ describe('', () => { browser.displayName && cy.contains(`displayName: '${browser.displayName}',`) browser.version && cy.contains(`version: '${browser.version}',`) browser.path && cy.contains(`path: '${browser.path}',`) - browser.minSupportedVersion && cy.contains(`minSupportedVersion: ${browser.minSupportedVersion},`) browser.majorVersion && cy.contains(`majorVersion: ${browser.majorVersion},`) }) } else { diff --git a/packages/errors/__snapshot-html__/UNSUPPORTED_BROWSER_VERSION.html b/packages/errors/__snapshot-html__/UNSUPPORTED_BROWSER_VERSION.html deleted file mode 100644 index fd88bc7d472c..000000000000 --- a/packages/errors/__snapshot-html__/UNSUPPORTED_BROWSER_VERSION.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - -
Cypress does not support running chrome version 64. To use chrome with Cypress, install a version of chrome newer than or equal to 64.
-
\ No newline at end of file diff --git a/packages/errors/src/errors.ts b/packages/errors/src/errors.ts index 81938ef15846..79dd5f6422c4 100644 --- a/packages/errors/src/errors.ts +++ b/packages/errors/src/errors.ts @@ -1416,6 +1416,7 @@ export const AllCypressErrors = { https://on.cypress.io/component-testing` }, + UNSUPPORTED_BROWSER_VERSION: (errorMsg: string) => { return errTemplate`${fmt.off(errorMsg)}` }, diff --git a/packages/frontend-shared/cypress/fixtures/config.json b/packages/frontend-shared/cypress/fixtures/config.json index 30279be66244..9b9f487204f2 100644 --- a/packages/frontend-shared/cypress/fixtures/config.json +++ b/packages/frontend-shared/cypress/fixtures/config.json @@ -23,7 +23,6 @@ "displayName": "Chrome", "version": "97.0.4692.71", "path": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", - "minSupportedVersion": 64, "majorVersion": 97 }, { @@ -33,7 +32,6 @@ "displayName": "Firefox", "version": "95.0.2", "path": "/Applications/Firefox.app/Contents/MacOS/firefox", - "minSupportedVersion": 86, "majorVersion": 95 }, { diff --git a/packages/frontend-shared/cypress/support/mock-graphql/longBrowsersList.ts b/packages/frontend-shared/cypress/support/mock-graphql/longBrowsersList.ts index 68b53727e0e8..fb13244856ab 100644 --- a/packages/frontend-shared/cypress/support/mock-graphql/longBrowsersList.ts +++ b/packages/frontend-shared/cypress/support/mock-graphql/longBrowsersList.ts @@ -84,9 +84,9 @@ export const longBrowsersList = [ displayName: 'Edge Beta', family: 'chromium', channel: 'beta', - version: 'unsupported', + version: '85.0.309.71', path: '/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta', - majorVersion: '79', + majorVersion: '85', isFocusSupported: true, isVersionSupported: false, disabled: false, @@ -126,9 +126,8 @@ export const longBrowsersList = [ version: '69.0.1', path: '/Applications/Firefox/Contents/MacOS/Firefox', majorVersion: '69', - unsupportedVersion: true, isFocusSupported: true, - isVersionSupported: false, + isVersionSupported: true, disabled: true, }, { @@ -140,9 +139,8 @@ export const longBrowsersList = [ version: '75.0.1', path: '/Applications/Firefox/Contents/MacOS/Firefox', majorVersion: '75', - unsupportedVersion: true, isFocusSupported: true, - isVersionSupported: false, + isVersionSupported: true, disabled: true, }, { @@ -169,7 +167,7 @@ export const longBrowsersList = [ path: '/Applications/Firefox Nightly/Contents/MacOS/Firefox Nightly', majorVersion: '69', isFocusSupported: false, - isVersionSupported: false, + isVersionSupported: true, disabled: true, }, { @@ -182,7 +180,7 @@ export const longBrowsersList = [ path: '/Applications/Fake Browser/Contents/MacOS/Fake Browser', majorVersion: '79', isFocusSupported: false, - isVersionSupported: false, + isVersionSupported: true, disabled: true, }, ] as const diff --git a/packages/frontend-shared/src/gql-components/HeaderBarContent.cy.tsx b/packages/frontend-shared/src/gql-components/HeaderBarContent.cy.tsx index 0d9ed5595d47..16d82495cd7f 100644 --- a/packages/frontend-shared/src/gql-components/HeaderBarContent.cy.tsx +++ b/packages/frontend-shared/src/gql-components/HeaderBarContent.cy.tsx @@ -53,11 +53,6 @@ describe('', { viewportWidth: 1000, viewportHeight: 750 }, ( }) cy.contains('Unsupported browser').should('be.visible') - - /* - TODO: fix flaky test https://github.com/cypress-io/cypress/issues/23436 - cy.percySnapshot('unsupported browser tooltip') - */ }) describe('breadcrumbs', () => { diff --git a/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue b/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue index 96bb32b445d9..6ee142b30fb2 100644 --- a/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue +++ b/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue @@ -11,7 +11,6 @@ 'cursor-pointer': !browser.disabled && browser.isVersionSupported }" data-cy="top-nav-browser-list-item" - :data-browser-id="browser.id" @click="handleBrowserChoice(browser)" > @@ -24,7 +23,7 @@
-
-