Skip to content

Commit 0c3c497

Browse files
authored
feat: add support for chrome for testing browser (#30751)
1 parent 68c5714 commit 0c3c497

32 files changed

+598
-312
lines changed

.circleci/workflows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ mainBuildFilters: &mainBuildFilters
3030
- /^release\/\d+\.\d+\.\d+$/
3131
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
3232
- 'update-v8-snapshot-cache-on-develop'
33-
- 'renovate/yarn-1.x'
33+
- 'mschile/chrome_for_testing'
3434
- 'publish-binary'
3535

3636
# usually we don't build Mac app - it takes a long time
@@ -42,7 +42,7 @@ macWorkflowFilters: &darwin-workflow-filters
4242
- equal: [ develop, << pipeline.git.branch >> ]
4343
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
4444
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
45-
- equal: [ 'renovate/yarn-1.x', << pipeline.git.branch >> ]
45+
- equal: [ 'mschile/chrome_for_testing', << pipeline.git.branch >> ]
4646
- matches:
4747
pattern: /^release\/\d+\.\d+\.\d+$/
4848
value: << pipeline.git.branch >>
@@ -53,7 +53,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
5353
- equal: [ develop, << pipeline.git.branch >> ]
5454
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
5555
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
56-
- equal: [ 'renovate/yarn-1.x', << pipeline.git.branch >> ]
56+
- equal: [ 'mschile/chrome_for_testing', << pipeline.git.branch >> ]
5757
- matches:
5858
pattern: /^release\/\d+\.\d+\.\d+$/
5959
value: << pipeline.git.branch >>
@@ -76,7 +76,7 @@ windowsWorkflowFilters: &windows-workflow-filters
7676
- equal: [ develop, << pipeline.git.branch >> ]
7777
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
7878
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
79-
- equal: [ 'renovate/yarn-1.x', << pipeline.git.branch >> ]
79+
- equal: [ 'mschile/chrome_for_testing', << pipeline.git.branch >> ]
8080
- matches:
8181
pattern: /^release\/\d+\.\d+\.\d+$/
8282
value: << pipeline.git.branch >>
@@ -152,7 +152,7 @@ commands:
152152
name: Set environment variable to determine whether or not to persist artifacts
153153
command: |
154154
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
155-
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "ryanm/experiment/esm" ]]; then
155+
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "mschile/chrome_for_testing" ]]; then
156156
export SHOULD_PERSIST_ARTIFACTS=true
157157
fi' >> "$BASH_ENV"
158158
# You must run `setup_should_persist_artifacts` command and be using bash before running this command

cli/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
2-
## 13.16.2
2+
## 13.17.0
33

44
_Released 12/17/2024 (PENDING)_
55

6+
**Features:**
7+
8+
- Added official support for the [Google Chrome for Testing](https://github.com/GoogleChromeLabs/chrome-for-testing) browser. Assuming the browser is in a location where it can be [auto-detected](https://on.cypress.io/troubleshooting-launching-browsers), it can be launched by providing the `--browser chrome-for-testing` option. If it can't be auto-detected, the path to the browser can also be provided. Previously [customizing the available browsers](https://on.cypress.io/customize-browsers) was required. Addresses [#28123](https://github.com/cypress-io/cypress/issues/28123) and [#28554](https://github.com/cypress-io/cypress/issues/28554).
9+
610
**Bugfixes:**
711

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

packages/app/cypress/e2e/top-nav.cy.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('App Top Nav Workflows', () => {
4444
.should('have.attr', 'src')
4545
.and('contain', 'firefox')
4646

47-
cy.findByTestId('top-nav-active-browser').should('contain', 'Firefox 5')
47+
cy.findByTestId('top-nav-active-browser').should('contain', 'Firefox 6')
4848
})
4949
})
5050

@@ -82,19 +82,19 @@ describe('App Top Nav Workflows', () => {
8282

8383
cy.get('@browserItems').eq(1)
8484
.should('contain', 'Edge')
85-
.and('contain', 'Version 8')
85+
.and('contain', 'Version 9')
8686
.findByTestId('top-nav-browser-list-selected-item')
8787
.should('not.exist')
8888

8989
cy.get('@browserItems').eq(2)
9090
.should('contain', 'Electron')
91-
.and('contain', 'Version 12')
91+
.and('contain', 'Version 13')
9292
.findByTestId('top-nav-browser-list-selected-item')
9393
.should('not.exist')
9494

9595
cy.get('@browserItems').eq(3)
9696
.should('contain', 'Firefox')
97-
.and('contain', 'Version 5')
97+
.and('contain', 'Version 6')
9898
.findByTestId('top-nav-browser-list-selected-item')
9999
.should('not.exist')
100100
})

packages/app/src/debug/LayeredBrowserIcons.cy.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import LayeredBrowserIcons from './LayeredBrowserIcons.vue'
22
import type { BrowserType } from './LayeredBrowserIcons.vue'
33

44
describe('<LayeredBrowserIcons/>', () => {
5-
const browsers: BrowserType[] = ['CHROME', 'CHROME-CANARY', 'CHROME BETA', 'FIREFOX', 'WEBKIT', 'EDGE', 'ELECTRON']
5+
const browsers: BrowserType[] = ['CHROME', 'CHROME BETA', 'CANARY', 'CHROME CANARY', 'CHROME FOR TESTING', 'CUSTOM CHROME FOR TESTING', 'CHROMIUM', 'CUSTOM CHROMIUM', 'EDGE', 'EDGE BETA', 'EDGE CANARY', 'EDGE DEV', 'ELECTRON', 'FIREFOX', 'FIREFOX DEVELOPER EDITION', 'FIREFOX NIGHTLY', 'WEBKIT']
66

77
it('mounts correctly for single browser', () => {
88
browsers.forEach((ele) => {
@@ -21,11 +21,11 @@ describe('<LayeredBrowserIcons/>', () => {
2121
<div class='bg-gray-50 p-[24px]'>
2222
<LayeredBrowserIcons browsers={browsers} />
2323
<LayeredBrowserIcons browsers={['CHROME', 'FIREFOX', 'EDGE']}/>
24-
<LayeredBrowserIcons browsers={['CHROME-CANARY', 'WEBKIT', 'ELECTRON']} />
24+
<LayeredBrowserIcons browsers={['CHROME CANARY', 'WEBKIT', 'ELECTRON']} />
2525
<LayeredBrowserIcons browsers={['FIREFOX', 'WEBKIT', 'EDGE']}/>
26-
<LayeredBrowserIcons browsers={['FIREFOX', 'EDGE', 'CHROME-CANARY', 'WEBKIT']}/>
26+
<LayeredBrowserIcons browsers={['FIREFOX', 'EDGE', 'CHROME CANARY', 'WEBKIT']}/>
2727
<LayeredBrowserIcons browsers={['EDGE', 'CHROME', 'WEBKIT', 'ELECTRON']}/>
28-
<LayeredBrowserIcons browsers={['CHROME', 'CHROME BETA', 'CHROME-CANARY']} />
28+
<LayeredBrowserIcons browsers={['CHROME', 'CHROME BETA', 'CHROME CANARY']} />
2929
</div>
3030
))
3131

packages/app/src/debug/LayeredBrowserIcons.vue

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,19 @@
2020

2121
<script lang="ts" setup>
2222
import { computed } from 'vue'
23-
import { IconBrowserChrome,
23+
import {
24+
IconBrowserChrome,
25+
IconBrowserChromeBeta,
2426
IconBrowserChromeCanary,
25-
IconBrowserSafari,
2627
IconBrowserMozillaFirefox,
2728
IconBrowserEdge,
2829
IconBrowserWebkit,
2930
IconBrowserElectronLight,
30-
IconBrowserChromeBeta,
31+
IconGeneralGlobe,
3132
} from '@cypress-design/vue-icon'
3233
33-
// Note: These browser names should map to the list of logoPaths found at https://github.com/cypress-io/cypress-services/blob/46073cb5c387af3b203404280a1664a85e233b93/packages/common/src/logos/getLogoPath.ts
34-
// Some of these are currently incorrect (ex: CHROME-CANARY).
35-
// We are also missing browsers from the list as well
36-
export type BrowserType = 'CHROME' | 'SAFARI' | 'FIREFOX' | 'CHROME-CANARY' | 'CHROME BETA' | 'EDGE' | 'WEBKIT' | 'ELECTRON'
34+
// Note: These browser names should map to the list of logoPaths found at https://github.com/cypress-io/cypress-services/blob/develop/packages/common/src/logos/getLogoPath.ts
35+
export type BrowserType = 'CHROME' | 'CHROME BETA' | 'CANARY' | 'CHROME CANARY' | 'CHROME FOR TESTING' | 'CUSTOM CHROME FOR TESTING' | 'CHROMIUM' | 'CUSTOM CHROMIUM' | 'EDGE' | 'EDGE BETA' | 'EDGE CANARY' | 'EDGE DEV' | 'ELECTRON' | 'FIREFOX' | 'FIREFOX DEVELOPER EDITION' | 'FIREFOX NIGHTLY' | 'WEBKIT'
3736
3837
interface LayeredProps {
3938
browsers: BrowserType[]
@@ -45,7 +44,7 @@ const results = computed(() => {
4544
if (props.browsers) {
4645
return props.browsers.map((browserType) => {
4746
return {
48-
icon: BROWSER_MAP[browserType],
47+
icon: BROWSER_MAP[browserType] || IconGeneralGlobe,
4948
name: `browser-icon-${browserType.toLowerCase().replaceAll(' ', '_')}`,
5049
}
5150
})
@@ -54,15 +53,25 @@ const results = computed(() => {
5453
return []
5554
})
5655
56+
// TODO: Add correct icons for firefox, edge, and chromium
5757
const BROWSER_MAP: Record<BrowserType, any> = {
5858
'CHROME': IconBrowserChrome,
5959
'CHROME BETA': IconBrowserChromeBeta,
60-
'CHROME-CANARY': IconBrowserChromeCanary,
61-
'SAFARI': IconBrowserSafari,
62-
'FIREFOX': IconBrowserMozillaFirefox,
60+
'CANARY': IconBrowserChromeCanary,
61+
'CHROME CANARY': IconBrowserChromeCanary,
62+
'CHROME FOR TESTING': IconBrowserChrome,
63+
'CUSTOM CHROME FOR TESTING': IconBrowserChrome,
64+
'CHROMIUM': IconGeneralGlobe,
65+
'CUSTOM CHROMIUM': IconGeneralGlobe,
6366
'EDGE': IconBrowserEdge,
64-
'WEBKIT': IconBrowserWebkit,
67+
'EDGE BETA': IconBrowserEdge,
68+
'EDGE CANARY': IconBrowserEdge,
69+
'EDGE DEV': IconBrowserEdge,
6570
'ELECTRON': IconBrowserElectronLight,
71+
'FIREFOX': IconBrowserMozillaFirefox,
72+
'FIREFOX DEVELOPER EDITION': IconBrowserMozillaFirefox,
73+
'FIREFOX NIGHTLY': IconBrowserMozillaFirefox,
74+
'WEBKIT': IconBrowserWebkit,
6675
}
6776
6877
</script>

packages/errors/__snapshot-html__/BROWSER_NOT_FOUND_BY_NAME - canary.html

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)