Skip to content

Commit

Permalink
Fix using Chromium installed via snapcraft (#7039)
Browse files Browse the repository at this point in the history
* fix: chromium installed as a snap is properly detected

* add 5s timeout to browser detection

* remove .profile stuff

* use profilePath for alternative profile dirs

* rename legacyPathToProfiles

* update tests

Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
  • Loading branch information
flotwig and kuceb authored Apr 20, 2020
1 parent ae5ae1f commit 9bfc01d
Show file tree
Hide file tree
Showing 19 changed files with 143 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ describe('Project Nav', function () {
const browserArg = this.ipc.launchBrowser.getCall(0).args[0].browser

expect(browserArg).to.have.keys([
'family', 'name', 'path', 'version', 'majorVersion', 'displayName', 'info', 'isChosen', 'custom', 'warning', 'channel',
'family', 'name', 'path', 'profilePath', 'version', 'majorVersion', 'displayName', 'info', 'isChosen', 'custom', 'warning', 'channel',
])

expect(browserArg.path).to.include('/')
Expand Down
2 changes: 2 additions & 0 deletions packages/desktop-gui/src/lib/browser-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default class Browser {
@observable channel
@observable version
@observable path
@observable profilePath
@observable majorVersion
@observable info
@observable custom
Expand All @@ -20,6 +21,7 @@ export default class Browser {
this.channel = browser.channel
this.version = browser.version
this.path = browser.path
this.profilePath = browser.profilePath
this.majorVersion = browser.majorVersion
this.info = browser.info
this.custom = browser.custom
Expand Down
10 changes: 0 additions & 10 deletions packages/launcher/__snapshots__/browsers_spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ exports['browsers returns the expected list of browsers 1'] = [
"channel": "stable",
"displayName": "Chrome",
"versionRegex": {},
"profile": true,
"binary": [
"google-chrome",
"chrome",
Expand All @@ -18,7 +17,6 @@ exports['browsers returns the expected list of browsers 1'] = [
"channel": "stable",
"displayName": "Chromium",
"versionRegex": {},
"profile": true,
"binary": [
"chromium-browser",
"chromium"
Expand All @@ -30,7 +28,6 @@ exports['browsers returns the expected list of browsers 1'] = [
"channel": "canary",
"displayName": "Canary",
"versionRegex": {},
"profile": true,
"binary": "google-chrome-canary"
},
{
Expand All @@ -40,7 +37,6 @@ exports['browsers returns the expected list of browsers 1'] = [
"displayName": "Firefox",
"info": "Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).",
"versionRegex": {},
"profile": true,
"binary": "firefox"
},
{
Expand All @@ -50,7 +46,6 @@ exports['browsers returns the expected list of browsers 1'] = [
"displayName": "Firefox Developer Edition",
"info": "Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).",
"versionRegex": {},
"profile": true,
"binary": [
"firefox-developer-edition",
"firefox"
Expand All @@ -63,7 +58,6 @@ exports['browsers returns the expected list of browsers 1'] = [
"displayName": "Firefox Nightly",
"info": "Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).",
"versionRegex": {},
"profile": true,
"binary": [
"firefox-nightly",
"firefox-trunk"
Expand All @@ -75,7 +69,6 @@ exports['browsers returns the expected list of browsers 1'] = [
"channel": "stable",
"displayName": "Edge",
"versionRegex": {},
"profile": true,
"binary": "edge"
},
{
Expand All @@ -84,7 +77,6 @@ exports['browsers returns the expected list of browsers 1'] = [
"channel": "canary",
"displayName": "Edge Canary",
"versionRegex": {},
"profile": true,
"binary": "edge-canary"
},
{
Expand All @@ -93,7 +85,6 @@ exports['browsers returns the expected list of browsers 1'] = [
"channel": "beta",
"displayName": "Edge Beta",
"versionRegex": {},
"profile": true,
"binary": "edge-beta"
},
{
Expand All @@ -102,7 +93,6 @@ exports['browsers returns the expected list of browsers 1'] = [
"channel": "dev",
"displayName": "Edge Dev",
"versionRegex": {},
"profile": true,
"binary": "edge-dev"
}
]
10 changes: 0 additions & 10 deletions packages/launcher/__snapshots__/darwin_spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
"channel": "stable",
"displayName": "Chrome",
"versionRegex": {},
"profile": true,
"binary": [
"google-chrome",
"chrome",
Expand All @@ -26,7 +25,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
"channel": "stable",
"displayName": "Chromium",
"versionRegex": {},
"profile": true,
"binary": [
"chromium-browser",
"chromium"
Expand All @@ -46,7 +44,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
"channel": "canary",
"displayName": "Canary",
"versionRegex": {},
"profile": true,
"binary": "google-chrome-canary",
"path": "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",
"version": "someVersion",
Expand All @@ -64,7 +61,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
"displayName": "Firefox",
"info": "Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).",
"versionRegex": {},
"profile": true,
"binary": "firefox",
"path": "/Applications/Firefox.app/Contents/MacOS/firefox-bin",
"version": "someVersion",
Expand All @@ -82,7 +78,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
"displayName": "Firefox Developer Edition",
"info": "Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).",
"versionRegex": {},
"profile": true,
"binary": [
"firefox-developer-edition",
"firefox"
Expand All @@ -103,7 +98,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
"displayName": "Firefox Nightly",
"info": "Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).",
"versionRegex": {},
"profile": true,
"binary": [
"firefox-nightly",
"firefox-trunk"
Expand All @@ -123,7 +117,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
"channel": "stable",
"displayName": "Edge",
"versionRegex": {},
"profile": true,
"binary": "edge",
"path": "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
"version": "someVersion",
Expand All @@ -140,7 +133,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
"channel": "canary",
"displayName": "Edge Canary",
"versionRegex": {},
"profile": true,
"binary": "edge-canary",
"path": "/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary",
"version": "someVersion",
Expand All @@ -157,7 +149,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
"channel": "beta",
"displayName": "Edge Beta",
"versionRegex": {},
"profile": true,
"binary": "edge-beta",
"path": "/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta",
"version": "someVersion",
Expand All @@ -174,7 +165,6 @@ exports['darwin browser detection detects browsers as expected 1'] = [
"channel": "dev",
"displayName": "Edge Dev",
"versionRegex": {},
"profile": true,
"binary": "edge-dev",
"path": "/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev",
"version": "someVersion",
Expand Down
10 changes: 0 additions & 10 deletions packages/launcher/__snapshots__/windows_spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
"channel": "stable",
"displayName": "Chrome",
"versionRegex": {},
"profile": true,
"binary": [
"google-chrome",
"chrome",
Expand All @@ -26,7 +25,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
"channel": "stable",
"displayName": "Chromium",
"versionRegex": {},
"profile": true,
"binary": [
"chromium-browser",
"chromium"
Expand All @@ -46,7 +44,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
"channel": "canary",
"displayName": "Canary",
"versionRegex": {},
"profile": true,
"binary": "google-chrome-canary",
"path": "C:/Users/flotwig/AppData/Local/Google/Chrome SxS/Application/chrome.exe",
"version": "3.4.5",
Expand All @@ -64,7 +61,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
"displayName": "Firefox",
"info": "Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).",
"versionRegex": {},
"profile": true,
"binary": "firefox",
"path": "C:/Program Files/Mozilla Firefox/firefox.exe",
"version": "72",
Expand All @@ -82,7 +78,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
"displayName": "Firefox Developer Edition",
"info": "Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).",
"versionRegex": {},
"profile": true,
"binary": [
"firefox-developer-edition",
"firefox"
Expand All @@ -103,7 +98,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
"displayName": "Firefox Nightly",
"info": "Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).",
"versionRegex": {},
"profile": true,
"binary": [
"firefox-nightly",
"firefox-trunk"
Expand All @@ -123,7 +117,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
"channel": "stable",
"displayName": "Edge",
"versionRegex": {},
"profile": true,
"binary": "edge",
"path": "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe",
"version": "11",
Expand All @@ -140,7 +133,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
"channel": "canary",
"displayName": "Edge Canary",
"versionRegex": {},
"profile": true,
"binary": "edge-canary",
"path": "C:/Users/flotwig/AppData/Local/Microsoft/Edge SxS/Application/msedge.exe",
"version": "14",
Expand All @@ -157,7 +149,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
"channel": "beta",
"displayName": "Edge Beta",
"versionRegex": {},
"profile": true,
"binary": "edge-beta",
"path": "C:/Program Files (x86)/Microsoft/Edge Beta/Application/msedge.exe",
"version": "12",
Expand All @@ -174,7 +165,6 @@ exports['windows browser detection detects browsers as expected 1'] = [
"channel": "dev",
"displayName": "Edge Dev",
"versionRegex": {},
"profile": true,
"binary": "edge-dev",
"path": "C:/Program Files (x86)/Microsoft/Edge Dev/Application/msedge.exe",
"version": "13",
Expand Down
10 changes: 0 additions & 10 deletions packages/launcher/lib/browsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const browsers: Browser[] = [
channel: 'stable',
displayName: 'Chrome',
versionRegex: /Google Chrome (\S+)/m,
profile: true,
binary: ['google-chrome', 'chrome', 'google-chrome-stable'],
},
{
Expand All @@ -22,7 +21,6 @@ export const browsers: Browser[] = [
channel: 'stable',
displayName: 'Chromium',
versionRegex: /Chromium (\S+)/m,
profile: true,
binary: ['chromium-browser', 'chromium'],
},
{
Expand All @@ -31,7 +29,6 @@ export const browsers: Browser[] = [
channel: 'canary',
displayName: 'Canary',
versionRegex: /Google Chrome Canary (\S+)/m,
profile: true,
binary: 'google-chrome-canary',
},
{
Expand All @@ -42,7 +39,6 @@ export const browsers: Browser[] = [
info: firefoxInfo,
// Mozilla Firefox 70.0.1
versionRegex: /^Mozilla Firefox ([^\sab]+)$/m,
profile: true,
binary: 'firefox',
},
{
Expand All @@ -53,7 +49,6 @@ export const browsers: Browser[] = [
info: firefoxInfo,
// Mozilla Firefox 73.0b12
versionRegex: /^Mozilla Firefox (\S+b\S*)$/m,
profile: true,
// ubuntu PPAs install it as firefox
binary: ['firefox-developer-edition', 'firefox'],
},
Expand All @@ -65,7 +60,6 @@ export const browsers: Browser[] = [
info: firefoxInfo,
// Mozilla Firefox 74.0a1
versionRegex: /^Mozilla Firefox (\S+a\S*)$/m,
profile: true,
// ubuntu PPAs install it as firefox-trunk
binary: ['firefox-nightly', 'firefox-trunk'],
},
Expand All @@ -75,7 +69,6 @@ export const browsers: Browser[] = [
channel: 'stable',
displayName: 'Edge',
versionRegex: /Microsoft Edge (\S+)/m,
profile: true,
binary: 'edge',
},
{
Expand All @@ -84,7 +77,6 @@ export const browsers: Browser[] = [
channel: 'canary',
displayName: 'Edge Canary',
versionRegex: /Microsoft Edge Canary (\S+)/m,
profile: true,
binary: 'edge-canary',
},
{
Expand All @@ -93,7 +85,6 @@ export const browsers: Browser[] = [
channel: 'beta',
displayName: 'Edge Beta',
versionRegex: /Microsoft Edge Beta (\S+)/m,
profile: true,
binary: 'edge-beta',
},
{
Expand All @@ -102,7 +93,6 @@ export const browsers: Browser[] = [
channel: 'dev',
displayName: 'Edge Dev',
versionRegex: /Microsoft Edge Dev (\S+)/m,
profile: true,
binary: 'edge-dev',
},
]
Expand Down
1 change: 1 addition & 0 deletions packages/launcher/lib/detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ function checkOneBrowser (browser: Browser): Promise<boolean | FoundBrowser> {
'type',
'version',
'path',
'profilePath',
'custom',
'warning',
'info',
Expand Down
Loading

4 comments on commit 9bfc01d

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9bfc01d Apr 20, 2020

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.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.4.1/linux-x64/circle-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-303457/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.4.1/circle-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-303443/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9bfc01d Apr 20, 2020

Choose a reason for hiding this comment

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

AppVeyor has built the win32 ia32 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

Instructions are included below, depending on the shell you are using.

In Command Prompt (cmd.exe):

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.4.1/win32-ia32/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.4.1/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.tgz

In PowerShell:

$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/4.4.1/win32-ia32/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.4.1/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.tgz

In Git Bash:

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.4.1/win32-ia32/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.4.1/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.tgz

Using cross-env:

If the above commands do not work for you, you can also try using cross-env:

npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.4.1/win32-ia32/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.zip npm install https://cdn.cypress.io/beta/npm/4.4.1/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9bfc01d Apr 20, 2020

Choose a reason for hiding this comment

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

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

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

Instructions are included below, depending on the shell you are using.

In Command Prompt (cmd.exe):

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.4.1/win32-x64/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.4.1/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.tgz

In PowerShell:

$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/4.4.1/win32-x64/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.4.1/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.tgz

In Git Bash:

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.4.1/win32-x64/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.4.1/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.tgz

Using cross-env:

If the above commands do not work for you, you can also try using cross-env:

npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.4.1/win32-x64/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.zip npm install https://cdn.cypress.io/beta/npm/4.4.1/appveyor-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-32296226/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9bfc01d Apr 20, 2020

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.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/4.4.1/darwin-x64/circle-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-303468/cypress.zip
npm install https://cdn.cypress.io/beta/npm/4.4.1/circle-develop-9bfc01df02a0a8a6779e827c566c4d4513f73ada-303465/cypress.tgz

Please sign in to comment.