+
Unsupported browser
{{ browser.warning }}
diff --git a/packages/frontend-shared/src/locales/en-US.json b/packages/frontend-shared/src/locales/en-US.json
index 12633d1ae238..6f384698bf44 100644
--- a/packages/frontend-shared/src/locales/en-US.json
+++ b/packages/frontend-shared/src/locales/en-US.json
@@ -316,7 +316,6 @@
"topNav": {
"released": "Released",
"version": "Version",
- "versionUnsupported": "Unsupported",
"installed": "Installed",
"latest": "Latest",
"seeAllReleases": "See all releases",
diff --git a/packages/launcher/__snapshots__/browsers_spec.ts.js b/packages/launcher/__snapshots__/browsers_spec.ts.js
index 41bc8b32e916..f01ee6d7b91c 100644
--- a/packages/launcher/__snapshots__/browsers_spec.ts.js
+++ b/packages/launcher/__snapshots__/browsers_spec.ts.js
@@ -10,7 +10,6 @@ exports['browsers returns the expected list of browsers 1'] = [
'chrome',
'google-chrome-stable',
],
- 'minSupportedVersion': 64,
},
{
'name': 'chromium',
@@ -22,7 +21,6 @@ exports['browsers returns the expected list of browsers 1'] = [
'chromium-browser',
'chromium',
],
- 'minSupportedVersion': 64,
},
{
'name': 'chrome',
@@ -31,7 +29,6 @@ exports['browsers returns the expected list of browsers 1'] = [
'displayName': 'Chrome Beta',
'versionRegex': {},
'binary': 'google-chrome-beta',
- 'minSupportedVersion': 64,
},
{
'name': 'chrome',
@@ -40,7 +37,6 @@ exports['browsers returns the expected list of browsers 1'] = [
'displayName': 'Canary',
'versionRegex': {},
'binary': 'google-chrome-canary',
- 'minSupportedVersion': 64,
},
{
'name': 'firefox',
@@ -49,7 +45,6 @@ exports['browsers returns the expected list of browsers 1'] = [
'displayName': 'Firefox',
'versionRegex': {},
'binary': 'firefox',
- 'minSupportedVersion': 86,
},
{
'name': 'firefox',
@@ -61,7 +56,6 @@ exports['browsers returns the expected list of browsers 1'] = [
'firefox-developer-edition',
'firefox',
],
- 'minSupportedVersion': 86,
},
{
'name': 'firefox',
@@ -73,7 +67,6 @@ exports['browsers returns the expected list of browsers 1'] = [
'firefox-nightly',
'firefox-trunk',
],
- 'minSupportedVersion': 86,
},
{
'name': 'edge',
@@ -85,7 +78,6 @@ exports['browsers returns the expected list of browsers 1'] = [
'edge',
'microsoft-edge',
],
- 'minSupportedVersion': 79,
},
{
'name': 'edge',
@@ -97,7 +89,6 @@ exports['browsers returns the expected list of browsers 1'] = [
'edge-canary',
'microsoft-edge-canary',
],
- 'minSupportedVersion': 79,
},
{
'name': 'edge',
@@ -109,7 +100,6 @@ exports['browsers returns the expected list of browsers 1'] = [
'edge-beta',
'microsoft-edge-beta',
],
- 'minSupportedVersion': 79,
},
{
'name': 'edge',
@@ -121,6 +111,5 @@ exports['browsers returns the expected list of browsers 1'] = [
'edge-dev',
'microsoft-edge-dev',
],
- 'minSupportedVersion': 79,
},
]
diff --git a/packages/launcher/__snapshots__/darwin_spec.ts.js b/packages/launcher/__snapshots__/darwin_spec.ts.js
index 4cd70c8c8c14..2043be0ce350 100644
--- a/packages/launcher/__snapshots__/darwin_spec.ts.js
+++ b/packages/launcher/__snapshots__/darwin_spec.ts.js
@@ -10,7 +10,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
'chrome',
'google-chrome-stable',
],
- 'minSupportedVersion': 64,
'path': '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
'version': 'someVersion',
'findAppParams': {
@@ -30,7 +29,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
'chromium-browser',
'chromium',
],
- 'minSupportedVersion': 64,
'path': '/Applications/Chromium.app/Contents/MacOS/Chromium',
'version': 'someVersion',
'findAppParams': {
@@ -47,7 +45,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
'displayName': 'Chrome Beta',
'versionRegex': {},
'binary': 'google-chrome-beta',
- 'minSupportedVersion': 64,
'path': '/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta',
'version': 'someVersion',
'findAppParams': {
@@ -64,7 +61,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
'displayName': 'Canary',
'versionRegex': {},
'binary': 'google-chrome-canary',
- 'minSupportedVersion': 64,
'path': '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary',
'version': 'someVersion',
'findAppParams': {
@@ -81,7 +77,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
'displayName': 'Firefox',
'versionRegex': {},
'binary': 'firefox',
- 'minSupportedVersion': 86,
'path': '/Applications/Firefox.app/Contents/MacOS/firefox',
'version': 'someVersion',
'findAppParams': {
@@ -101,7 +96,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
'firefox-developer-edition',
'firefox',
],
- 'minSupportedVersion': 86,
'path': '/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox',
'version': 'someVersion',
'findAppParams': {
@@ -121,7 +115,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
'firefox-nightly',
'firefox-trunk',
],
- 'minSupportedVersion': 86,
'path': '/Applications/Firefox Nightly.app/Contents/MacOS/firefox',
'version': 'someVersion',
'findAppParams': {
@@ -141,7 +134,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
'edge',
'microsoft-edge',
],
- 'minSupportedVersion': 79,
'path': '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge',
'version': 'someVersion',
'findAppParams': {
@@ -161,7 +153,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
'edge-canary',
'microsoft-edge-canary',
],
- 'minSupportedVersion': 79,
'path': '/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary',
'version': 'someVersion',
'findAppParams': {
@@ -181,7 +172,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
'edge-beta',
'microsoft-edge-beta',
],
- 'minSupportedVersion': 79,
'path': '/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta',
'version': 'someVersion',
'findAppParams': {
@@ -201,7 +191,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
'edge-dev',
'microsoft-edge-dev',
],
- 'minSupportedVersion': 79,
'path': '/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev',
'version': 'someVersion',
'findAppParams': {
diff --git a/packages/launcher/__snapshots__/windows_spec.ts.js b/packages/launcher/__snapshots__/windows_spec.ts.js
index 0ba7dfb13388..02a57883f13f 100644
--- a/packages/launcher/__snapshots__/windows_spec.ts.js
+++ b/packages/launcher/__snapshots__/windows_spec.ts.js
@@ -10,7 +10,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
'chrome',
'google-chrome-stable',
],
- 'minSupportedVersion': 64,
'path': 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe',
'version': '1.2.3',
'findAppParams': {
@@ -30,7 +29,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
'chromium-browser',
'chromium',
],
- 'minSupportedVersion': 64,
'path': 'C:/Program Files (x86)/Google/chrome-win32/chrome.exe',
'version': '2.3.4',
'findAppParams': {
@@ -47,7 +45,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
'displayName': 'Chrome Beta',
'versionRegex': {},
'binary': 'google-chrome-beta',
- 'minSupportedVersion': 64,
'path': 'C:/Program Files (x86)/Google/Chrome Beta/Application/chrome.exe',
'version': '6.7.8',
'findAppParams': {
@@ -64,7 +61,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
'displayName': 'Canary',
'versionRegex': {},
'binary': 'google-chrome-canary',
- 'minSupportedVersion': 64,
'path': 'C:/Users/flotwig/AppData/Local/Google/Chrome SxS/Application/chrome.exe',
'version': '3.4.5',
'findAppParams': {
@@ -81,7 +77,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
'displayName': 'Firefox',
'versionRegex': {},
'binary': 'firefox',
- 'minSupportedVersion': 86,
'path': 'C:/Program Files/Mozilla Firefox/firefox.exe',
'version': '72',
'findAppParams': {
@@ -101,7 +96,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
'firefox-developer-edition',
'firefox',
],
- 'minSupportedVersion': 86,
'path': 'C:/Program Files (x86)/Firefox Developer Edition/firefox.exe',
'version': '73',
'findAppParams': {
@@ -121,7 +115,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
'firefox-nightly',
'firefox-trunk',
],
- 'minSupportedVersion': 86,
'path': 'C:/Program Files/Firefox Nightly/firefox.exe',
'version': '74',
'findAppParams': {
@@ -141,7 +134,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
'edge',
'microsoft-edge',
],
- 'minSupportedVersion': 79,
'path': 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',
'version': '11',
'findAppParams': {
@@ -161,7 +153,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
'edge-canary',
'microsoft-edge-canary',
],
- 'minSupportedVersion': 79,
'path': 'C:/Users/flotwig/AppData/Local/Microsoft/Edge SxS/Application/msedge.exe',
'version': '14',
'findAppParams': {
@@ -181,7 +172,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
'edge-beta',
'microsoft-edge-beta',
],
- 'minSupportedVersion': 79,
'path': 'C:/Program Files (x86)/Microsoft/Edge Beta/Application/msedge.exe',
'version': '12',
'findAppParams': {
@@ -201,7 +191,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
'edge-dev',
'microsoft-edge-dev',
],
- 'minSupportedVersion': 79,
'path': 'C:/Program Files (x86)/Microsoft/Edge Dev/Application/msedge.exe',
'version': '13',
'findAppParams': {
@@ -233,7 +222,6 @@ exports['windows browser detection detects local Firefox installs 1'] = [
'displayName': 'Firefox',
'versionRegex': {},
'binary': 'firefox',
- 'minSupportedVersion': 86,
'path': 'C:/Users/flotwig/AppData/Local/Mozilla Firefox/firefox.exe',
'version': '100',
'findAppParams': {
@@ -253,7 +241,6 @@ exports['windows browser detection detects local Firefox installs 1'] = [
'firefox-developer-edition',
'firefox',
],
- 'minSupportedVersion': 86,
'path': 'C:/Users/flotwig/AppData/Local/Firefox Developer Edition/firefox.exe',
'version': '300',
'findAppParams': {
@@ -273,7 +260,6 @@ exports['windows browser detection detects local Firefox installs 1'] = [
'firefox-nightly',
'firefox-trunk',
],
- 'minSupportedVersion': 86,
'path': 'C:/Users/flotwig/AppData/Local/Firefox Nightly/firefox.exe',
'version': '200',
'findAppParams': {
diff --git a/packages/launcher/lib/detect.ts b/packages/launcher/lib/detect.ts
index acb30c4e5422..cba982d644f8 100644
--- a/packages/launcher/lib/detect.ts
+++ b/packages/launcher/lib/detect.ts
@@ -2,7 +2,7 @@ import Bluebird from 'bluebird'
import _, { compact, extend, find } from 'lodash'
import os from 'os'
import { removeDuplicateBrowsers } from '@packages/data-context/src/sources/BrowserDataSource'
-import { knownBrowsers, validateMinVersion } from './known-browsers'
+import { knownBrowsers } from './known-browsers'
import * as darwinHelper from './darwin'
import { notDetectedAtPathErr } from './errors'
import * as linuxHelper from './linux'
@@ -35,9 +35,11 @@ export const getMajorVersion = (version: string): string => {
// unsupported, the browser will be unavailable for selection and
// will present the determined warning message to the user.
const validateCypressSupport = (validator: BrowserValidator | undefined, browser: FoundBrowser, platform: NodeJS.Platform) => {
- // If no validator parameter is provided, we fall back to validating against
- // the browser's minimum supported version
- const { isSupported, warningMessage } = (validator || validateMinVersion)(browser, platform)
+ if (!validator) {
+ return
+ }
+
+ const { isSupported, warningMessage } = validator(browser, platform)
if (isSupported) {
return
@@ -116,7 +118,6 @@ function checkOneBrowser (browser: Browser): Promise
{
'custom',
'warning',
'info',
- 'minSupportedVersion',
'unsupportedVersion',
] as const
diff --git a/packages/launcher/lib/known-browsers.ts b/packages/launcher/lib/known-browsers.ts
index 53be37e599a1..5b6f9bdd1282 100644
--- a/packages/launcher/lib/known-browsers.ts
+++ b/packages/launcher/lib/known-browsers.ts
@@ -1,32 +1,5 @@
import type { Browser, BrowserValidatorResult, FoundBrowser } from '@packages/types'
-// Chrome started exposing CDP 1.3 in 64
-export const MIN_CHROME_VERSION = 64
-
-// Firefox started exposing CDP in 86
-export const MIN_FIREFOX_VERSION = 86
-
-// Edge switched to Blink in 79
-export const MIN_EDGE_VERSION = 79
-
-// Compares a detected browser's major version to its minimum supported version
-// to determine if the browser is supported by Cypress.
-export const validateMinVersion = (browser: FoundBrowser): BrowserValidatorResult => {
- const minSupportedVersion = browser.minSupportedVersion
- const majorVersion = browser.majorVersion
-
- if (majorVersion && minSupportedVersion && parseInt(majorVersion) < minSupportedVersion) {
- return {
- isSupported: false,
- warningMessage: `Cypress does not support running ${browser.displayName} version ${majorVersion}. To use ${browser.displayName} with Cypress, install a version of ${browser.displayName} newer than or equal to ${minSupportedVersion}.`,
- }
- }
-
- return {
- isSupported: true,
- }
-}
-
/** list of the browsers we can detect and use by default */
export const knownBrowsers: Browser[] = [
{
@@ -36,7 +9,20 @@ export const knownBrowsers: Browser[] = [
displayName: 'Chrome',
versionRegex: /Google Chrome (\S+)/m,
binary: ['google-chrome', 'chrome', 'google-chrome-stable'],
- minSupportedVersion: MIN_CHROME_VERSION,
+ validator: (browser: FoundBrowser, platform: NodeJS.Platform): BrowserValidatorResult => {
+ // a validator method can be defined to mark a browser as unsupported
+ // the example below shows a previous method we defined, but is not currently used
+ // if (platform === 'win32' && browser.majorVersion && ['101', '102'].includes(browser.majorVersion)) {
+ // return {
+ // isSupported: false,
+ // warningMessage: `Cypress does not support running ${browser.displayName} version ${browser.majorVersion} on Windows due to a blocking bug in ${browser.displayName}. To use ${browser.displayName} with Cypress on Windows, install version 103 or newer.`,
+ // }
+ // }
+
+ return {
+ isSupported: true,
+ }
+ },
},
{
name: 'chromium',
@@ -46,7 +32,6 @@ export const knownBrowsers: Browser[] = [
displayName: 'Chromium',
versionRegex: /Chromium (\S+)/m,
binary: ['chromium-browser', 'chromium'],
- minSupportedVersion: MIN_CHROME_VERSION,
},
{
name: 'chrome',
@@ -55,7 +40,6 @@ export const knownBrowsers: Browser[] = [
displayName: 'Chrome Beta',
versionRegex: /Google Chrome (\S+) beta/m,
binary: 'google-chrome-beta',
- minSupportedVersion: MIN_CHROME_VERSION,
},
{
name: 'chrome',
@@ -64,7 +48,6 @@ export const knownBrowsers: Browser[] = [
displayName: 'Canary',
versionRegex: /Google Chrome Canary (\S+)/m,
binary: 'google-chrome-canary',
- minSupportedVersion: MIN_CHROME_VERSION,
},
{
name: 'firefox',
@@ -74,21 +57,6 @@ export const knownBrowsers: Browser[] = [
// Mozilla Firefox 70.0.1
versionRegex: /^Mozilla Firefox ([^\sab]+)$/m,
binary: 'firefox',
- minSupportedVersion: MIN_FIREFOX_VERSION,
- validator: (browser: FoundBrowser, platform: NodeJS.Platform): BrowserValidatorResult => {
- // Firefox 101 and 102 on Windows features a bug that results in Cypress being unable
- // to connect to the launched browser. A fix was first released in stable 103.
- // See https://github.com/cypress-io/cypress/issues/22086 for related info.
-
- if (platform === 'win32' && browser.majorVersion && ['101', '102'].includes(browser.majorVersion)) {
- return {
- isSupported: false,
- warningMessage: `Cypress does not support running ${browser.displayName} version ${browser.majorVersion} on Windows due to a blocking bug in ${browser.displayName}. To use ${browser.displayName} with Cypress on Windows, install version 103 or newer.`,
- }
- }
-
- return validateMinVersion(browser)
- },
},
{
name: 'firefox',
@@ -99,7 +67,6 @@ export const knownBrowsers: Browser[] = [
versionRegex: /^Mozilla Firefox (\S+b\S*)$/m,
// ubuntu PPAs install it as firefox
binary: ['firefox-developer-edition', 'firefox'],
- minSupportedVersion: MIN_FIREFOX_VERSION,
},
{
name: 'firefox',
@@ -110,7 +77,6 @@ export const knownBrowsers: Browser[] = [
versionRegex: /^Mozilla Firefox (\S+a\S*)$/m,
// ubuntu PPAs install it as firefox-trunk
binary: ['firefox-nightly', 'firefox-trunk'],
- minSupportedVersion: MIN_FIREFOX_VERSION,
},
{
name: 'edge',
@@ -119,7 +85,6 @@ export const knownBrowsers: Browser[] = [
displayName: 'Edge',
versionRegex: /Microsoft Edge (\S+)/mi,
binary: ['edge', 'microsoft-edge'],
- minSupportedVersion: MIN_EDGE_VERSION,
},
{
name: 'edge',
@@ -128,7 +93,6 @@ export const knownBrowsers: Browser[] = [
displayName: 'Edge Canary',
versionRegex: /Microsoft Edge.+?(\S*(?= canary)|(?<=canary )\S*)/mi,
binary: ['edge-canary', 'microsoft-edge-canary'],
- minSupportedVersion: MIN_EDGE_VERSION,
},
{
name: 'edge',
@@ -137,7 +101,6 @@ export const knownBrowsers: Browser[] = [
displayName: 'Edge Beta',
versionRegex: /Microsoft Edge.+?(\S*(?= beta)|(?<=beta )\S*)/mi,
binary: ['edge-beta', 'microsoft-edge-beta'],
- minSupportedVersion: MIN_EDGE_VERSION,
},
{
name: 'edge',
@@ -146,6 +109,5 @@ export const knownBrowsers: Browser[] = [
displayName: 'Edge Dev',
versionRegex: /Microsoft Edge.+?(\S*(?= dev)|(?<=dev )\S*)/mi,
binary: ['edge-dev', 'microsoft-edge-dev'],
- minSupportedVersion: MIN_EDGE_VERSION,
},
]
diff --git a/packages/launcher/test/unit/browsers_spec.ts b/packages/launcher/test/unit/browsers_spec.ts
index 99eae596d868..79ec5514b3c3 100644
--- a/packages/launcher/test/unit/browsers_spec.ts
+++ b/packages/launcher/test/unit/browsers_spec.ts
@@ -1,7 +1,6 @@
import _ from 'lodash'
-import { knownBrowsers, validateMinVersion } from '../../lib/known-browsers'
+import { knownBrowsers } from '../../lib/known-browsers'
import { expect } from 'chai'
-import { FoundBrowser } from '@packages/types'
const snapshot = require('snap-shot-it')
describe('browsers', () => {
@@ -16,178 +15,62 @@ describe('browsers', () => {
}))).to.be.true
})
- describe('firefox-stable validator', () => {
+ describe('browser.validator', () => {
const firefoxBrowser = {
...knownBrowsers.find(({ name, channel }) => name === 'firefox' && channel === 'stable'),
path: '/path/to/firefox',
}
- context('Windows', () => {
- it('validates against version 101', () => {
+ context('validator defined', () => {
+ it('when conditions met: marks browser as not supported and generates warning message', () => {
const foundBrowser = {
...firefoxBrowser,
version: '101.1.0',
majorVersion: '101',
- } as FoundBrowser
-
- const result = firefoxBrowser.validator(foundBrowser, 'win32')
+ validator: (browser, platform) => {
+ if (platform === 'win32' && browser.majorVersion && ['101', '102'].includes(browser.majorVersion)) {
+ return {
+ isSupported: false,
+ warningMessage: `Cypress does not support running ${browser.displayName} version ${browser.majorVersion} on Windows due to a blocking bug in ${browser.displayName}. To use ${browser.displayName} with Cypress on Windows, install version 103 or newer.`,
+ }
+ }
+
+ return {
+ isSupported: true,
+ }
+ },
+ }
+
+ const result = foundBrowser.validator(foundBrowser, 'win32')
expect(result.isSupported).to.be.false
expect(result.warningMessage).to.contain('Cypress does not support running Firefox version 101 on Windows due to a blocking bug in Firefox.')
})
- it('validates against version 102', () => {
- const foundBrowser = {
- ...firefoxBrowser,
- version: '102.1.0',
- majorVersion: '102',
- path: '/path/to/firefox',
- } as FoundBrowser
-
- const result = firefoxBrowser.validator(foundBrowser, 'win32')
-
- expect(result.isSupported).to.be.false
- expect(result.warningMessage).to.contain('Cypress does not support running Firefox version 102 on Windows due to a blocking bug in Firefox.')
- })
-
- it('validates against minimum supported version', () => {
- const foundBrowser = {
- ...firefoxBrowser,
- version: '85.1.0',
- majorVersion: '85',
- } as FoundBrowser
-
- const result = firefoxBrowser.validator(foundBrowser, 'win32')
-
- expect(result.isSupported).to.be.false
- expect(result.warningMessage).to.contain('Cypress does not support running Firefox version 85.')
- })
-
- it('successfully validates a version equal to the minimum', () => {
- const foundBrowser = {
- ...firefoxBrowser,
- version: '86.1.0',
- majorVersion: '86',
- } as FoundBrowser
-
- const result = firefoxBrowser.validator(foundBrowser, 'win32')
-
- expect(result.isSupported).to.be.true
- expect(result.warningMessage).to.be.undefined
- })
-
- it('successfully validates a version greater than the minimum', () => {
- const foundBrowser = {
- ...firefoxBrowser,
- version: '103.1.0',
- majorVersion: '103',
- } as FoundBrowser
-
- const result = firefoxBrowser.validator(foundBrowser, 'win32')
-
- expect(result.isSupported).to.be.true
- expect(result.warningMessage).to.be.undefined
- })
- })
-
- context('Not Windows', () => {
- it('validates 101 as supported', () => {
+ it('when conditions not met: marks browser as not supported and generates warning message', () => {
const foundBrowser = {
...firefoxBrowser,
version: '101.1.0',
- majorVersion: '101',
- } as FoundBrowser
-
- const result = firefoxBrowser.validator(foundBrowser, 'darwin')
-
- expect(result.isSupported).to.be.true
- expect(result.warningMessage).to.be.undefined
- })
-
- it('validates 102 as supported', () => {
- const foundBrowser = {
- ...firefoxBrowser,
- version: '102.2.0',
- majorVersion: '102',
- } as FoundBrowser
-
- const result = firefoxBrowser.validator(foundBrowser, 'darwin')
+ majorVersion: '140',
+ validator: (browser, platform) => {
+ if (platform === 'win32' && browser.majorVersion && ['101', '102'].includes(browser.majorVersion)) {
+ return {
+ isSupported: false,
+ warningMessage: `Cypress does not support running ${browser.displayName} version ${browser.majorVersion} on Windows due to a blocking bug in ${browser.displayName}. To use ${browser.displayName} with Cypress on Windows, install version 103 or newer.`,
+ }
+ }
+
+ return {
+ isSupported: true,
+ }
+ },
+ }
+
+ const result = foundBrowser.validator(foundBrowser, 'win32')
expect(result.isSupported).to.be.true
expect(result.warningMessage).to.be.undefined
})
})
})
-
- describe('#validateMinVersion', () => {
- const testBrowser = {
- displayName: 'Test Browser',
- minSupportedVersion: 50,
- path: '/path/to/browser',
- }
-
- it('validates against minimum supported version', () => {
- const foundBrowser = {
- ...testBrowser,
- version: '40.1.0',
- majorVersion: '40',
- } as FoundBrowser
-
- const result = validateMinVersion(foundBrowser)
-
- expect(result.isSupported).to.be.false
- expect(result.warningMessage).to.contain('Cypress does not support running Test Browser version 40.')
- })
-
- it('successfully validates a version equal to the minimum', () => {
- const foundBrowser = {
- ...testBrowser,
- version: '50.1.0',
- majorVersion: '50',
- } as FoundBrowser
-
- const result = validateMinVersion(foundBrowser)
-
- expect(result.isSupported).to.be.true
- expect(result.warningMessage).to.be.undefined
- })
-
- it('successfully validates a version greater than the minimum', () => {
- const foundBrowser = {
- ...testBrowser,
- version: '90.1.0',
- majorVersion: '90',
- } as FoundBrowser
-
- const result = validateMinVersion(foundBrowser)
-
- expect(result.isSupported).to.be.true
- expect(result.warningMessage).to.be.undefined
- })
-
- it('does not validate with missing minSupportedVersion', () => {
- const foundBrowser = {
- ...testBrowser,
- version: '90.1.0',
- } as FoundBrowser
-
- const result = validateMinVersion(foundBrowser)
-
- expect(result.isSupported).to.be.true
- expect(result.warningMessage).to.be.undefined
- })
-
- it('does not validate with missing majorVersion', () => {
- const foundBrowser = {
- ...testBrowser,
- minSupportedVersion: 90,
- version: '90.1.0',
- } as FoundBrowser
-
- const result = validateMinVersion(foundBrowser)
-
- expect(result.isSupported).to.be.true
- expect(result.warningMessage).to.be.undefined
- })
- })
})
diff --git a/packages/launcher/test/unit/detect_spec.ts b/packages/launcher/test/unit/detect_spec.ts
index 160bcd7a2e55..3dec639cb4e3 100644
--- a/packages/launcher/test/unit/detect_spec.ts
+++ b/packages/launcher/test/unit/detect_spec.ts
@@ -11,7 +11,6 @@ import * as linuxHelper from '../../lib/linux'
import * as darwinHelper from '../../lib/darwin'
import * as windowsHelper from '../../lib/windows'
import type { Browser } from '@packages/types'
-import * as knownBrowsers from '../../lib/known-browsers'
const isWindows = () => {
return os.platform() === 'win32'
@@ -63,7 +62,6 @@ describe('detect', () => {
family: 'chromium',
channel: 'test-channel',
displayName: 'Test Browser',
- minSupportedVersion: 1,
versionRegex: /Test Browser (\S+)/m,
binary: 'test-browser-beta',
}
@@ -73,7 +71,7 @@ describe('detect', () => {
return Promise.resolve({
name: browser.name,
path: '/path/to/test-browser',
- version: `${browser.minSupportedVersion}`,
+ version: '130',
})
})
@@ -87,39 +85,11 @@ describe('detect', () => {
expect(foundTestBrowser.name).to.eq('test-browser')
expect(foundTestBrowser.displayName).to.eq('Test Browser')
- expect(foundTestBrowser.majorVersion, 'majorVersion').to.eq('1')
+ expect(foundTestBrowser.majorVersion, 'majorVersion').to.eq('130')
expect(foundTestBrowser.unsupportedVersion, 'unsupportedVersion').to.be.undefined
expect(foundTestBrowser.warning, 'warning').to.be.undefined
expect(mockValidator).to.have.been.called
})
-
- it('validates browser with default minVersionValidator', async () => {
- stubHelpers((browser) => {
- return Promise.resolve({
- name: browser.name,
- path: '/path/to/test-browser',
- version: `${browser.minSupportedVersion}`,
- })
- })
-
- const mockValidator = sinon.stub(knownBrowsers, 'validateMinVersion').returns({
- isSupported: false,
- warningMessage: 'This is a bad version',
- })
-
- const foundBrowsers = await detect([{ ...testBrowser as Browser }])
-
- expect(foundBrowsers).to.have.length(1)
-
- const foundTestBrowser = foundBrowsers[0]
-
- expect(foundTestBrowser.name).to.eq('test-browser')
- expect(foundTestBrowser.displayName).to.eq('Test Browser')
- expect(foundTestBrowser.majorVersion, 'majorVersion').to.eq('1')
- expect(foundTestBrowser.unsupportedVersion, 'unsupportedVersion').to.be.true
- expect(foundTestBrowser.warning, 'warning').to.eq('This is a bad version')
- expect(mockValidator).to.have.been.called
- })
})
describe('#detectByPath', () => {
@@ -200,16 +170,5 @@ describe('detect', () => {
)
})
})
-
- it('creates warning when version is unsupported', async () => {
- execa.withArgs('/good-firefox', ['--version'])
- .resolves({ stdout: 'Mozilla Firefox 85.0' })
-
- const foundBrowser = await detectByPath('/good-firefox')
-
- expect(foundBrowser.unsupportedVersion).to.be.true
- expect(foundBrowser.warning).to.contain('does not support running Custom Firefox version 85')
- .and.contain('Firefox newer than or equal to 86')
- })
})
})
diff --git a/packages/launcher/test/unit/linux_spec.ts b/packages/launcher/test/unit/linux_spec.ts
index abb9be2c96bf..1f030b2e2b8a 100644
--- a/packages/launcher/test/unit/linux_spec.ts
+++ b/packages/launcher/test/unit/linux_spec.ts
@@ -69,7 +69,6 @@ describe('linux browser detection', () => {
family: 'chromium',
displayName: 'Chromium',
majorVersion: '64',
- minSupportedVersion: 64,
path: 'chromium',
profilePath: '/home/foo/snap/chromium/current',
version: '64.2.3',
@@ -87,7 +86,6 @@ describe('linux browser detection', () => {
family: 'firefox',
displayName: 'Firefox',
majorVersion: '99',
- minSupportedVersion: 86,
path: 'firefox',
profilePath: '/home/foo/snap/firefox/current',
version: '99.2.3',
diff --git a/packages/launchpad/src/setup/OpenBrowserList.cy.tsx b/packages/launchpad/src/setup/OpenBrowserList.cy.tsx
index 864b62b5be1a..19711ff8a81b 100644
--- a/packages/launchpad/src/setup/OpenBrowserList.cy.tsx
+++ b/packages/launchpad/src/setup/OpenBrowserList.cy.tsx
@@ -24,11 +24,6 @@ describe('', () => {
cy.contains('label', browser.displayName).should('be.visible')
})
- // Firefox early version should be disabled
- cy.get('[data-cy-browser="firefox"]').should('have.attr', 'aria-disabled', 'true')
- cy.get('[data-cy-browser="firefox"] [data-cy="unsupported-browser-tooltip-trigger"]').should('exist')
- cy.get('[data-cy-browser="electron"] [data-cy="unsupported-browser-tooltip-trigger"]').should('not.exist')
-
// Renders a default logo if we don't provide one
cy.get('[data-cy-browser="fake"]').should('have.attr', 'aria-disabled', 'true')
cy.get('[data-cy-browser="fake"] img').should('have.attr', 'src').should('include', 'generic-browser')
@@ -36,27 +31,6 @@ describe('', () => {
cy.percySnapshot()
})
- it('displays a tooltip for an unsupported browser', () => {
- cy.mountFragment(OpenBrowserListFragmentDoc, {
- render: (gqlVal) =>
- (),
- })
-
- cy.get('[data-cy-browser="firefox"]:nth(2) [data-cy="unsupported-browser-tooltip-trigger"]')
- .trigger('mouseenter')
-
- cy.get('.v-popper__popper--shown')
- .contains('Cypress does not support running Firefox Developer Edition version 69.')
-
- /*
- TODO: fix flaky test https://github.com/cypress-io/cypress/issues/23436
- cy.percySnapshot()
- */
- })
-
it('emits navigates back', () => {
cy.mountFragment(OpenBrowserListFragmentDoc, {
render: (gqlVal) => (
diff --git a/packages/launchpad/src/setup/OpenBrowserList.vue b/packages/launchpad/src/setup/OpenBrowserList.vue
index 50b5fde2f8af..c254791ce8e1 100644
--- a/packages/launchpad/src/setup/OpenBrowserList.vue
+++ b/packages/launchpad/src/setup/OpenBrowserList.vue
@@ -14,7 +14,7 @@
:key="browser.id"
:data-cy-browser="browser.name"
:value="browser.id"
- :disabled="browser.disabled || !browser.isVersionSupported || browserStatus.chosen"
+ :disabled="browser.disabled || !browser.isVersionSupported ||browserStatus.chosen"
>
@@ -57,7 +57,7 @@
{{ browser.displayName }}
@@ -144,7 +144,9 @@
class="font-medium mx-auto text-gray-600 hocus-link-default group hocus:text-indigo-500"
@click="emit('navigatedBack')"
>
-
+
{{ browserText.switchTestingType }}
@@ -188,9 +190,9 @@ fragment OpenBrowserList on CurrentProject {
browsers {
id
disabled
- isVersionSupported
name
displayName
+ isVersionSupported
warning
majorVersion
}
diff --git a/packages/types/src/browser.ts b/packages/types/src/browser.ts
index 56b09de14a0e..7f73d5b1c017 100644
--- a/packages/types/src/browser.ts
+++ b/packages/types/src/browser.ts
@@ -43,8 +43,6 @@ export type Browser = {
binary: string | string[]
/** optional warning that will be shown in the GUI */
warning?: string
- /** if set, the majorVersion must be >= this to be run in Cypress */
- minSupportedVersion?: number
/** if set, is called to determine if found browser is supported by Cypress */
validator?: BrowserValidator
}