Skip to content

Commit f33c193

Browse files
chrisbreidingflotwigbrian-mann
authored andcommitted
Electron v5.0.10 (cypress-io#4720)
* fix specs * use debugger protocol for cookie handling in electron * use latest gulp * use rimraf instead of gulp-clean * use electron 3.1.8 and node 10.2.1 * use gulp 4 in packages/static * fix sendCommandAsync, log Schema.getDomains on CDP connect * autofill e2e test name [skip ci] * [email protected], see what new failures exist * --no-sandbox for launching Electron * update cookies logic for electron * node 12 * update snapshot for new node * update error message for new node * stub sendCommandAsync * only connect to socket if path has been replaced, fixes cypress-io#4776 * update node-sass to support node 12 * skip wacky socket tests for now * snapshot * fix run_plugins_spec snapshot, don't include stack trace * use --no-sandbox on linux to run as root * allow sendCommandAsync to resolve * use euid for root check * log domains even if undefined * don't worry about ending 1xx responses immediately anymore * use --max-http-header-size, change max size from 8kb to 1mb, fix cypress-io#76 * do not send 502 on failed websocket, just send back ECONNRESET * update websocket spec port to not collide with other test * update outdated expect * Revert "only connect to socket if path has been replaced, fixes cypress-io#4776" This reverts commit f179eda. * update gulp in root * update https-proxy unit tests * update network spec to properly close server * update reporter spec * update https-proxy-agent to fix node 10.10.0 change discussion: https://github.com/nodejs/node/issues/24474\#issuecomment-511963799 * only pass --max-http-header-size on node >=12 * use own server-destroy implementation that supports secureConnect events * oops * update socket_spec * electron 6.0.0 * console.table introduced in node 10 * change browserify entry to init.js * handle edge case when no response body * console.table added in node 10 * do not exit app when all BrowserWindows are closed * update e2e snapshots * value may not be null * update plugins spec * correct cookie expiry, use browser.getversion for CDP version check * fix snapshotting for require stacks * reorder cookies in spec * warn when depreated electron callback apis are used * only report 1 plugin error per process * cleanup * node 12.4.0, cypress/browsers:node12.4.0-chrome76 docker image * update shell.openExternal to promisified * update dialog.showOpenDialog to promisified * update webContents.session.setProxy to promisified * updating native dependencies since we don't need ancient node ABI support anymore * WIP: switch cookies to simpler, jar-less approach * WIP: switch cookies to simpler, jar-less approach * making tests pass * improve cookie filtering logic * Remove unneeded Promise.try * filter what makes it to the extension * properly re-set superdomain cookies on cross-origin cy.visit * allow comma-separated list of e2e tests * sort cookies in order of expiration date, ascending * updating tests, cleanup * update tests * version electron as a devDependency, [email protected] * cleanup, remove old automation * cleanup, remove old automation * bump chokidar to fix win10 + node12 issue was seeing this on windows: nuxt/nuxt#6035 fixed with version bump * enable now-supported quit role, re-enable old tests * don't need that arg there * remove last deprecated callback electron invocations * Delete cypress.json * responding to PR feedback * cleanup * invoke * use 'quit' role * Use new appMenu role for Cypress menu on mac * [email protected] * [email protected] * remove domain: cookie.domain and see what happens * remove setErrorHandler * Revert "remove domain: cookie.domain and see what happens" This reverts commit 49e9168. * add unit tests for cookies * ci * fix project-content css * [email protected] * fix specs_list test * [email protected] * some cleanup * [email protected] * Update 8_reporters_spec.coffee.js * [email protected] - Chromium 73, Node 12 * cli: fix the STDIN pipe on Windows (cypress-io#5045) * cli: pipe stdin * uggh, here is the actual change * update cli unit tests * add unit test * more permissive check for json to include application/vnd.api+j… (cypress-io#5166) * more permissive check for json to include * add json test for content-type application/vnd.api+json * cruder solution passes e2e tests locally, so let's go with that * Remove 'charset' from content-type before checking if JSON * fix eslint for fixture specs (cypress-io#5176) * update eslint to lint files within 'fixtures' in support files - ignore some edge cases like jquery, jsx and obvious js files we wrote with broken code * Fixes from eslint to 'fixtures' files * Catch env variable with reserved name CYPRESS_ENV 1621 (cypress-io#1626) * server: check CYPRESS_ENV variable when merging configs * catch invalid CYPRESS_ENV value in CLI, close cypress-io#1621 * linting * sanitize platform in test snapshot * linting * update error message text * add missing comma * fix finally merge in JS code * pass CLI linter * fix log reference, should be debug * use correct sinon reference * update message, show first part in red * update error message text * Addresses cypress-io#2953 (cypress-io#5174) * Addresses cypress-io#2953 * Added proper test for new error message * Didn't realize it ran this test as well, whoops * Implementing changes as suggested by @jennifer-shehane * Fixing tests and error output. Moved the checks to the start of the get command to ensure we always catch improper options * Removing issue test since the querying spec covers it * Using coffescript isArray check * depromisify things that were promisified b/t electron 5 <=> 6 Revert "update shell.openExternal to promisified" This reverts commit 8b6460d. Revert "update dialog.showOpenDialog to promisified" This reverts commit 5f178b0. Revert "update webContents.session.setProxy to promisified" This reverts commit 727df3a. * node12.4.0-chrome76 => node12.0.0-chrome75 * fix tests for electron downgrade * node12.0.0-chrome75 => node12.0.0-chrome73 Co-authored-by: Zach Bloomquist <[email protected]> Co-authored-by: Brian Mann <[email protected]>
1 parent 6961ce3 commit f33c193

File tree

79 files changed

+1151
-1166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1151
-1166
lines changed

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Cached Theme Material Design.pak
2222
packages/https-proxy/ca/
2323

2424
# from desktop-gui
25+
packages/desktop-gui/cypress/videos
2526
packages/desktop-gui/src/jsconfig.json
2627

2728
# from driver
@@ -32,9 +33,6 @@ packages/example/app
3233
packages/example/build
3334
packages/example/cypress
3435

35-
# from driver
36-
packages/driver/test/cypress/videos
37-
3836
# from server
3937
packages/server/.cy
4038
packages/server/.projects

.node-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.9.3
1+
12.4.0

.vscode/terminals.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"onlySingle": true,
3030
"execute": false,
3131
"cwd": "[cwd]/packages/server",
32-
"command": "npm run test-e2e -- --spec name"
32+
"command": "npm run test-e2e -- --spec [fileBasename]"
3333
},
3434
{
3535
"name": "packages/runner watch",

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ branches:
77
# https://www.appveyor.com/docs/lang/nodejs-iojs/
88
environment:
99
# use matching version of Node.js
10-
nodejs_version: "8.9.3"
10+
nodejs_version: "12.4.0"
1111
# encode secure variables which will NOT be used
1212
# in pull requests
1313
# https://www.appveyor.com/docs/build-configuration/#secure-variables

circle.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ executors:
2323
# the Docker image with Cypress dependencies and Chrome browser
2424
cy-doc:
2525
docker:
26-
- image: cypress/browsers:node8.9.3-npm6.10.1-chrome75
26+
- image: cypress/browsers:node12.0.0-chrome73
2727
environment:
2828
PLATFORM: linux
2929

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@
102102
"cloudflare-cli": "3.2.2",
103103
"coffeelint": "1.16.2",
104104
"common-tags": "1.8.0",
105-
"console.table": "0.10.0",
106105
"debug": "4.1.1",
107106
"decaffeinate": "6.0.1",
108107
"del": "3.0.0",
@@ -161,7 +160,7 @@
161160
"vinyl-paths": "2.1.0"
162161
},
163162
"engines": {
164-
"node": ">=8.9.3"
163+
"node": "12.4.0"
165164
},
166165
"productName": "Cypress",
167166
"license": "MIT",

packages/desktop-gui/cypress/integration/login_spec.js

-9
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ describe('Login', function () {
1818
cy.stub(this.ipc, 'openProject').resolves(this.config)
1919
cy.stub(this.ipc, 'getSpecs').yields(null, this.specs)
2020
cy.stub(this.ipc, 'externalOpen')
21-
cy.stub(this.ipc, 'clearGithubCookies')
2221
cy.stub(this.ipc, 'logOut').resolves()
2322

2423
cy.stub(this.ipc, 'onAuthMessage').callsFake((function (_this) {
@@ -124,14 +123,6 @@ describe('Login', function () {
124123
cy.get('.nav').contains('Log In')
125124
})
126125

127-
it('calls clear:github:cookies', function () {
128-
cy.get('nav a').contains('Jane').click()
129-
130-
cy.contains('Log Out').click().then(function () {
131-
expect(this.ipc.clearGithubCookies).to.be.called
132-
})
133-
})
134-
135126
it('calls log:out', function () {
136127
cy.get('nav a').contains('Jane').click()
137128

packages/desktop-gui/src/auth/auth-api.js

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class AuthApi {
3939
logOut () {
4040
authStore.setUser(null)
4141

42-
ipc.clearGithubCookies()
4342
ipc.logOut()
4443
.catch((err) => {
4544
err.name = 'An unexpected error occurred while logging out'

packages/desktop-gui/src/lib/ipc.js

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const ipc = {
1111
handleUnauthed () {
1212
authStore.setUser(null)
1313

14-
ipc.clearGithubCookies()
1514
ipc.logOut()
1615
},
1716
}
@@ -32,7 +31,6 @@ const register = (eventName, isPromiseApi = true) => {
3231
register('add:project')
3332
register('begin:auth')
3433
register('on:auth:message', false)
35-
register('clear:github:cookies')
3634
register('close:browser')
3735
register('close:project')
3836
register('external:open')

packages/desktop-gui/src/project/project.scss

+1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
flex-grow: 2;
55
margin-bottom: 0;
66
width: 100%;
7+
min-height: 0;
78
}

packages/desktop-gui/src/specs/specs.scss

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ $max-nesting-level: 14;
55
display: flex;
66
flex-direction: column;
77
width: 100%;
8+
min-height: 0;
89

910
.empty-well code {
1011
display: block;

packages/driver/src/cy/stability.coffee

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ tryFn = (fn) ->
55
Promise.try(fn)
66

77
create = (Cypress, state) ->
8-
isStable = (bool = true, event) ->
9-
return if state("isStable") is bool
8+
isStable = (stable = true, event) ->
9+
return if state("isStable") is stable
1010

1111
## if we are going back to stable and we have
1212
## a whenStable callback
13-
if bool and whenStable = state("whenStable")
13+
if stable and whenStable = state("whenStable")
1414
## invoke it
1515
whenStable()
1616

17-
state("isStable", bool)
17+
state("isStable", stable)
1818

1919
## we notify the outside world because this is what the runner uses to
2020
## show the 'loading spinner' during an app page loading transition event
21-
Cypress.action("cy:stability:changed", bool, event)
21+
Cypress.action("cy:stability:changed", stable, event)
2222

2323
whenStable = (fn) ->
2424
## if we are not stable

packages/electron/lib/electron.coffee

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
fs = require("fs-extra")
22
cp = require("child_process")
3+
os = require("os")
34
path = require("path")
45
debug = require("debug")("cypress:electron")
56
Promise = require("bluebird")
@@ -59,6 +60,10 @@ module.exports = {
5960
.then ->
6061
execPath = paths.getPathToExec()
6162

63+
## if running as root, no-sandbox must be passed or Chrome will not start
64+
if os.platform() == "linux" && process.geteuid() == 0
65+
argv.unshift("--no-sandbox")
66+
6267
## we have an active debugger session
6368
if inspector.url()
6469
dp = process.debugPort + 1
@@ -70,15 +75,19 @@ module.exports = {
7075
if opts.inspectBrk
7176
argv.unshift("--inspect-brk=5566")
7277

78+
## max HTTP header size 8kb -> 1mb
79+
## https://github.com/cypress-io/cypress/issues/76
80+
argv.unshift("--max-http-header-size=#{1024*1024}")
81+
7382
debug("spawning %s with args", execPath, argv)
7483

7584
if debug.enabled
7685
## enable the internal chromium logger
7786
argv.push("--enable-logging")
7887

7988
cp.spawn(execPath, argv, {stdio: "inherit"})
80-
.on "close", (code) ->
81-
debug("electron closing with code", code)
89+
.on "close", (code, errCode) ->
90+
debug("electron closing %o", { code, errCode })
8291

8392
if code
8493
debug("original command was")

packages/electron/lib/install.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ log = require("debug")("cypress:electron")
1010
fs = Promise.promisifyAll(fs)
1111

1212
## ensure we have an electronVersion set in package.json
13-
if not electronVersion = pkg.electronVersion
14-
throw new Error("Missing 'electronVersion' in ./package.json")
13+
if not electronVersion = pkg.devDependencies.electron
14+
throw new Error("Missing 'electron' devDependency in ./package.json")
1515

1616
module.exports = {
1717
checkCurrentVersion: ->

packages/electron/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"minimist": "1.2.0"
2727
},
2828
"devDependencies": {
29+
"electron": "5.0.10",
2930
"mocha": "3.5.3"
3031
},
3132
"files": [
@@ -34,6 +35,5 @@
3435
],
3536
"bin": {
3637
"cypress-electron": "./bin/cypress-electron"
37-
},
38-
"electronVersion": "2.0.18"
38+
}
3939
}

packages/example/gulpfile.js

+19-22
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
let gulp = require('gulp')
2-
let ghPages = require('gulp-gh-pages-will')
3-
let clean = require('gulp-clean')
4-
let RevAll = require('gulp-rev-all')
1+
const gulp = require('gulp')
2+
const ghPages = require('gulp-gh-pages-will')
3+
const gulpClean = require('gulp-clean')
4+
const RevAll = require('gulp-rev-all')
55

6-
gulp.task('assets', function () {
7-
let revAllOpts = {
6+
const assets = () => {
7+
const revAllOpts = {
88
dontGlobal: ['.ico', 'fira.css', 'javascript-logo.png'],
99
dontRenameFile: ['.ico', '.html', /fonts/],
1010
dontSearchFile: ['.js'],
@@ -14,28 +14,25 @@ gulp.task('assets', function () {
1414
return gulp.src('./app/**/*')
1515
.pipe(RevAll.revision(revAllOpts))
1616
.pipe(gulp.dest('build'))
17-
})
17+
}
1818

19-
gulp.task('cname', function () {
20-
return gulp.src('CNAME')
19+
const cname = () => {
20+
return gulp.src('CNAME', { allowEmpty: true })
2121
.pipe(gulp.dest('build'))
22-
})
22+
}
2323

24-
gulp.task('gitignore', function () {
25-
return gulp.src('.gitignore', { allowEmpty: true })
26-
.pipe(gulp.dest('build'))
27-
})
28-
29-
gulp.task('clean', function () {
24+
const clean = () => {
3025
return gulp.src('./build', { allowEmpty: true })
31-
.pipe(clean())
32-
})
26+
.pipe(gulpClean())
27+
}
3328

34-
gulp.task('push-gh-pages', function () {
29+
const pushGhPages = () => {
3530
return gulp.src('build/**/*')
3631
.pipe(ghPages())
37-
})
32+
}
33+
34+
const build = gulp.series(clean, gulp.parallel(assets, cname))
3835

39-
gulp.task('build', gulp.series('clean', gulp.parallel('assets', 'cname', 'gitignore')))
36+
exports.build = build
4037

41-
gulp.task('deploy', gulp.series('build', 'push-gh-pages'))
38+
exports.deploy = gulp.series(build, pushGhPages)

packages/extension/app/background.coffee

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ once = require("lodash/once")
44
Promise = require("bluebird")
55
client = require("./client")
66

7+
COOKIE_PROPS = ['url', 'name', 'domain', 'path', 'secure', 'storeId']
8+
GET_ALL_PROPS = COOKIE_PROPS.concat(['session'])
9+
SET_PROPS = COOKIE_PROPS.concat(['value', 'httpOnly', 'expirationDate'])
10+
711
httpRe = /^http/
812

913
firstOrNull = (cookies) ->
@@ -61,7 +65,7 @@ connect = (host, path) ->
6165
ws.emit("automation:client:connected")
6266

6367
return ws
64-
68+
6569
automation = {
6670
connect
6771

@@ -85,6 +89,7 @@ automation = {
8589
.map(clear)
8690

8791
getAll: (filter = {}) ->
92+
filter = pick(filter, GET_ALL_PROPS)
8893
get = ->
8994
new Promise (resolve) ->
9095
chrome.cookies.getAll(filter, resolve)
@@ -105,6 +110,7 @@ automation = {
105110
new Promise (resolve, reject) =>
106111
## only get the url if its not already set
107112
props.url ?= @getUrl(props)
113+
props = pick(props, SET_PROPS)
108114
chrome.cookies.set props, (details) ->
109115
switch
110116
when details

0 commit comments

Comments
 (0)