Skip to content

Commit

Permalink
feat: add support for chrome for testing browser
Browse files Browse the repository at this point in the history
  • Loading branch information
mschile committed Dec 10, 2024
1 parent ed1c510 commit df53cbd
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 19 deletions.
11 changes: 5 additions & 6 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ mainBuildFilters: &mainBuildFilters
- /^release\/\d+\.\d+\.\d+$/
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- 'update-v8-snapshot-cache-on-develop'
- 'chore/update_reporter_mobx'
- 'publish-binary'
- 'mschile/chrome_for_testing'

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand All @@ -42,7 +41,7 @@ macWorkflowFilters: &darwin-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'chore/update_reporter_mobx', << pipeline.git.branch >> ]
- equal: [ 'mschile/chrome_for_testing', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -53,7 +52,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'chore/update_reporter_mobx', << pipeline.git.branch >> ]
- equal: [ 'mschile/chrome_for_testing', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -76,7 +75,7 @@ windowsWorkflowFilters: &windows-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'chore/update_reporter_mobx', << pipeline.git.branch >> ]
- equal: [ 'mschile/chrome_for_testing', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -152,7 +151,7 @@ commands:
name: Set environment variable to determine whether or not to persist artifacts
command: |
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "chore/update_reporter_mobx" ]]; then
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "mschile/chrome_for_testing" ]]; then
export SHOULD_PERSIST_ARTIFACTS=true
fi' >> "$BASH_ENV"
# You must run `setup_should_persist_artifacts` command and be using bash before running this command
Expand Down
6 changes: 5 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.16.2
## 13.17.0

_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).

**Bugfixes:**

- Fixed an issue where targets may hang if `Network.enable` is not implemented for the target. Addresses [#29876](https://github.com/cypress-io/cypress/issues/29876).
Expand Down
5 changes: 3 additions & 2 deletions packages/frontend-shared/src/assets/browserLogos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ import genericBrowserLogo from '@packages/frontend-shared/src/assets/logos/gener
export const allBrowsersIcons = {
'Electron': electronIcon,
'Chrome': chromeIcon,
'Chrome Beta': chromeBetaIcon,
'Chrome Canary': canaryIcon,
'Chrome Testing': chromeIcon,
'Firefox': firefoxIcon,
'Edge': edgeIcon,
'Chromium': chromiumIcon,
'Canary': canaryIcon,
'Chrome Beta': chromeBetaIcon,
'Firefox Nightly': firefoxNightlyIcon,
'Firefox Developer Edition': firefoxDeveloperEditionIcon,
'Edge Canary': edgeCanaryIcon,
Expand Down
20 changes: 20 additions & 0 deletions packages/launcher/lib/darwin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ export const browsers: Detectors = {
versionProperty: 'KSVersion',
},
},
'chrome-for-testing': {
stable: {
appName: 'Google Chrome for Testing.app',
executable: 'Contents/MacOS/Google Chrome for Testing',
appId: 'com.google.Chrome',
versionProperty: 'CFBundleShortVersionString',
},
beta: {
appName: 'Google Chrome for Testing.app',
executable: 'Contents/MacOS/Google Chrome for Testing',
appId: 'com.google.Chrome.beta',
versionProperty: 'CFBundleShortVersionString',
},
canary: {
appName: 'Google Chrome for Testing.app',
executable: 'Contents/MacOS/Google Chrome for Testing',
appId: 'com.google.Chrome.canary',
versionProperty: 'CFBundleShortVersionString',
},
},
chromium: {
stable: {
appName: 'Chromium.app',
Expand Down
47 changes: 37 additions & 10 deletions packages/launcher/lib/known-browsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,39 @@ export const validateMinVersion = (browser: FoundBrowser): BrowserValidatorResul
/** list of the browsers we can detect and use by default */
export const knownBrowsers: Browser[] = [
{
name: 'chrome',
name: 'chrome-for-testing',
family: 'chromium',
channel: 'stable',
displayName: 'Chrome',
versionRegex: /Google Chrome (\S+)/m,
binary: ['google-chrome', 'chrome', 'google-chrome-stable'],
displayName: 'Chrome Testing',
versionRegex: /Google Chrome for Testing (\S+)/m,
binary: ['chrome'],
minSupportedVersion: MIN_CHROME_VERSION,
},
{
name: 'chromium',
name: 'chrome-for-testing',
family: 'chromium',
channel: 'beta',
displayName: 'Chrome Testing Beta',
versionRegex: /Google Chrome for Testing (\S+)/m,
binary: ['chrome'],
minSupportedVersion: MIN_CHROME_VERSION,
},
{
name: 'chrome-for-testing',
family: 'chromium',
channel: 'canary',
displayName: 'Chrome Testing Canary',
versionRegex: /Google Chrome for Testing (\S+)/m,
binary: ['chrome'],
minSupportedVersion: MIN_CHROME_VERSION,
},
{
name: 'chrome',
family: 'chromium',
// technically Chromium is always in development
channel: 'stable',
displayName: 'Chromium',
versionRegex: /Chromium (\S+)/m,
binary: ['chromium-browser', 'chromium'],
displayName: 'Chrome',
versionRegex: /Google Chrome(?! for Testing) (\S+)/m,
binary: ['google-chrome', 'chrome', 'google-chrome-stable'],
minSupportedVersion: MIN_CHROME_VERSION,
},
{
Expand All @@ -61,11 +78,21 @@ export const knownBrowsers: Browser[] = [
name: 'chrome',
family: 'chromium',
channel: 'canary',
displayName: 'Canary',
displayName: 'Chrome Canary',
versionRegex: /Google Chrome Canary (\S+)/m,
binary: 'google-chrome-canary',
minSupportedVersion: MIN_CHROME_VERSION,
},
{
name: 'chromium',
family: 'chromium',
// technically Chromium is always in development
channel: 'stable',
displayName: 'Chromium',
versionRegex: /Chromium (\S+)/m,
binary: ['chromium-browser', 'chromium'],
minSupportedVersion: MIN_CHROME_VERSION,
},
{
name: 'firefox',
family: 'firefox',
Expand Down
12 changes: 12 additions & 0 deletions packages/launcher/lib/windows/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ function formChromeCanaryAppPath () {
return [normalize(exe)]
}

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

function getFirefoxPaths (editionFolder) {
return () => {
return (['Program Files', 'Program Files (x86)'])
Expand Down Expand Up @@ -91,6 +98,11 @@ const formPaths: WindowsBrowserPaths = {
beta: formChromeBetaAppPath,
canary: formChromeCanaryAppPath,
},
'chrome-for-testing': {
stable: formChromeForTestingAppPath,
beta: formChromeForTestingAppPath,
canary: formChromeForTestingAppPath,
},
chromium: {
stable: formChromiumAppPath,
},
Expand Down

8 comments on commit df53cbd

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on df53cbd Dec 10, 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-df53cbdc4a666a212eb5be709eb1f3cf275b0629/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on df53cbd Dec 10, 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-df53cbdc4a666a212eb5be709eb1f3cf275b0629/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on df53cbd Dec 10, 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-df53cbdc4a666a212eb5be709eb1f3cf275b0629/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on df53cbd Dec 10, 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-df53cbdc4a666a212eb5be709eb1f3cf275b0629/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on df53cbd Dec 11, 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-df53cbdc4a666a212eb5be709eb1f3cf275b0629/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on df53cbd Dec 11, 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-df53cbdc4a666a212eb5be709eb1f3cf275b0629/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on df53cbd Dec 11, 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-df53cbdc4a666a212eb5be709eb1f3cf275b0629/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on df53cbd Dec 11, 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-df53cbdc4a666a212eb5be709eb1f3cf275b0629/cypress.tgz

Please sign in to comment.