Skip to content

Commit 25c46a2

Browse files
authored
Merge pull request #18466 from cypress-io/merge-develop-2020-10-13
chore: merge in develop to unified-desktop-gui
2 parents 7d141de + 0b98d66 commit 25c46a2

File tree

14 files changed

+112
-12
lines changed

14 files changed

+112
-12
lines changed

browser-versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"chrome:beta": "95.0.4638.40",
3-
"chrome:stable": "94.0.4606.71"
3+
"chrome:stable": "94.0.4606.81"
44
}

npm/react/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# [@cypress/react-v5.10.1](https://github.com/cypress-io/cypress/compare/@cypress/react-v5.10.0...@cypress/react-v5.10.1) (2021-10-04)
2+
3+
4+
### Bug Fixes
5+
6+
* configure proper pages directory for next application ([#18009](https://github.com/cypress-io/cypress/issues/18009)) ([70c7c36](https://github.com/cypress-io/cypress/commit/70c7c3678180d5408c144fa37f94ba5f5f8ceeb8))
7+
* next trace error ([#18189](https://github.com/cypress-io/cypress/issues/18189)) ([db6f909](https://github.com/cypress-io/cypress/commit/db6f9096bd6668db1937d0e38d3928866f6cd5df))
8+
19
# [@cypress/react-v5.10.0](https://github.com/cypress-io/cypress/compare/@cypress/react-v5.9.4...@cypress/react-v5.10.0) (2021-09-10)
210

311

npm/vite-dev-server/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# [@cypress/vite-dev-server-v2.1.1](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.1.0...@cypress/vite-dev-server-v2.1.1) (2021-10-04)
2+
3+
4+
### Bug Fixes
5+
6+
* **vite-dev-server:** remove base and root from inlineVitConfig types ([#17180](https://github.com/cypress-io/cypress/issues/17180)) ([07e7d0e](https://github.com/cypress-io/cypress/commit/07e7d0ed252bf1a2bd3224f617e1fc2e64f19a06))
7+
* **vite-dev-server:** replace UserConfig with InlineConfig to allow correct `configFile` types ([#18167](https://github.com/cypress-io/cypress/issues/18167)) ([6e0c2c1](https://github.com/cypress-io/cypress/commit/6e0c2c1af81be750a74bad0528d52de45746a453))
8+
* **vite-dev-server:** windows `supportFile` + preserve optimize entries ([#18286](https://github.com/cypress-io/cypress/issues/18286)) ([ea2f6a4](https://github.com/cypress-io/cypress/commit/ea2f6a45c7057e51b2fc879ff70da75538fa1002))
9+
110
# [@cypress/vite-dev-server-v2.1.0](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v2.0.8...@cypress/vite-dev-server-v2.1.0) (2021-09-10)
211

312

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cypress",
3-
"version": "8.5.0",
3+
"version": "8.6.0",
44
"description": "Cypress.io end to end testing tool",
55
"private": true,
66
"scripts": {

packages/driver/cypress/integration/commands/debugging_spec.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,32 @@ describe('src/cy/commands/debugging', () => {
9898
expect(cy.state('onPaused')).to.be.null
9999
})
100100
})
101+
102+
it('can pause in run mode with --headed and --no-exit', function () {
103+
let didPause = false
104+
105+
Cypress.config('isInteractive', false)
106+
Cypress.config('browser').isHeaded = true
107+
Cypress.config('exit', false)
108+
109+
cy.once('paused', (name) => {
110+
cy.once('paused', (name) => {
111+
didPause = true
112+
113+
// resume the rest of the commands so this
114+
// test ends
115+
Cypress.emit('resume:all')
116+
})
117+
118+
Cypress.emit('resume:next')
119+
})
120+
121+
cy.pause().wrap({}).should('deep.eq', {}).then(function () {
122+
expect(didPause).to.be.true
123+
124+
// should no longer have onPaused
125+
expect(cy.state('onPaused')).to.be.null
126+
})
127+
})
101128
})
102129
})

packages/driver/src/cy/commands/debugging.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export default (Commands, Cypress, cy, state, config) => {
4747
// pause should indefinitely pause until the user
4848
// presses a key or clicks in the UI to continue
4949
pause (subject, options = {}) {
50-
// bail if we're headless
51-
if (!config('isInteractive')) {
50+
// bail if we're in run mode, unless --headed and --no-exit flags are passed
51+
if (!config('isInteractive') && (!config('browser').isHeaded || config('exit'))) {
5252
return subject
5353
}
5454

packages/runner-shared/src/logger.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export const logger = {
3232
// _.trim([]) returns '' but we want to log empty arrays, so account for that
3333
if (_.isString(value) && _.trim(value) === '') return
3434

35+
// Skip trim if we know value is an object
36+
if (typeof value !== 'object' && _.trim(value) === '' && !_.isArray(value)) return
37+
3538
this.log(`%c${key}`, 'font-weight: bold', value)
3639
})
3740
},
Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
11
const sinon = require('sinon')
22
const { logger } = require('./logger')
3+
import _ from 'lodash'
34

45
describe('logger', () => {
6+
let spyLog = sinon.spy(logger, 'log')
7+
8+
afterEach(() => {
9+
// reset after each unit test
10+
spyLog.resetHistory()
11+
})
12+
513
// https://github.com/cypress-io/cypress/issues/17542
614
it('cy.log() shows all arguments in each line when there are multiple args', () => {
7-
const spy = sinon.spy(logger, 'log')
8-
915
logger.logFormatted({ args: [1, 2, 3] })
1016

11-
expect(spy).to.have.been.calledWith(`%cArgs:`, 'font-weight: bold')
12-
expect(spy).to.have.been.calledWith(`%c [0]:`, 'font-weight: bold', 1)
13-
expect(spy).to.have.been.calledWith(`%c [1]:`, 'font-weight: bold', 2)
14-
expect(spy).to.have.been.calledWith(`%c [2]:`, 'font-weight: bold', 3)
17+
expect(spyLog).to.have.been.calledWith(`%cArgs:`, 'font-weight: bold')
18+
expect(spyLog).to.have.been.calledWith(`%c [0]:`, 'font-weight: bold', 1)
19+
expect(spyLog).to.have.been.calledWith(`%c [1]:`, 'font-weight: bold', 2)
20+
expect(spyLog).to.have.been.calledWith(`%c [2]:`, 'font-weight: bold', 3)
21+
})
22+
23+
describe('_logValues', () => {
24+
let spyTrim = sinon.spy(_, 'trim')
25+
26+
afterEach(() => {
27+
// reset after each unit test
28+
spyTrim.resetHistory()
29+
})
30+
31+
it('should not call trim', () => {
32+
logger._logValues({})
33+
logger._logValues({ test: {} })
34+
logger._logValues(null)
35+
logger._logValues(undefined)
36+
37+
expect(spyTrim.getCalls()).to.have.length(0)
38+
})
39+
40+
// The positive unit tests to capture if log has been called are already written in
41+
// the 'cy.log() shows all arguments in each line when there are multiple args' unit test.
1542
})
1643
})

packages/server/lib/controllers/runner.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const _serveNonProxiedError = (res: Response) => {
2222
})
2323
}
2424

25-
export interface ServeOptions extends Pick<InitializeRoutes, 'getSpec' | 'config' | 'getCurrentBrowser' | 'getRemoteState' | 'specsStore'> {
25+
export interface ServeOptions extends Pick<InitializeRoutes, 'getSpec' | 'config' | 'getCurrentBrowser' | 'getRemoteState' | 'specsStore' | 'exit'> {
2626
testingType: Cypress.TestingType
2727
}
2828

@@ -47,7 +47,7 @@ export const runner = {
4747
return _serveNonProxiedError(res)
4848
}
4949

50-
let { config, getRemoteState, getCurrentBrowser, getSpec, specsStore } = options
50+
let { config, getRemoteState, getCurrentBrowser, getSpec, specsStore, exit } = options
5151

5252
config = _.clone(config)
5353
// at any given point, rather than just arbitrarily modifying it.
@@ -72,6 +72,7 @@ export const runner = {
7272
config.spec = getSpec() ?? null
7373
config.specs = specsStore.specFiles
7474
config.browser = getCurrentBrowser()
75+
config.exit = exit ?? true
7576

7677
debug('serving runner index.html with config %o',
7778
_.pick(config, 'version', 'platform', 'arch', 'projectName'))

packages/server/lib/project-base.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type ReceivedCypressOptions =
4545
export interface Cfg extends ReceivedCypressOptions {
4646
projectRoot: string
4747
proxyServer?: Cypress.RuntimeConfigOptions['proxyUrl']
48+
exit?: boolean
4849
state?: {
4950
firstOpened?: number
5051
lastOpened?: number
@@ -206,6 +207,7 @@ export class ProjectBase<TServer extends Server> extends EE {
206207
const [port, warning] = await this._server.open(cfg, {
207208
getCurrentBrowser: () => this.browser,
208209
getSpec: () => this.spec,
210+
exit: this.options.args?.exit,
209211
onError: this.options.onError,
210212
onWarning: this.options.onWarning,
211213
shouldCorrelatePreRequests: this.shouldCorrelatePreRequests,

0 commit comments

Comments
 (0)