Skip to content

Commit 2d7c2c5

Browse files
authored
Merge branch 'develop' into zachw/angular-ct-source-root
2 parents 191e140 + 2062670 commit 2d7c2c5

File tree

55 files changed

+520
-234
lines changed

Some content is hidden

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

55 files changed

+520
-234
lines changed

cli/types/cypress.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ declare namespace Cypress {
362362

363363
/**
364364
* Utility functions for ensuring various properties about a subject.
365-
* @see https://on.cypress.io/custom-queries
365+
* @see https://on.cypress.io/api/custom-queries
366366
*/
367367
ensure: Ensure
368368

@@ -1613,7 +1613,7 @@ declare namespace Cypress {
16131613
/**
16141614
* Invoke a command synchronously, without using the command queue.
16151615
*
1616-
* @see https://on.cypress.io/custom-queries
1616+
* @see https://on.cypress.io/api/custom-queries
16171617
*/
16181618
now(name: string, ...args: any[]): Promise<any> | ((subject: any) => any)
16191619

guides/building-release-artifacts.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ The npm package requires a corresponding binary of the same version. In producti
3535

3636
You can build the Cypress binary locally by running `yarn binary-build`. You can use Linux to build the Cypress binary (just like it is in CI) by running `yarn binary-build` inside of `yarn docker`.
3737

38-
`yarn binary-zip` can be used to zip the built binary together.
38+
If you're on macOS and building locally, you'll need a code-signing certificate in your keychain, which you can get by following the [instructions on Apple's website](https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html#//apple_ref/doc/uid/TP40005929-CH4-SW30). Also, you'll also most likely want to skip notarization since it requires an Apple Developer Program account - set `SKIP_NOTARIZATION=1` when building locally to do this. [More info about code signing in CI](./code-signing.md).
39+
40+
`yarn binary-zip` can be used to zip the built binary together.

npm/grep/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [@cypress/grep-v3.1.2](https://github.com/cypress-io/cypress/compare/@cypress/grep-v3.1.1...@cypress/grep-v3.1.2) (2022-12-09)
2+
3+
4+
### Bug Fixes
5+
6+
* declare used babel dependencies ([#24842](https://github.com/cypress-io/cypress/issues/24842)) ([910f912](https://github.com/cypress-io/cypress/commit/910f912373bf857a196e2a0d1a73606e3ee199be))
7+
18
# [@cypress/grep-v3.1.1](https://github.com/cypress-io/cypress/compare/@cypress/grep-v3.1.0...@cypress/grep-v3.1.1) (2022-12-08)
29

310

npm/grep/cypress/e2e/unit.js

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe('utils', () => {
1414
context('parseTitleGrep', () => {
1515
it('grabs the positive title', () => {
1616
const parsed = parseTitleGrep('hello w')
17+
1718
expect(parsed).to.deep.equal({
1819
title: 'hello w',
1920
invert: false,
@@ -22,6 +23,7 @@ describe('utils', () => {
2223

2324
it('trims the string', () => {
2425
const parsed = parseTitleGrep(' hello w ')
26+
2527
expect(parsed).to.deep.equal({
2628
title: 'hello w',
2729
invert: false,
@@ -30,6 +32,7 @@ describe('utils', () => {
3032

3133
it('inverts the string', () => {
3234
const parsed = parseTitleGrep('-hello w')
35+
3336
expect(parsed).to.deep.equal({
3437
title: 'hello w',
3538
invert: true,
@@ -38,6 +41,7 @@ describe('utils', () => {
3841

3942
it('trims the inverted the string', () => {
4043
const parsed = parseTitleGrep(' -hello w ')
44+
4145
expect(parsed).to.deep.equal({
4246
title: 'hello w',
4347
invert: true,
@@ -46,13 +50,15 @@ describe('utils', () => {
4650

4751
it('returns null for undefined input', () => {
4852
const parsed = parseTitleGrep()
53+
4954
expect(parsed).to.equal(null)
5055
})
5156
})
5257

5358
context('parseFullTitleGrep', () => {
5459
it('returns list of title greps', () => {
5560
const parsed = parseFullTitleGrep('hello; one; -two')
61+
5662
expect(parsed).to.deep.equal([
5763
{ title: 'hello', invert: false },
5864
{ title: 'one', invert: false },
@@ -65,6 +71,7 @@ describe('utils', () => {
6571
it('parses AND tags', () => {
6672
// run only the tests with all 3 tags
6773
const parsed = parseTagsGrep('@tag1+@tag2+@tag3')
74+
6875
expect(parsed).to.deep.equal([
6976
// single OR part
7077
[
@@ -78,6 +85,7 @@ describe('utils', () => {
7885

7986
it('handles dashes in the tag', () => {
8087
const parsed = parseTagsGrep('@smoke+@screen-b')
88+
8189
expect(parsed).to.deep.equal([
8290
[
8391
{ tag: '@smoke', invert: false },
@@ -89,6 +97,7 @@ describe('utils', () => {
8997
it('parses OR tags spaces', () => {
9098
// run tests with tag1 OR tag2 or tag3
9199
const parsed = parseTagsGrep('@tag1 @tag2 @tag3')
100+
92101
expect(parsed).to.deep.equal([
93102
[{ tag: '@tag1', invert: false }],
94103
[{ tag: '@tag2', invert: false }],
@@ -99,6 +108,7 @@ describe('utils', () => {
99108
it('parses OR tags commas', () => {
100109
// run tests with tag1 OR tag2 or tag3
101110
const parsed = parseTagsGrep('@tag1,@tag2,@tag3')
111+
102112
expect(parsed).to.deep.equal([
103113
[{ tag: '@tag1', invert: false }],
104114
[{ tag: '@tag2', invert: false }],
@@ -108,11 +118,13 @@ describe('utils', () => {
108118

109119
it('parses inverted tag', () => {
110120
const parsed = parseTagsGrep('-@tag1')
121+
111122
expect(parsed).to.deep.equal([[{ tag: '@tag1', invert: true }]])
112123
})
113124

114125
it('parses tag1 but not tag2 with space', () => {
115126
const parsed = parseTagsGrep('@tag1 -@tag2')
127+
116128
expect(parsed).to.deep.equal([
117129
[{ tag: '@tag1', invert: false }],
118130
[{ tag: '@tag2', invert: true }],
@@ -121,6 +133,7 @@ describe('utils', () => {
121133

122134
it('forgives extra spaces', () => {
123135
const parsed = parseTagsGrep(' @tag1 -@tag2 ')
136+
124137
expect(parsed).to.deep.equal([
125138
[{ tag: '@tag1', invert: false }],
126139
[{ tag: '@tag2', invert: true }],
@@ -129,6 +142,7 @@ describe('utils', () => {
129142

130143
it('parses tag1 but not tag2 with comma', () => {
131144
const parsed = parseTagsGrep('@tag1,-@tag2')
145+
132146
expect(parsed).to.deep.equal([
133147
[{ tag: '@tag1', invert: false }],
134148
[{ tag: '@tag2', invert: true }],
@@ -137,15 +151,17 @@ describe('utils', () => {
137151

138152
it('filters out empty tags', () => {
139153
const parsed = parseTagsGrep(',, @tag1,-@tag2,, ,, ,')
154+
140155
expect(parsed).to.deep.equal([
141156
[{ tag: '@tag1', invert: false }],
142157
[{ tag: '@tag2', invert: true }],
143158
])
144159
})
145160

146-
// would need to change the tokenizer
161+
// TODO: would need to change the tokenizer
147162
it.skip('parses tag1 but not tag2', () => {
148163
const parsed = parseTagsGrep('@tag1-@tag2')
164+
149165
expect(parsed).to.deep.equal([
150166
[
151167
{ tag: '@tag1', invert: false },
@@ -156,8 +172,9 @@ describe('utils', () => {
156172

157173
it('allows all tags to be inverted', () => {
158174
const parsed = parseTagsGrep('--@tag1,--@tag2')
175+
159176
expect(parsed).to.deep.equal([
160-
[ { tag: '@tag1', invert: true }, { tag: '@tag2', invert: true } ]
177+
[{ tag: '@tag1', invert: true }, { tag: '@tag2', invert: true }],
161178
])
162179
})
163180
})
@@ -170,6 +187,7 @@ describe('utils', () => {
170187

171188
it('creates just the title grep', () => {
172189
const parsed = parseGrep('hello w')
190+
173191
expect(parsed).to.deep.equal({
174192
title: [
175193
{
@@ -183,6 +201,7 @@ describe('utils', () => {
183201

184202
it('creates object from the grep string only', () => {
185203
const parsed = parseGrep('hello w')
204+
186205
expect(parsed).to.deep.equal({
187206
title: [
188207
{
@@ -224,6 +243,7 @@ describe('utils', () => {
224243

225244
it('creates object from the grep string and tags', () => {
226245
const parsed = parseGrep('hello w', '@tag1+@tag2+@tag3')
246+
227247
expect(parsed).to.deep.equal({
228248
title: [
229249
{
@@ -251,6 +271,7 @@ describe('utils', () => {
251271
expect(
252272
shouldTestRun(parsed, ['@tag1', '@tag2', '@tag3', '@tag4']),
253273
).to.equal(true)
274+
254275
// title matches, but tags do not
255276
expect(shouldTestRun(parsed, 'hello w', ['@tag1', '@tag2'])).to.equal(
256277
false,
@@ -269,6 +290,7 @@ describe('utils', () => {
269290
// our parsing and decision logic computes the expected result
270291
const shouldIt = (used, tags, expected) => {
271292
const parsedTags = parseTagsGrep(used)
293+
272294
expect(
273295
shouldTestRunTags(parsedTags, tags),
274296
`"${used}" against "${tags}"`,
@@ -308,36 +330,42 @@ describe('utils', () => {
308330
// and apply the first argument in shouldTestRun
309331
const checkName = (grep, grepTags) => {
310332
const parsed = parseGrep(grep, grepTags)
333+
311334
expect(parsed).to.be.an('object')
312335

313336
return (testName, testTags = []) => {
314337
expect(testName, 'test title').to.be.a('string')
315338
expect(testTags, 'test tags').to.be.an('array')
339+
316340
return shouldTestRun(parsed, testName, testTags)
317341
}
318342
}
319343

320344
it('simple tag', () => {
321345
const parsed = parseGrep('@tag1')
346+
322347
expect(shouldTestRun(parsed, 'no tag1 here')).to.be.false
323348
expect(shouldTestRun(parsed, 'has @tag1 in the name')).to.be.true
324349
})
325350

326351
it('with invert title', () => {
327352
const t = checkName('-hello')
353+
328354
expect(t('no greetings')).to.be.true
329355
expect(t('has hello world')).to.be.false
330356
})
331357

332358
it('with invert option', () => {
333359
const t = checkName(null, '-@tag1')
360+
334361
expect(t('no tags here')).to.be.true
335362
expect(t('has tag1', ['@tag1'])).to.be.false
336363
expect(t('has other tags', ['@tag2'])).to.be.true
337364
})
338365

339366
it('with AND option', () => {
340367
const t = checkName('', '@tag1+@tag2')
368+
341369
expect(t('no tag1 here')).to.be.false
342370
expect(t('has only @tag1', ['@tag1'])).to.be.false
343371
expect(t('has only @tag2', ['@tag2'])).to.be.false
@@ -346,20 +374,23 @@ describe('utils', () => {
346374

347375
it('with OR option', () => {
348376
const t = checkName(null, '@tag1 @tag2')
377+
349378
expect(t('no tag1 here')).to.be.false
350379
expect(t('has only @tag1 in the name', ['@tag1'])).to.be.true
351380
expect(t('has only @tag2 in the name', ['@tag2'])).to.be.true
352381
expect(t('has @tag1 and @tag2 in the name', ['@tag1', '@tag2'])).to.be
353-
.true
382+
.true
354383
})
355384

356385
it('OR with AND option', () => {
357386
const t = checkName(null, '@tag1 @tag2+@tag3')
387+
358388
expect(t('no tag1 here')).to.be.false
359389
expect(t('has only @tag1 in the name', ['@tag1'])).to.be.true
360390
expect(t('has only @tag2 in the name', ['@tag2'])).to.be.false
361391
expect(t('has only @tag2 in the name and also @tag3', ['@tag2', '@tag3']))
362-
.to.be.true
392+
.to.be.true
393+
363394
expect(
364395
t('has @tag1 and @tag2 and @tag3 in the name', [
365396
'@tag1',
@@ -371,8 +402,9 @@ describe('utils', () => {
371402

372403
it('Multiple invert strings and a simple one', () => {
373404
const t = checkName('-name;-hey;number')
405+
374406
expect(t('number should only be matches without a n-a-m-e')).to.be.true
375-
expect(t("number can't be name")).to.be.false
407+
expect(t('number can\'t be name')).to.be.false
376408
expect(t('The man needs a name')).to.be.false
377409
expect(t('number hey name')).to.be.false
378410
expect(t('numbers hey name')).to.be.false
@@ -382,15 +414,17 @@ describe('utils', () => {
382414

383415
it('Only inverted strings', () => {
384416
const t = checkName('-name;-hey')
385-
expect(t("I'm matched")).to.be.true
386-
expect(t("hey! I'm not")).to.be.false
417+
418+
expect(t('I\'m matched')).to.be.true
419+
expect(t('hey! I\'m not')).to.be.false
387420
expect(t('My name is weird')).to.be.false
388421
})
389422
})
390423

391424
context('parseFullTitleGrep', () => {
392425
const shouldIt = (search, testName, expected) => {
393426
const parsed = parseFullTitleGrep(search)
427+
394428
expect(
395429
shouldTestRunTitle(parsed, testName),
396430
`"${search}" against title "${testName}"`,

npm/vite-dev-server/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [@cypress/vite-dev-server-v5.0.2](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v5.0.1...@cypress/vite-dev-server-v5.0.2) (2022-12-09)
2+
3+
4+
### Bug Fixes
5+
6+
* **vite-dev-server:** ensure assets are correctly reloaded ([#24965](https://github.com/cypress-io/cypress/issues/24965)) ([89c013f](https://github.com/cypress-io/cypress/commit/89c013fcedc2509850ec820f938d33f08f9cbb42))
7+
18
# [@cypress/vite-dev-server-v5.0.1](https://github.com/cypress-io/cypress/compare/@cypress/vite-dev-server-v5.0.0...@cypress/vite-dev-server-v5.0.1) (2022-12-08)
29

310

npm/webpack-preprocessor/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [@cypress/webpack-preprocessor-v5.15.7](https://github.com/cypress-io/cypress/compare/@cypress/webpack-preprocessor-v5.15.6...@cypress/webpack-preprocessor-v5.15.7) (2022-12-09)
2+
3+
4+
### Bug Fixes
5+
6+
* declare used babel dependencies ([#24842](https://github.com/cypress-io/cypress/issues/24842)) ([910f912](https://github.com/cypress-io/cypress/commit/910f912373bf857a196e2a0d1a73606e3ee199be))
7+
18
# [@cypress/webpack-preprocessor-v5.15.6](https://github.com/cypress-io/cypress/compare/@cypress/webpack-preprocessor-v5.15.5...@cypress/webpack-preprocessor-v5.15.6) (2022-12-02)
29

310

npm/webpack-preprocessor/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, ."
2222
},
2323
"dependencies": {
24-
"@babel/parser": "7.13.0",
24+
"@babel/core": "^7.0.1",
25+
"@babel/generator": "^7.17.9",
26+
"@babel/parser": "^7.13.0",
27+
"@babel/traverse": "^7.17.9",
2528
"bluebird": "3.7.1",
2629
"debug": "^4.3.2",
2730
"fs-extra": "^10.1.0",
@@ -32,7 +35,6 @@
3235
"webpack-virtual-modules": "^0.4.4"
3336
},
3437
"devDependencies": {
35-
"@babel/core": "^7.0.1",
3638
"@babel/plugin-proposal-nullish-coalescing-operator": "7.8.3",
3739
"@babel/preset-env": "^7.0.0",
3840
"@fellow/eslint-plugin-coffee": "0.4.13",

packages/app/cypress/e2e/cypress-in-cypress-component.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ describe('Cypress In Cypress CT', { viewportWidth: 1500, defaultCommandTimeout:
147147
expect(ctx.actions.browser.setActiveBrowserById).to.have.been.calledWith(browserId)
148148
expect(genId).to.eql('firefox-firefox-stable')
149149
expect(ctx.actions.project.launchProject).to.have.been.calledWith(
150-
ctx.coreData.currentTestingType, undefined, o.sinon.match(new RegExp('cypress\-in\-cypress\/src\/TestComponent\.spec\.jsx$')),
150+
ctx.coreData.currentTestingType, { shouldLaunchNewTab: false }, o.sinon.match(new RegExp('cypress\-in\-cypress\/src\/TestComponent\.spec\.jsx$')),
151151
)
152152
})
153153
})

packages/app/cypress/e2e/run-all-specs.cy.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ describe('run-all-specs', () => {
4545

4646
cy.waitForSpecToFinish({ passCount: 2 })
4747

48-
cy.withCtx((ctx, { specs }) => {
48+
cy.withCtx((ctx, { specs, RUN_ALL_SPECS_KEY }) => {
49+
expect(ctx.actions.project.launchProject).to.have.been.calledWith('e2e', { shouldLaunchNewTab: true }, RUN_ALL_SPECS_KEY)
4950
expect(ctx.project.runAllSpecs).to.include.members(specs.map((spec) => spec.relative))
50-
}, { specs: subDirectorySpecs })
51+
}, { specs: subDirectorySpecs, RUN_ALL_SPECS_KEY })
5152

5253
for (const spec of subDirectorySpecs) {
5354
cy.get('.runnable-title').contains(spec.name)
@@ -100,10 +101,9 @@ describe('run-all-specs', () => {
100101

101102
clickRunAllSpecs('all')
102103

103-
cy.withCtx((ctx, { specs, runAllSpecsKey }) => {
104-
expect(ctx.actions.project.launchProject).to.have.been.calledWith('e2e', undefined, runAllSpecsKey)
104+
cy.withCtx((ctx, { specs }) => {
105105
expect(ctx.project.runAllSpecs).to.include.members(specs.map((spec) => spec.relative))
106-
}, { specs: Object.values(ALL_SPECS), runAllSpecsKey: RUN_ALL_SPECS_KEY })
106+
}, { specs: Object.values(ALL_SPECS) })
107107

108108
cy.waitForSpecToFinish({ passCount: 6 })
109109

0 commit comments

Comments
 (0)