Skip to content

Commit

Permalink
adding additional window chromium paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mschile committed Dec 13, 2024
1 parent acf54b2 commit bafd757
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 4 deletions.
69 changes: 69 additions & 0 deletions packages/launcher/__snapshots__/windows_spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,72 @@ exports['windows browser detection detects Firefox local installs 1'] = [
},
},
]

exports['windows browser detection detects Chromium 64-bit install 1'] = [
{
'name': 'chromium',
'family': 'chromium',
'channel': 'stable',
'displayName': 'Chromium',
'versionRegex': {},
'binary': [
'chromium-browser',
'chromium',
],
'minSupportedVersion': 64,
'path': 'C:/Program Files/Google/chrome-win/chrome.exe',
'version': '6.6.6',
'findAppParams': {
'appName': 'Chromium.app',
'executable': 'Contents/MacOS/Chromium',
'bundleId': 'org.chromium.Chromium',
'versionProperty': 'CFBundleShortVersionString',
},
},
]

exports['windows browser detection detects Chromium 32-bit install in Chromium folder 1'] = [
{
'name': 'chromium',
'family': 'chromium',
'channel': 'stable',
'displayName': 'Chromium',
'versionRegex': {},
'binary': [
'chromium-browser',
'chromium',
],
'minSupportedVersion': 64,
'path': 'C:/Program Files (x86)/Google/Chromium/chrome.exe',
'version': '7.7.7',
'findAppParams': {
'appName': 'Chromium.app',
'executable': 'Contents/MacOS/Chromium',
'bundleId': 'org.chromium.Chromium',
'versionProperty': 'CFBundleShortVersionString',
},
},
]

exports['windows browser detection detects Chromium 64-bit install in Chromium folder 1'] = [
{
'name': 'chromium',
'family': 'chromium',
'channel': 'stable',
'displayName': 'Chromium',
'versionRegex': {},
'binary': [
'chromium-browser',
'chromium',
],
'minSupportedVersion': 64,
'path': 'C:/Program Files/Google/Chromium/chrome.exe',
'version': '8.8.8',
'findAppParams': {
'appName': 'Chromium.app',
'executable': 'Contents/MacOS/Chromium',
'bundleId': 'org.chromium.Chromium',
'versionProperty': 'CFBundleShortVersionString',
},
},
]
9 changes: 6 additions & 3 deletions packages/launcher/lib/windows/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ function formChromeBetaAppPath () {
}

function formChromiumAppPath () {
const exe = 'C:/Program Files (x86)/Google/chrome-win32/chrome.exe'

return [normalize(exe)]
return [
'C:/Program Files (x86)/Google/chrome-win32/chrome.exe',
'C:/Program Files/Google/chrome-win/chrome.exe',
'C:/Program Files/Google/Chromium/chrome.exe',
'C:/Program Files (x86)/Google/Chromium/chrome.exe',
].map(normalize)
}

function formChromeCanaryAppPath () {
Expand Down
25 changes: 24 additions & 1 deletion packages/launcher/test/unit/windows_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ describe('windows browser detection', () => {
it('detects browsers as expected', async () => {
// chrome
stubBrowser('C:/Program Files (x86)/Google/Chrome/Application/chrome.exe', '1.2.3')
// chromium
// chromium - 32-bit will be preferred for passivity
stubBrowser('C:/Program Files (x86)/Google/chrome-win32/chrome.exe', '2.3.4')
stubBrowser('C:/Program Files/Google/chrome-win/chrome.exe', '2.3.4')

// chrome-for-testing - 64-bit will be preferred
stubBrowser('C:/Program Files (x86)/Google/Chrome for Testing/chrome.exe', '1.2.3')
stubBrowser('C:/Program Files/Google/Chrome for Testing/chrome.exe', '1.2.3')
Expand Down Expand Up @@ -110,6 +112,27 @@ describe('windows browser detection', () => {
snapshot(await detect(firefoxes))
})

it('detects Chromium 64-bit install', async () => {
stubBrowser('C:/Program Files/Google/chrome-win/chrome.exe', '6.6.6')
const chromium = _.find(knownBrowsers, { name: 'chromium' })!

snapshot(await detect([chromium]))
})

it('detects Chromium 32-bit install in Chromium folder', async () => {
stubBrowser('C:/Program Files (x86)/Google/Chromium/chrome.exe', '7.7.7')
const chromium = _.find(knownBrowsers, { name: 'chromium' })!

snapshot(await detect([chromium]))
})

it('detects Chromium 64-bit install in Chromium folder', async () => {
stubBrowser('C:/Program Files/Google/Chromium/chrome.exe', '8.8.8')
const chromium = _.find(knownBrowsers, { name: 'chromium' })!

snapshot(await detect([chromium]))
})

it('works with :browserName format in Windows', () => {
sinon.stub(os, 'platform').returns('win32')
let path = `${HOMEDIR}/foo/bar/browser.exe`
Expand Down

5 comments on commit bafd757

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on bafd757 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.17.0/linux-x64/mschile/chrome_for_testing-bafd7578f463e4ed3ca3f939da412fa318b689e8/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on bafd757 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.17.0/linux-arm64/mschile/chrome_for_testing-bafd7578f463e4ed3ca3f939da412fa318b689e8/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on bafd757 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.17.0/darwin-arm64/mschile/chrome_for_testing-bafd7578f463e4ed3ca3f939da412fa318b689e8/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on bafd757 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.17.0/darwin-x64/mschile/chrome_for_testing-bafd7578f463e4ed3ca3f939da412fa318b689e8/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on bafd757 Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.17.0/win32-x64/mschile/chrome_for_testing-bafd7578f463e4ed3ca3f939da412fa318b689e8/cypress.tgz

Please sign in to comment.