From 4e02e3af4f90abe60ce5a7ba101da2ea9cdf95a8 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Fri, 25 Oct 2024 13:00:42 -0400 Subject: [PATCH 01/11] remove logic around min supported browsers BREAKING: remove logic around min supported browsers --- cli/types/cypress.d.ts | 8 - .../src/settings/project/ConfigCode.cy.tsx | 1 - .../src/sources/BrowserDataSource.ts | 4 - packages/errors/src/errors.ts | 3 - .../cypress/fixtures/config.json | 2 - .../support/mock-graphql/longBrowsersList.ts | 17 -- .../topnav/VerticalBrowserListItems.vue | 34 +--- packages/graphql/schemas/schema.graphql | 2 - .../schemaTypes/objectTypes/gql-Browser.ts | 4 - .../__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 | 25 +-- packages/launcher/lib/known-browsers.ts | 54 +----- packages/launcher/test/unit/browsers_spec.ts | 178 +----------------- packages/launcher/test/unit/detect_spec.ts | 87 --------- packages/launcher/test/unit/linux_spec.ts | 2 - .../launchpad/src/setup/OpenBrowserList.vue | 22 +-- packages/types/src/browser.ts | 14 -- 19 files changed, 15 insertions(+), 478 deletions(-) diff --git a/cli/types/cypress.d.ts b/cli/types/cypress.d.ts index f0f0c914b1c3..744d6bb6499c 100644 --- a/cli/types/cypress.d.ts +++ b/cli/types/cypress.d.ts @@ -124,14 +124,6 @@ declare namespace Cypress { * Warning text to accompany this browser. Shown in desktop-gui. */ 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. - */ - 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/data-context/src/sources/BrowserDataSource.ts b/packages/data-context/src/sources/BrowserDataSource.ts index e8a933f58b9d..6f7c0f7effa9 100644 --- a/packages/data-context/src/sources/BrowserDataSource.ts +++ b/packages/data-context/src/sources/BrowserDataSource.ts @@ -127,8 +127,4 @@ export class BrowserDataSource { return false } - - isVersionSupported (obj: FoundBrowser) { - return Boolean(!obj.unsupportedVersion) - } } diff --git a/packages/errors/src/errors.ts b/packages/errors/src/errors.ts index 589353504a4e..855512932bd8 100644 --- a/packages/errors/src/errors.ts +++ b/packages/errors/src/errors.ts @@ -1426,9 +1426,6 @@ export const AllCypressErrors = { https://on.cypress.io/component-testing` }, - UNSUPPORTED_BROWSER_VERSION: (errorMsg: string) => { - return errTemplate`${fmt.off(errorMsg)}` - }, // V10 Added: diff --git a/packages/frontend-shared/cypress/fixtures/config.json b/packages/frontend-shared/cypress/fixtures/config.json index a88d6e939039..e481c1b91155 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..bcc842b0fe77 100644 --- a/packages/frontend-shared/cypress/support/mock-graphql/longBrowsersList.ts +++ b/packages/frontend-shared/cypress/support/mock-graphql/longBrowsersList.ts @@ -10,7 +10,6 @@ export const longBrowsersList = [ majorVersion: '73', info: 'Info about electron browser', isFocusSupported: true, - isVersionSupported: true, disabled: false, }, { @@ -23,7 +22,6 @@ export const longBrowsersList = [ path: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', majorVersion: '78', isFocusSupported: true, - isVersionSupported: true, disabled: false, }, { @@ -36,7 +34,6 @@ export const longBrowsersList = [ path: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', majorVersion: '88', isFocusSupported: true, - isVersionSupported: true, disabled: false, }, { @@ -49,7 +46,6 @@ export const longBrowsersList = [ path: '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary', majorVersion: '80', isFocusSupported: true, - isVersionSupported: true, disabled: false, }, { @@ -62,7 +58,6 @@ export const longBrowsersList = [ path: '/Applications/Chromium.app/Contents/MacOS/Chromium', majorVersion: '74', isFocusSupported: true, - isVersionSupported: true, disabled: false, }, { @@ -75,7 +70,6 @@ export const longBrowsersList = [ path: '/Applications/Chromium.app/Contents/MacOS/Chromium', majorVersion: '85', isFocusSupported: true, - isVersionSupported: true, disabled: false, }, { @@ -88,7 +82,6 @@ export const longBrowsersList = [ path: '/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta', majorVersion: '79', isFocusSupported: true, - isVersionSupported: false, disabled: false, }, { @@ -101,7 +94,6 @@ export const longBrowsersList = [ path: '/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary', majorVersion: '79', isFocusSupported: true, - isVersionSupported: true, disabled: false, }, { @@ -114,7 +106,6 @@ export const longBrowsersList = [ path: '/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev', majorVersion: '79', isFocusSupported: true, - isVersionSupported: true, disabled: false, }, { @@ -126,9 +117,7 @@ export const longBrowsersList = [ version: '69.0.1', path: '/Applications/Firefox/Contents/MacOS/Firefox', majorVersion: '69', - unsupportedVersion: true, isFocusSupported: true, - isVersionSupported: false, disabled: true, }, { @@ -140,9 +129,7 @@ export const longBrowsersList = [ version: '75.0.1', path: '/Applications/Firefox/Contents/MacOS/Firefox', majorVersion: '75', - unsupportedVersion: true, isFocusSupported: true, - isVersionSupported: false, disabled: true, }, { @@ -155,9 +142,7 @@ export const longBrowsersList = [ path: '/Applications/Firefox Developer/Contents/MacOS/Firefox Developer', majorVersion: '69', isFocusSupported: true, - isVersionSupported: false, disabled: true, - warning: 'Cypress does not support running Firefox Developer Edition version 69. To use Firefox Developer Edition with Cypress, install a version of Firefox Developer Edition newer than or equal to 78.', }, { id: '13', @@ -169,7 +154,6 @@ export const longBrowsersList = [ path: '/Applications/Firefox Nightly/Contents/MacOS/Firefox Nightly', majorVersion: '69', isFocusSupported: false, - isVersionSupported: false, disabled: true, }, { @@ -182,7 +166,6 @@ export const longBrowsersList = [ path: '/Applications/Fake Browser/Contents/MacOS/Fake Browser', majorVersion: '79', isFocusSupported: false, - isVersionSupported: false, disabled: true, }, ] as const diff --git a/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue b/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue index 96bb32b445d9..3857b7907ea8 100644 --- a/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue +++ b/packages/frontend-shared/src/gql-components/topnav/VerticalBrowserListItems.vue @@ -6,9 +6,9 @@ class="border-b border-transparent cursor-pointer flex border-b-gray-50 border-[1px] min-w-[240px] py-[12px] px-[16px] transition-colors duration-300 group focus-within-default" :class="{ 'bg-jade-50': browser.isSelected, - 'hover:bg-indigo-50 focus-within:bg-indigo-50': !browser.isSelected && !browser.disabled && browser.isVersionSupported, - 'bg-gray-50 cursor-not-allowed': browser.disabled || !browser.isVersionSupported, - 'cursor-pointer': !browser.disabled && browser.isVersionSupported + 'hover:bg-indigo-50 focus-within:bg-indigo-50': !browser.isSelected && !browser.disabled, + 'bg-gray-50 cursor-not-allowed': browser.disabled, + 'cursor-pointer': !browser.disabled }" data-cy="top-nav-browser-list-item" @@ -17,7 +17,7 @@ > @@ -26,9 +26,9 @@