Skip to content

Commit

Permalink
spec updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mschile committed Dec 12, 2024
1 parent bdbb96f commit ba44fa8
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 73 deletions.
2 changes: 1 addition & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _Released 12/17/2024 (PENDING)_

**Features:**

- Added support for Google Chrome for Testing browser. Addresses [#28123](https://github.com/cypress-io/cypress/issues/28123) and [#28554](https://github.com/cypress-io/cypress/issues/28554).
- Added official support for Google Chrome for Testing browser. Addresses [#28123](https://github.com/cypress-io/cypress/issues/28123) and [#28554](https://github.com/cypress-io/cypress/issues/28554).

**Bugfixes:**

Expand Down
16 changes: 8 additions & 8 deletions packages/launcher/__snapshots__/browsers_spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,24 @@ exports['browsers returns the expected list of browsers 1'] = [
{
'name': 'edge',
'family': 'chromium',
'channel': 'canary',
'displayName': 'Edge Canary',
'channel': 'beta',
'displayName': 'Edge Beta',
'versionRegex': {},
'binary': [
'edge-canary',
'microsoft-edge-canary',
'edge-beta',
'microsoft-edge-beta',
],
'minSupportedVersion': 79,
},
{
'name': 'edge',
'family': 'chromium',
'channel': 'beta',
'displayName': 'Edge Beta',
'channel': 'canary',
'displayName': 'Edge Canary',
'versionRegex': {},
'binary': [
'edge-beta',
'microsoft-edge-beta',
'edge-canary',
'microsoft-edge-canary',
],
'minSupportedVersion': 79,
},
Expand Down
32 changes: 16 additions & 16 deletions packages/launcher/__snapshots__/darwin_spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,40 +171,40 @@ exports['darwin browser detection detects browsers as expected 1'] = [
{
'name': 'edge',
'family': 'chromium',
'channel': 'canary',
'displayName': 'Edge Canary',
'channel': 'beta',
'displayName': 'Edge Beta',
'versionRegex': {},
'binary': [
'edge-canary',
'microsoft-edge-canary',
'edge-beta',
'microsoft-edge-beta',
],
'minSupportedVersion': 79,
'path': '/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary',
'path': '/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta',
'version': 'someVersion',
'findAppParams': {
'appName': 'Microsoft Edge Canary.app',
'executable': 'Contents/MacOS/Microsoft Edge Canary',
'bundleId': 'com.microsoft.Edge.Canary',
'appName': 'Microsoft Edge Beta.app',
'executable': 'Contents/MacOS/Microsoft Edge Beta',
'bundleId': 'com.microsoft.Edge.Beta',
'versionProperty': 'CFBundleShortVersionString',
},
},
{
'name': 'edge',
'family': 'chromium',
'channel': 'beta',
'displayName': 'Edge Beta',
'channel': 'canary',
'displayName': 'Edge Canary',
'versionRegex': {},
'binary': [
'edge-beta',
'microsoft-edge-beta',
'edge-canary',
'microsoft-edge-canary',
],
'minSupportedVersion': 79,
'path': '/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta',
'path': '/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary',
'version': 'someVersion',
'findAppParams': {
'appName': 'Microsoft Edge Beta.app',
'executable': 'Contents/MacOS/Microsoft Edge Beta',
'bundleId': 'com.microsoft.Edge.Beta',
'appName': 'Microsoft Edge Canary.app',
'executable': 'Contents/MacOS/Microsoft Edge Canary',
'bundleId': 'com.microsoft.Edge.Canary',
'versionProperty': 'CFBundleShortVersionString',
},
},
Expand Down
112 changes: 82 additions & 30 deletions packages/launcher/__snapshots__/windows_spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports['windows browser detection detects browsers as expected 1'] = [
'versionRegex': {},
'binary': 'chrome',
'minSupportedVersion': 64,
'path': 'C:/Program Files (x86)/Google/Chrome for Testing/chrome.exe',
'path': 'C:/Program Files/Google/Chrome for Testing/chrome.exe',
'version': '1.2.3',
'findAppParams': {
'appName': 'Google Chrome for Testing.app',
Expand Down Expand Up @@ -171,40 +171,40 @@ exports['windows browser detection detects browsers as expected 1'] = [
{
'name': 'edge',
'family': 'chromium',
'channel': 'canary',
'displayName': 'Edge Canary',
'channel': 'beta',
'displayName': 'Edge Beta',
'versionRegex': {},
'binary': [
'edge-canary',
'microsoft-edge-canary',
'edge-beta',
'microsoft-edge-beta',
],
'minSupportedVersion': 79,
'path': 'C:/Users/flotwig/AppData/Local/Microsoft/Edge SxS/Application/msedge.exe',
'version': '14',
'path': 'C:/Program Files (x86)/Microsoft/Edge Beta/Application/msedge.exe',
'version': '12',
'findAppParams': {
'appName': 'Microsoft Edge Canary.app',
'executable': 'Contents/MacOS/Microsoft Edge Canary',
'bundleId': 'com.microsoft.Edge.Canary',
'appName': 'Microsoft Edge Beta.app',
'executable': 'Contents/MacOS/Microsoft Edge Beta',
'bundleId': 'com.microsoft.Edge.Beta',
'versionProperty': 'CFBundleShortVersionString',
},
},
{
'name': 'edge',
'family': 'chromium',
'channel': 'beta',
'displayName': 'Edge Beta',
'channel': 'canary',
'displayName': 'Edge Canary',
'versionRegex': {},
'binary': [
'edge-beta',
'microsoft-edge-beta',
'edge-canary',
'microsoft-edge-canary',
],
'minSupportedVersion': 79,
'path': 'C:/Program Files (x86)/Microsoft/Edge Beta/Application/msedge.exe',
'version': '12',
'path': 'C:/Users/flotwig/AppData/Local/Microsoft/Edge SxS/Application/msedge.exe',
'version': '14',
'findAppParams': {
'appName': 'Microsoft Edge Beta.app',
'executable': 'Contents/MacOS/Microsoft Edge Beta',
'bundleId': 'com.microsoft.Edge.Beta',
'appName': 'Microsoft Edge Canary.app',
'executable': 'Contents/MacOS/Microsoft Edge Canary',
'bundleId': 'com.microsoft.Edge.Canary',
'versionProperty': 'CFBundleShortVersionString',
},
},
Expand All @@ -230,19 +230,71 @@ exports['windows browser detection detects browsers as expected 1'] = [
},
]

exports['windows browser detection detects 64-bit Chrome Beta app path 1'] = {
'name': 'chrome',
'version': '9.0.1',
'path': 'C:/Program Files/Google/Chrome Beta/Application/chrome.exe',
}
exports['windows browser detection detects Chrome Beta 64-bit install 1'] = [
{
'name': 'chrome',
'family': 'chromium',
'channel': 'beta',
'displayName': 'Chrome Beta',
'versionRegex': {},
'binary': 'google-chrome-beta',
'minSupportedVersion': 64,
'path': 'C:/Program Files/Google/Chrome Beta/Application/chrome.exe',
'version': '9.0.1',
'findAppParams': {
'appName': 'Google Chrome Beta.app',
'executable': 'Contents/MacOS/Google Chrome Beta',
'bundleId': 'com.google.Chrome.beta',
'versionProperty': 'KSVersion',
},
},
]

exports['windows browser detection detects new Chrome 64-bit app path 1'] = {
'name': 'chrome',
'version': '4.4.4',
'path': 'C:/Program Files/Google/Chrome/Application/chrome.exe',
}
exports['windows browser detection detects Chrome 64-bit install 1'] = [
{
'name': 'chrome',
'family': 'chromium',
'channel': 'stable',
'displayName': 'Chrome',
'versionRegex': {},
'binary': [
'google-chrome',
'chrome',
'google-chrome-stable',
],
'minSupportedVersion': 64,
'path': 'C:/Program Files/Google/Chrome/Application/chrome.exe',
'version': '4.4.4',
'findAppParams': {
'appName': 'Google Chrome.app',
'executable': 'Contents/MacOS/Google Chrome',
'bundleId': 'com.google.Chrome',
'versionProperty': 'KSVersion',
},
},
]

exports['windows browser detection detects Chrome for Testing 32-bit install 1'] = [
{
'name': 'chrome-for-testing',
'family': 'chromium',
'channel': 'stable',
'displayName': 'Chrome Test',
'versionRegex': {},
'binary': 'chrome',
'minSupportedVersion': 64,
'path': 'C:/Program Files (x86)/Google/Chrome for Testing/chrome.exe',
'version': '5.5.5',
'findAppParams': {
'appName': 'Google Chrome for Testing.app',
'executable': 'Contents/MacOS/Google Chrome for Testing',
'bundleId': 'com.google.chrome.for.testing',
'versionProperty': 'CFBundleShortVersionString',
},
},
]

exports['windows browser detection detects local Firefox installs 1'] = [
exports['windows browser detection detects Firefox local installs 1'] = [
{
'name': 'firefox',
'family': 'firefox',
Expand Down
16 changes: 8 additions & 8 deletions packages/launcher/lib/known-browsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,19 @@ export const knownBrowsers: Browser[] = [
{
name: 'edge',
family: 'chromium',
channel: 'canary',
displayName: 'Edge Canary',
versionRegex: /Microsoft Edge.+?(\S*(?= canary)|(?<=canary )\S*)/mi,
binary: ['edge-canary', 'microsoft-edge-canary'],
channel: 'beta',
displayName: 'Edge Beta',
versionRegex: /Microsoft Edge.+?(\S*(?= beta)|(?<=beta )\S*)/mi,
binary: ['edge-beta', 'microsoft-edge-beta'],
minSupportedVersion: MIN_EDGE_VERSION,
},
{
name: 'edge',
family: 'chromium',
channel: 'beta',
displayName: 'Edge Beta',
versionRegex: /Microsoft Edge.+?(\S*(?= beta)|(?<=beta )\S*)/mi,
binary: ['edge-beta', 'microsoft-edge-beta'],
channel: 'canary',
displayName: 'Edge Canary',
versionRegex: /Microsoft Edge.+?(\S*(?= canary)|(?<=canary )\S*)/mi,
binary: ['edge-canary', 'microsoft-edge-canary'],
minSupportedVersion: MIN_EDGE_VERSION,
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/launcher/lib/windows/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ function formChromeCanaryAppPath () {

function formChromeForTestingAppPath () {
return [
'C:/Program Files (x86)/Google/Chrome for Testing/chrome.exe',
'C:/Program Files/Google/Chrome for Testing/chrome.exe',
'C:/Program Files (x86)/Google/Chrome for Testing/chrome.exe',
].map(normalize)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/launcher/test/unit/darwin_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function generatePlist (key, value) {

function stubBrowser (findAppParams: darwinUtil.FindAppParams) {
(utils.getOutput as unknown as SinonStub)
.withArgs(`mdfind 'kMDItemCFBundleIdentifier=="${findAppParams.appId}"' | head -1`)
.withArgs(`mdfind 'kMDItemCFBundleIdentifier=="${findAppParams.bundleId}"' | head -1`)
.resolves({ stdout: `/Applications/${findAppParams.appName}` })

;(fse.readFile as SinonStub)
Expand Down
23 changes: 15 additions & 8 deletions packages/launcher/test/unit/windows_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('windows browser detection', () => {
stubBrowser('C:/Program Files (x86)/Google/Chrome/Application/chrome.exe', '1.2.3')
// chromium
stubBrowser('C:/Program Files (x86)/Google/chrome-win32/chrome.exe', '2.3.4')
// chrome-for-testing
// 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 @@ -77,23 +77,30 @@ describe('windows browser detection', () => {
snapshot(await detect(knownBrowsers))
})

it('detects 64-bit Chrome Beta app path', async () => {
it('detects Chrome Beta 64-bit install', async () => {
stubBrowser('C:/Program Files/Google/Chrome Beta/Application/chrome.exe', '9.0.1')
const chrome = _.find(knownBrowsers, { name: 'chrome', channel: 'beta' })
const chrome = _.find(knownBrowsers, { name: 'chrome', channel: 'beta' })!

snapshot(await windowsHelper.detect(chrome))
snapshot(await detect([chrome]))
})

// @see https://github.com/cypress-io/cypress/issues/8425
it('detects new Chrome 64-bit app path', async () => {
it('detects Chrome 64-bit install', async () => {
stubBrowser('C:/Program Files/Google/Chrome/Application/chrome.exe', '4.4.4')
const chrome = _.find(knownBrowsers, { name: 'chrome', channel: 'stable' })
const chrome = _.find(knownBrowsers, { name: 'chrome', channel: 'stable' })!

snapshot(await windowsHelper.detect(chrome))
snapshot(await detect([chrome]))
})

it('detects Chrome for Testing 32-bit install', async () => {
stubBrowser('C:/Program Files (x86)/Google/Chrome for Testing/chrome.exe', '5.5.5')
const chromeForTesting = _.find(knownBrowsers, { name: 'chrome-for-testing' })!

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

// @see https://github.com/cypress-io/cypress/issues/8432
it('detects local Firefox installs', async () => {
it('detects Firefox local installs', async () => {
stubBrowser(`${HOMEDIR}/AppData/Local/Mozilla Firefox/firefox.exe`, '100')
stubBrowser(`${HOMEDIR}/AppData/Local/Firefox Nightly/firefox.exe`, '200')
stubBrowser(`${HOMEDIR}/AppData/Local/Firefox Developer Edition/firefox.exe`, '300')
Expand Down

3 comments on commit ba44fa8

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on ba44fa8 Dec 12, 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-ba44fa8405840eb302d147169416a61958852d66/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on ba44fa8 Dec 12, 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-ba44fa8405840eb302d147169416a61958852d66/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on ba44fa8 Dec 12, 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-ba44fa8405840eb302d147169416a61958852d66/cypress.tgz

Please sign in to comment.