mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-24 07:59:12 -05:00
chore(deps): Updating electron to v18 + node v16.13.2 (#21418)
* chore: Updating electron to v18 + node v16.13.2 * Updating origin test, it needs to be fixed a different way * Removing origin workaround for config_env specs, it should not be necessary. * Removing now-unused semver dependency
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
16.5.0
|
||||
16.13.2
|
||||
+17
-7
@@ -39,6 +39,7 @@ macWorkflowFilters: &mac-workflow-filters
|
||||
or:
|
||||
- equal: [ develop, << pipeline.git.branch >> ]
|
||||
- equal: [ check-results-for-env, << pipeline.git.branch >> ]
|
||||
- equal: [ tbiethman/chore/electron-18-update, << pipeline.git.branch >> ]
|
||||
- matches:
|
||||
pattern: "-release$"
|
||||
value: << pipeline.git.branch >>
|
||||
@@ -49,6 +50,7 @@ windowsWorkflowFilters: &windows-workflow-filters
|
||||
- equal: [ master, << pipeline.git.branch >> ]
|
||||
- equal: [ develop, << pipeline.git.branch >> ]
|
||||
- equal: [ check-results-for-env, << pipeline.git.branch >> ]
|
||||
- equal: [ tbiethman/chore/electron-18-update, << pipeline.git.branch >> ]
|
||||
- matches:
|
||||
pattern: "-release$"
|
||||
value: << pipeline.git.branch >>
|
||||
@@ -60,7 +62,7 @@ executors:
|
||||
# the Docker image with Cypress dependencies and Chrome browser
|
||||
cy-doc:
|
||||
docker:
|
||||
- image: cypress/browsers:node16.5.0-chrome94-ff93
|
||||
- image: cypress/browsers:node16.13.2-chrome100-ff98
|
||||
# by default, we use "small" to save on CI costs. bump on a per-job basis if needed.
|
||||
resource_class: small
|
||||
environment:
|
||||
@@ -69,7 +71,7 @@ executors:
|
||||
# Docker image with non-root "node" user
|
||||
non-root-docker-user:
|
||||
docker:
|
||||
- image: cypress/browsers:node16.5.0-chrome94-ff93
|
||||
- image: cypress/browsers:node16.13.2-chrome100-ff98
|
||||
user: node
|
||||
environment:
|
||||
PLATFORM: linux
|
||||
@@ -371,8 +373,10 @@ commands:
|
||||
npm install yarn -g # ensure yarn is installed with the correct node engine
|
||||
yarn check-node-version
|
||||
- run:
|
||||
name: Check Node
|
||||
command: yarn check-node-version
|
||||
name: Check Node
|
||||
command: |
|
||||
[ -s "${HOME}/.nvm/nvm.sh" ] && \. "${HOME}/.nvm/nvm.sh"
|
||||
yarn check-node-version
|
||||
|
||||
install-chrome:
|
||||
description: Install Google Chrome
|
||||
@@ -589,7 +593,11 @@ commands:
|
||||
## by default, assert that at least 1 test ran
|
||||
default: 0
|
||||
steps:
|
||||
- run: yarn verify:mocha:results <<parameters.expectedResultCount>>
|
||||
- run:
|
||||
name: 'Verify Mocha Results'
|
||||
command: |
|
||||
[ -s "${HOME}/.nvm/nvm.sh" ] && \. "${HOME}/.nvm/nvm.sh"
|
||||
yarn verify:mocha:results <<parameters.expectedResultCount>>
|
||||
|
||||
clone-repo-and-checkout-release-branch:
|
||||
description: |
|
||||
@@ -896,7 +904,9 @@ commands:
|
||||
yarn binary-build --platform $PLATFORM --version $(node ./scripts/get-next-version.js)
|
||||
- run:
|
||||
name: Zip the binary
|
||||
command: yarn binary-zip --platform $PLATFORM
|
||||
command: |
|
||||
apt-get update && apt-get install -y zip
|
||||
yarn binary-zip --platform $PLATFORM
|
||||
- store-npm-logs
|
||||
- persist_to_workspace:
|
||||
root: ~/
|
||||
@@ -1247,7 +1257,7 @@ jobs:
|
||||
|
||||
runner-integration-tests-firefox:
|
||||
<<: *defaults
|
||||
resource_class: medium
|
||||
resource_class: medium+
|
||||
parallelism: 2
|
||||
steps:
|
||||
- run-runner-integration-tests:
|
||||
|
||||
@@ -267,7 +267,7 @@ describe('util', () => {
|
||||
})
|
||||
|
||||
it('copy NODE_OPTIONS to ORIGINAL_NODE_OPTIONS', () => {
|
||||
sandbox.stub(process.versions, 'node').value('v16.5.0')
|
||||
sandbox.stub(process.versions, 'node').value('v16.13.2')
|
||||
sandbox.stub(process.versions, 'openssl').value('1.0.0')
|
||||
|
||||
restoreEnv = mockedEnv({
|
||||
@@ -322,7 +322,7 @@ describe('util', () => {
|
||||
|
||||
// https://github.com/cypress-io/cypress/issues/18914
|
||||
it('does not include --openssl-legacy-provider in Node <=16', () => {
|
||||
sandbox.stub(process.versions, 'node').value('v16.5.0')
|
||||
sandbox.stub(process.versions, 'node').value('v16.13.2')
|
||||
sandbox.stub(process.versions, 'openssl').value('1.0.0')
|
||||
|
||||
restoreEnv = mockedEnv({})
|
||||
|
||||
+1
-1
@@ -169,7 +169,7 @@
|
||||
"yarn-deduplicate": "3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.5.0",
|
||||
"node": ">=16.13.2",
|
||||
"yarn": ">=1.17.3"
|
||||
},
|
||||
"productName": "Cypress",
|
||||
|
||||
@@ -114,6 +114,10 @@
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
/* normalizing li height across supported browsers */
|
||||
li {
|
||||
height: 18px;
|
||||
}
|
||||
</style>
|
||||
|
||||
DOM Fixture
|
||||
|
||||
@@ -589,13 +589,10 @@ describe('src/cy/commands/actions/trigger', () => {
|
||||
})
|
||||
|
||||
it('passes options.animationDistanceThreshold to cy.ensureElementIsNotAnimating', () => {
|
||||
const $btn = cy.$$('button:first')
|
||||
|
||||
const { fromElWindow } = Cypress.dom.getElementCoordinatesByPosition($btn)
|
||||
|
||||
cy.spy(cy, 'ensureElementIsNotAnimating')
|
||||
|
||||
cy.get('button:first').trigger('tap', { animationDistanceThreshold: 1000 }).then(() => {
|
||||
cy.get('button:first').trigger('tap', { animationDistanceThreshold: 1000 }).then(($btn) => {
|
||||
const { fromElWindow } = Cypress.dom.getElementCoordinatesByPosition($btn)
|
||||
const { args } = cy.ensureElementIsNotAnimating.firstCall
|
||||
|
||||
expect(args[1]).to.deep.eq([fromElWindow, fromElWindow])
|
||||
@@ -606,13 +603,10 @@ describe('src/cy/commands/actions/trigger', () => {
|
||||
it('passes config.animationDistanceThreshold to cy.ensureElementIsNotAnimating', () => {
|
||||
const animationDistanceThreshold = Cypress.config('animationDistanceThreshold')
|
||||
|
||||
const $btn = cy.$$('button:first')
|
||||
|
||||
const { fromElWindow } = Cypress.dom.getElementCoordinatesByPosition($btn)
|
||||
|
||||
cy.spy(cy, 'ensureElementIsNotAnimating')
|
||||
|
||||
cy.get('button:first').trigger('mouseover').then(() => {
|
||||
cy.get('button:first').trigger('mouseover').then(($btn) => {
|
||||
const { fromElWindow } = Cypress.dom.getElementCoordinatesByPosition($btn)
|
||||
const { args } = cy.ensureElementIsNotAnimating.firstCall
|
||||
|
||||
expect(args[1]).to.deep.eq([fromElWindow, fromElWindow])
|
||||
|
||||
@@ -351,13 +351,10 @@ describe('src/cy/commands/actions/type - #type', () => {
|
||||
})
|
||||
|
||||
it('passes options.animationDistanceThreshold to cy.ensureElementIsNotAnimating', () => {
|
||||
const $txt = cy.$$(':text:first')
|
||||
|
||||
const { fromElWindow } = Cypress.dom.getElementCoordinatesByPosition($txt)
|
||||
|
||||
cy.spy(cy, 'ensureElementIsNotAnimating')
|
||||
|
||||
cy.get(':text:first').type('foo', { animationDistanceThreshold: 1000 }).then(() => {
|
||||
cy.get(':text:first').type('foo', { animationDistanceThreshold: 1000 }).then(($txt) => {
|
||||
const { fromElWindow } = Cypress.dom.getElementCoordinatesByPosition($txt)
|
||||
const { args } = cy.ensureElementIsNotAnimating.firstCall
|
||||
|
||||
expect(args[1]).to.deep.eq([fromElWindow, fromElWindow])
|
||||
@@ -369,13 +366,10 @@ describe('src/cy/commands/actions/type - #type', () => {
|
||||
it('passes config.animationDistanceThreshold to cy.ensureElementIsNotAnimating', () => {
|
||||
const animationDistanceThreshold = Cypress.config('animationDistanceThreshold')
|
||||
|
||||
const $txt = cy.$$(':text:first')
|
||||
|
||||
const { fromElWindow } = Cypress.dom.getElementCoordinatesByPosition($txt)
|
||||
|
||||
cy.spy(cy, 'ensureElementIsNotAnimating')
|
||||
|
||||
cy.get(':text:first').type('foo').then(() => {
|
||||
cy.get(':text:first').type('foo').then(($txt) => {
|
||||
const { fromElWindow } = Cypress.dom.getElementCoordinatesByPosition($txt)
|
||||
const { args } = cy.ensureElementIsNotAnimating.firstCall
|
||||
|
||||
expect(args[1]).to.deep.eq([fromElWindow, fromElWindow])
|
||||
|
||||
@@ -22,9 +22,18 @@ context('cy.origin navigation', () => {
|
||||
cy.get('a[data-cy="dom-link"]').click()
|
||||
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy.get(':checkbox[name="colors"][value="blue"]').check().should('be.checked')
|
||||
cy.window().then((localWindow) => {
|
||||
// Define a custom property on window that we can assert the presence of.
|
||||
// After reloading, this property should not exist.
|
||||
// @ts-ignore
|
||||
localWindow.cy_testCustomValue = true
|
||||
})
|
||||
|
||||
cy.window().should('have.prop', 'cy_testCustomValue', true)
|
||||
|
||||
cy.reload()
|
||||
cy.get(':checkbox[name="colors"][value="blue"]').should('not.be.checked')
|
||||
|
||||
cy.window().should('not.have.prop', 'cy_testCustomValue', true)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -6,6 +6,16 @@ context('cy.origin spies, stubs, and clock', () => {
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
// FIXME: Tests that end with a cy.origin command and enqueue no further cy
|
||||
// commands may have origin's unload event bleed into subsequent tests
|
||||
// and prevent stability from being reached, causing those tests to hang.
|
||||
// We enqueue another cy command after each test to ensure stability
|
||||
// is reached for the next test. This additional command can be removed with the
|
||||
// completion of: https://github.com/cypress-io/cypress/issues/21300
|
||||
cy.then(() => { /* ensuring stability */ })
|
||||
})
|
||||
|
||||
it('spy()', () => {
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
const foo = { bar () { } }
|
||||
|
||||
@@ -4,6 +4,16 @@ context('cy.origin unsupported commands', () => {
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
// FIXME: Tests that end with a cy.origin command and enqueue no further cy
|
||||
// commands may have origin's unload event bleed into subsequent tests
|
||||
// and prevent stability from being reached, causing those tests to hang.
|
||||
// We enqueue another cy command after each test to ensure stability
|
||||
// is reached for the next test. This additional command can be removed with the
|
||||
// completion of: https://github.com/cypress-io/cypress/issues/21300
|
||||
cy.then(() => { /* ensuring stability */ })
|
||||
})
|
||||
|
||||
it('cy.route() method is deprecated', (done) => {
|
||||
cy.on('fail', (err) => {
|
||||
expect(err.message).to.equal('`cy.route()` has been deprecated and its use is not supported in the `cy.origin()` callback. Consider using `cy.intercept()` (outside of the callback) instead.')
|
||||
|
||||
@@ -10,11 +10,6 @@
|
||||
error: 'cy-origin-error',
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
// @ts-ignore
|
||||
window.top.__cySkipValidateConfig = true
|
||||
|
||||
@@ -6,6 +6,16 @@ describe('cy.origin Cypress API', () => {
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
// FIXME: Tests that end with a cy.origin command and enqueue no further cy
|
||||
// commands may have origin's unload event bleed into subsequent tests
|
||||
// and prevent stability from being reached, causing those tests to hang.
|
||||
// We enqueue another cy command after each test to ensure stability
|
||||
// is reached for the next test. This additional command can be removed with the
|
||||
// completion of: https://github.com/cypress-io/cypress/issues/21300
|
||||
cy.then(() => { /* ensuring stability */ })
|
||||
})
|
||||
|
||||
context('Commands', () => {
|
||||
it('adds a custom command', () => {
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
|
||||
@@ -42,7 +42,13 @@ describe('cy.origin logging', () => {
|
||||
|
||||
expect(originLog.groupStart).to.be.true
|
||||
|
||||
done()
|
||||
// FIXME: Tests that end with a cy.origin command and enqueue no further cy
|
||||
// commands may have origin's unload event bleed into subsequent tests
|
||||
// and prevent stability from being reached, causing those tests to hang.
|
||||
// We execute done after a brief timeout to ensure stability
|
||||
// is reached for the next test. This timeout can be removed with the
|
||||
// completion of: https://github.com/cypress-io/cypress/issues/21300
|
||||
setTimeout(done, 0)
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
@@ -64,7 +70,13 @@ describe('cy.origin logging', () => {
|
||||
|
||||
expect(originLog.groupStart).to.be.true
|
||||
|
||||
done()
|
||||
// FIXME: Tests that end with a cy.origin command and enqueue no further cy
|
||||
// commands may have origin's unload event bleed into subsequent tests
|
||||
// and prevent stability from being reached, causing those tests to hang.
|
||||
// We execute done after a brief timeout to ensure stability
|
||||
// is reached for the next test. This timeout can be removed with the
|
||||
// completion of: https://github.com/cypress-io/cypress/issues/21300
|
||||
setTimeout(done, 0)
|
||||
})
|
||||
|
||||
cy.visit('/fixtures/primary-origin.html')
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
describe('cy.origin', () => {
|
||||
afterEach(() => {
|
||||
// FIXME: Tests that end with a cy.origin command and enqueue no further cy
|
||||
// commands may have origin's unload event bleed into subsequent tests
|
||||
// and prevent stability from being reached, causing those tests to hang.
|
||||
// We enqueue another cy command after each test to ensure stability
|
||||
// is reached for the next test. This additional command can be removed with the
|
||||
// completion of: https://github.com/cypress-io/cypress/issues/21300
|
||||
cy.then(() => { /* ensuring stability */ })
|
||||
})
|
||||
|
||||
it('passes viewportWidth/Height state to the secondary origin', () => {
|
||||
const expectedViewport = [320, 480]
|
||||
|
||||
@@ -237,12 +247,13 @@ describe('cy.origin', () => {
|
||||
expect(err.message).not.to.include(`The following error originated from your application code, not from Cypress`)
|
||||
expect(err.codeFrame).to.exist
|
||||
expect(err.codeFrame!.frame).to.include('cy.origin')
|
||||
|
||||
done()
|
||||
})
|
||||
|
||||
const variable = () => {}
|
||||
|
||||
cy.origin('http://idp.com:3500', { args: variable }, (variable) => {
|
||||
cy.origin('http://foobar.com:3500', { args: variable }, (variable) => {
|
||||
variable()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -4,6 +4,16 @@ describe('cy.origin - uncaught errors', () => {
|
||||
cy.get('a[data-cy="errors-link"]').click()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
// FIXME: Tests that end with a cy.origin command and enqueue no further cy
|
||||
// commands may have origin's unload event bleed into subsequent tests
|
||||
// and prevent stability from being reached, causing those tests to hang.
|
||||
// We enqueue another cy command after each test to ensure stability
|
||||
// is reached for the next test. This additional command can be removed with the
|
||||
// completion of: https://github.com/cypress-io/cypress/issues/21300
|
||||
cy.then(() => { /* ensuring stability */ })
|
||||
})
|
||||
|
||||
describe('sync errors', () => {
|
||||
it('appropriately reports negative assertions', (done) => {
|
||||
cy.on('fail', (err) => {
|
||||
|
||||
@@ -14,6 +14,16 @@ describe('cy.origin yields', () => {
|
||||
cy.get('a[data-cy="cross-origin-secondary-link"]').click()
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
// FIXME: Tests that end with a cy.origin command and enqueue no further cy
|
||||
// commands may have origin's unload event bleed into subsequent tests
|
||||
// and prevent stability from being reached, causing those tests to hang.
|
||||
// We enqueue another cy command after each test to ensure stability
|
||||
// is reached for the next test. This additional command can be removed with the
|
||||
// completion of: https://github.com/cypress-io/cypress/issues/21300
|
||||
cy.then(() => { /* ensuring stability */ })
|
||||
})
|
||||
|
||||
it('yields a value', () => {
|
||||
cy.origin('http://foobar.com:3500', () => {
|
||||
cy
|
||||
|
||||
@@ -360,9 +360,10 @@ export default function (Commands, Cypress, cy, state, config) {
|
||||
// We don't want to send it twice.
|
||||
!Cypress.isBrowser('firefox') ||
|
||||
// After Firefox 98,
|
||||
// it sends a click event automatically if the element is a <button>
|
||||
// it does not if the element is an <input>
|
||||
(!isFirefoxBefore98 && $elements.isInput(event.target))
|
||||
// it sends a click event automatically if the element is a <button>,
|
||||
// but it does not if the element is an <input>.
|
||||
// event.target is null when used with shadow DOM.
|
||||
(!isFirefoxBefore98 && event.target && $elements.isInput(event.target))
|
||||
) &&
|
||||
// Click event is sent after keyup event with space key.
|
||||
event.type === 'keyup' && event.code === 'Space' &&
|
||||
|
||||
@@ -37,6 +37,7 @@ Upgrading `electron` involves more than just bumping this package's `package.jso
|
||||
- there are changes to Electron that require new shared libraries to be installed on Linux, breaking existing CI setups, or
|
||||
- there is some other change that would break existing usage of Cypress (for example, a Web API feature being removed/added to the bundled Chromium)
|
||||
- [ ] **Create and publish Docker `base` and `browsers` family images matching the Node.js and Chromium versions in Electron.** The `browsers` image will be used for CI and the `base` will be used for any new `included` family images.
|
||||
- The latest version of Firefox should also be included.
|
||||
- See [`cypress-docker-images`](https://github.com/cypress-io/cypress-docker-images/).
|
||||
- [ ] **Ensure that a matching Node.js version is enforced in the monorepo for local development and CI.** When Electron is upgraded, oftentimes, the bundled Node.js version that comes with Electron is updated as well. Because all unit and integration tests run in normal Node.js (not Electron's Node.js), it's important for this Node.js version to be synced with the monorepo. There are a few places where this needs to be done:
|
||||
- [ ] [`/.node-version`](../../.node-version) - used by `nvm` and other Node version managers
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"minimist": "1.2.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "15.5.1",
|
||||
"electron": "18.0.4",
|
||||
"electron-packager": "15.4.0",
|
||||
"execa": "4.1.0",
|
||||
"mocha": "3.5.3"
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import { detect } from '../detect'
|
||||
|
||||
detect(undefined, false).then((browsers) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(JSON.stringify(browsers, null, 2))
|
||||
})
|
||||
@@ -2,12 +2,8 @@ import { log } from '../log'
|
||||
import { notInstalledErr } from '../errors'
|
||||
import { utils } from '../utils'
|
||||
import * as fs from 'fs-extra'
|
||||
import * as os from 'os'
|
||||
import * as path from 'path'
|
||||
import * as plist from 'plist'
|
||||
import * as semver from 'semver'
|
||||
import type { FoundBrowser } from '../types'
|
||||
import * as findSystemNode from '@packages/server/lib/util/find_system_node'
|
||||
|
||||
/** parses Info.plist file from given application and returns a property */
|
||||
export function parsePlist (p: string, property: string): Promise<string> {
|
||||
@@ -105,20 +101,3 @@ export function findApp ({ appName, executable, appId, versionProperty }: FindAp
|
||||
|
||||
return tryMdFind().catch(tryFullApplicationFind)
|
||||
}
|
||||
|
||||
export function needsDarwinWorkaround (): boolean {
|
||||
return os.platform() === 'darwin' && semver.gte(os.release(), '20.0.0')
|
||||
}
|
||||
|
||||
export async function darwinDetectionWorkaround (): Promise<FoundBrowser[]> {
|
||||
const nodePath = await findSystemNode.findNodeInFullPath()
|
||||
let args = ['./detection-workaround.js']
|
||||
|
||||
if (process.env.CYPRESS_INTERNAL_ENV === 'development') {
|
||||
args = ['-r', '@packages/ts/register.js', './detection-workaround.ts']
|
||||
}
|
||||
|
||||
const { stdout } = await utils.execa(nodePath, args, { cwd: __dirname })
|
||||
|
||||
return JSON.parse(stdout)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import _, { compact, extend, find } from 'lodash'
|
||||
import os from 'os'
|
||||
import { browsers } from './browsers'
|
||||
import * as darwinHelper from './darwin'
|
||||
import { needsDarwinWorkaround, darwinDetectionWorkaround } from './darwin/util'
|
||||
import { notDetectedAtPathErr } from './errors'
|
||||
import * as linuxHelper from './linux'
|
||||
import { log } from './log'
|
||||
@@ -141,44 +140,13 @@ function checkOneBrowser (browser: Browser): Promise<boolean | HasVersion> {
|
||||
}
|
||||
|
||||
/** returns list of detected browsers */
|
||||
export const detect = (goalBrowsers?: Browser[], useDarwinWorkaround = true): Bluebird<FoundBrowser[]> => {
|
||||
export const detect = (goalBrowsers?: Browser[]): Bluebird<FoundBrowser[]> => {
|
||||
// we can detect same browser under different aliases
|
||||
// tell them apart by the name and the version property
|
||||
if (!goalBrowsers) {
|
||||
goalBrowsers = browsers
|
||||
}
|
||||
|
||||
// BigSur (darwin 20.x) and Electron 12+ cause huge performance issues when
|
||||
// spawning child processes, which is the way we find browsers via execa.
|
||||
// The performance cost is multiplied by the number of binary variants of
|
||||
// each browser plus any fallback lookups we do.
|
||||
// The workaround gets around this by breaking out of the bundled Electron
|
||||
// Node.js and using the user's Node.js if possible. It only pays the cost
|
||||
// of spawning a single child process instead of multiple. If this fails,
|
||||
// we fall back to to the slower, default method
|
||||
// https://github.com/cypress-io/cypress/issues/17773
|
||||
if (useDarwinWorkaround && needsDarwinWorkaround()) {
|
||||
log('using darwin detection workaround')
|
||||
if (log.enabled) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.time('time taken detecting browsers (darwin workaround)')
|
||||
}
|
||||
|
||||
return Bluebird.resolve(darwinDetectionWorkaround())
|
||||
.catch((err) => {
|
||||
log('darwin workaround failed, falling back to normal detection')
|
||||
log(err.stack)
|
||||
|
||||
return detect(goalBrowsers, false)
|
||||
})
|
||||
.finally(() => {
|
||||
if (log.enabled) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.timeEnd('time taken detecting browsers (darwin workaround)')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const removeDuplicates = (val) => {
|
||||
return _.uniqBy(val, (browser: FoundBrowser) => {
|
||||
return `${browser.name}-${browser.version}`
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
"fs-extra": "9.1.0",
|
||||
"lodash": "^4.17.21",
|
||||
"plist": "3.0.5",
|
||||
"semver": "7.3.5",
|
||||
"which": "2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -7,7 +7,6 @@ import { utils } from '../../lib/utils'
|
||||
import sinon, { SinonStub } from 'sinon'
|
||||
import os from 'os'
|
||||
import { log } from '../log'
|
||||
import * as darwinUtil from '../../lib/darwin/util'
|
||||
|
||||
const isWindows = () => {
|
||||
return os.platform() === 'win32'
|
||||
@@ -169,25 +168,4 @@ describe('browser detection', () => {
|
||||
.and.contain('Firefox newer than or equal to 86')
|
||||
})
|
||||
})
|
||||
|
||||
// https://github.com/cypress-io/cypress/issues/17773
|
||||
context('darwin performance workaround', () => {
|
||||
let browsers
|
||||
|
||||
beforeEach(() => {
|
||||
sinon.stub(os, 'platform').returns('darwin')
|
||||
sinon.stub(os, 'release').returns('20.0.0')
|
||||
|
||||
browsers = []
|
||||
|
||||
sinon.stub(darwinUtil, 'darwinDetectionWorkaround').resolves(browsers)
|
||||
})
|
||||
|
||||
it('uses workaround when on darwin 20.0.0+', async () => {
|
||||
const result = await detect()
|
||||
|
||||
expect(darwinUtil.darwinDetectionWorkaround).to.be.called
|
||||
expect(result).to.equal(browsers)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@ Cypress encountered an error while parsing the argument: --env
|
||||
|
||||
You passed: nonono
|
||||
|
||||
The error was: Cannot read property 'split' of undefined
|
||||
The error was: Cannot read properties of undefined (reading 'split')
|
||||
`
|
||||
|
||||
exports['invalid reporter options error'] = `
|
||||
@@ -11,7 +11,7 @@ Cypress encountered an error while parsing the argument: --reporterOptions
|
||||
|
||||
You passed: abc
|
||||
|
||||
The error was: Cannot read property 'split' of undefined
|
||||
The error was: Cannot read properties of undefined (reading 'split')
|
||||
`
|
||||
|
||||
exports['invalid config error'] = `
|
||||
@@ -19,7 +19,7 @@ Cypress encountered an error while parsing the argument: --config
|
||||
|
||||
You passed: xyz
|
||||
|
||||
The error was: Cannot read property 'split' of undefined
|
||||
The error was: Cannot read properties of undefined (reading 'split')
|
||||
`
|
||||
|
||||
exports['invalid spec error'] = `
|
||||
|
||||
@@ -282,7 +282,7 @@ Cypress encountered an error while parsing the argument: --config
|
||||
|
||||
You passed: xyz
|
||||
|
||||
The error was: Cannot read property 'split' of undefined
|
||||
The error was: Cannot read properties of undefined (reading 'split')
|
||||
`
|
||||
|
||||
exports['could not parse env error'] = `
|
||||
@@ -290,7 +290,7 @@ Cypress encountered an error while parsing the argument: --env
|
||||
|
||||
You passed: a123
|
||||
|
||||
The error was: Cannot read property 'split' of undefined
|
||||
The error was: Cannot read properties of undefined (reading 'split')
|
||||
`
|
||||
|
||||
exports['could not parse reporter options error'] = `
|
||||
@@ -298,7 +298,7 @@ Cypress encountered an error while parsing the argument: --reporterOptions
|
||||
|
||||
You passed: nonono
|
||||
|
||||
The error was: Cannot read property 'split' of undefined
|
||||
The error was: Cannot read properties of undefined (reading 'split')
|
||||
`
|
||||
|
||||
exports['INVALID_CONFIG_OPTION'] = `
|
||||
|
||||
@@ -82,6 +82,9 @@ const defaultPreferences = {
|
||||
'browser.startup.homepage_override.mstone': 'ignore',
|
||||
// Start with a blank page about:blank
|
||||
'browser.startup.page': 0,
|
||||
// Disable notification banners related to session restoration.
|
||||
// Any presented banners can result in incorrectly sized screenshots.
|
||||
'browser.startup.couldRestoreSession.count': 0,
|
||||
|
||||
// Do not allow background tabs to be zombified on Android: otherwise for
|
||||
// tests that open additional tabs: the test harness tab itself might get
|
||||
|
||||
Vendored
+1
-1
@@ -44,7 +44,7 @@ import { Url } from 'url'
|
||||
}
|
||||
|
||||
interface OutgoingMessage {
|
||||
destroy(error?: Error): void
|
||||
destroy(error?: Error): this
|
||||
}
|
||||
|
||||
export const CRLF: string
|
||||
|
||||
@@ -56,7 +56,8 @@
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"noErrorTruncation": true,
|
||||
"experimentalDecorators": true
|
||||
"experimentalDecorators": true,
|
||||
"skipLibCheck": true
|
||||
// "noResolve": true
|
||||
},
|
||||
"exclude": [
|
||||
|
||||
@@ -3,7 +3,7 @@ set e+x
|
||||
|
||||
echo "This script should be run from cypress's root"
|
||||
|
||||
name=cypress/browsers:node16.5.0-chrome94-ff93
|
||||
name=cypress/browsers:node16.13.2-chrome100-ff98
|
||||
echo "Pulling CI container $name"
|
||||
|
||||
docker pull $name
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
@@ -15,7 +15,7 @@ describe('e2e binary node versions', () => {
|
||||
[
|
||||
'cypress/base:12',
|
||||
'cypress/base:14',
|
||||
'cypress/base:16.5.0',
|
||||
'cypress/base:16.13.2',
|
||||
'cypress/base:17.3.0',
|
||||
].forEach(smokeTestDockerImage)
|
||||
})
|
||||
|
||||
@@ -8717,12 +8717,12 @@
|
||||
"@types/node" "*"
|
||||
form-data "^3.0.0"
|
||||
|
||||
"@types/node@*", "@types/node@>= 8", "@types/node@>=10.0.0":
|
||||
version "15.0.1"
|
||||
resolved "https://registry.npmjs.org/@types/node/-/node-15.0.1.tgz#ef34dea0881028d11398be5bf4e856743e3dc35a"
|
||||
integrity sha512-TMkXt0Ck1y0KKsGr9gJtWGjttxlZnnvDtphxUOSd0bfaR6Q1jle+sPvrzNR1urqYTWMinoKvjKfXUGsumaO1PA==
|
||||
"@types/node@*", "@types/node@>= 8", "@types/node@>=10.0.0", "@types/node@^16.11.26":
|
||||
version "16.11.26"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.26.tgz#63d204d136c9916fb4dcd1b50f9740fe86884e47"
|
||||
integrity sha512-GZ7bu5A6+4DtG7q9GsoHXy3ALcgeIHP4NnL0Vv2wu0uUB/yQex26v0tf6/na1mm0+bS9Uw+0DFex7aaKr2qawQ==
|
||||
|
||||
"@types/node@14.14.31", "@types/node@^14.0.10", "@types/node@^14.14.31", "@types/node@^14.6.2":
|
||||
"@types/node@14.14.31", "@types/node@^14.0.10", "@types/node@^14.14.31":
|
||||
version "14.14.31"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.31.tgz#72286bd33d137aa0d152d47ec7c1762563d34055"
|
||||
integrity sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==
|
||||
@@ -14830,7 +14830,7 @@ core-js-pure@3.21.0, core-js-pure@^3.0.0, core-js-pure@^3.8.2:
|
||||
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.21.0.tgz#819adc8dfb808205ce25b51d50591becd615db7e"
|
||||
integrity sha512-VaJUunCZLnxuDbo1rNOzwbet9E1K9joiXS5+DQMPtgxd24wfsZbJZMMfQLGYMlCUvSxLfsRUUhoOR2x28mFfeg==
|
||||
|
||||
core-js@3.12.1:
|
||||
core-js@3.12.1, core-js@^3.0.1, core-js@^3.0.4, core-js@^3.4.1, core-js@^3.5.0, core-js@^3.6.5, core-js@^3.8.2:
|
||||
version "3.12.1"
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.12.1.tgz#6b5af4ff55616c08a44d386f1f510917ff204112"
|
||||
integrity sha512-Ne9DKPHTObRuB09Dru5AjwKjY4cJHVGu+y5f7coGn1E9Grkc3p2iBwE9AI/nJzsE29mQF7oq+mhYYRqOMFN1Bw==
|
||||
@@ -14850,11 +14850,6 @@ core-js@^2.4.0:
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec"
|
||||
integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==
|
||||
|
||||
core-js@^3.0.1, core-js@^3.0.4, core-js@^3.4.1, core-js@^3.5.0, core-js@^3.6.5, core-js@^3.8.2:
|
||||
version "3.21.0"
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.21.0.tgz#f479dbfc3dffb035a0827602dd056839a774aa71"
|
||||
integrity sha512-YUdI3fFu4TF/2WykQ2xzSiTQdldLB4KVuL9WeAy5XONZYt5Cun/fpQvctoKbCgvPhmzADeesTk/j2Rdx77AcKQ==
|
||||
|
||||
core-util-is@1.0.2, core-util-is@^1.0.2, core-util-is@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
@@ -17199,13 +17194,13 @@ electron-to-chromium@^1.3.247, electron-to-chromium@^1.3.378, electron-to-chromi
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz#857e310ca00f0b75da4e1db6ff0e073cc4a91ddf"
|
||||
integrity sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg==
|
||||
|
||||
electron@15.5.1:
|
||||
version "15.5.1"
|
||||
resolved "https://registry.yarnpkg.com/electron/-/electron-15.5.1.tgz#6c2a7080dfbe4f8571098ce0dc230101b7e0c3f4"
|
||||
integrity sha512-V3tOikVM7tGK4n5+MkLN+v73h0tndDeaQXy8kjkHj5NFIgQPwKD9S8XjQOBa+Cm5l3xbQrUsN5X6OmYS2WfPlg==
|
||||
electron@18.0.4:
|
||||
version "18.0.4"
|
||||
resolved "https://registry.yarnpkg.com/electron/-/electron-18.0.4.tgz#7b9b094db32805d4a7826d9f7a1b376d9d7b9f86"
|
||||
integrity sha512-xfsozNpFr3WzeM1EFlw2qqiqXbCrgQNBJJMlcC4/DUYVpkF8364SZenX7FFFA42NmwXiOEahkvvho/u7UrAcGg==
|
||||
dependencies:
|
||||
"@electron/get" "^1.13.0"
|
||||
"@types/node" "^14.6.2"
|
||||
"@types/node" "^16.11.26"
|
||||
extract-zip "^1.0.3"
|
||||
|
||||
element-resize-detector@^1.2.2:
|
||||
@@ -31316,7 +31311,7 @@ pretty-error@^2.0.2, pretty-error@^2.1.1:
|
||||
|
||||
pretty-format@26.4.0, pretty-format@^24.9.0, pretty-format@^26.6.2:
|
||||
version "26.4.0"
|
||||
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.4.0.tgz#c08073f531429e9e5024049446f42ecc9f933a3b"
|
||||
resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.0.tgz#c08073f531429e9e5024049446f42ecc9f933a3b"
|
||||
integrity sha512-mEEwwpCseqrUtuMbrJG4b824877pM5xald3AkilJ47Po2YLr97/siejYQHqj2oDQBeJNbu+Q0qUuekJ8F0NAPg==
|
||||
dependencies:
|
||||
"@jest/types" "^26.3.0"
|
||||
|
||||
Reference in New Issue
Block a user