Skip to content

Commit 213afde

Browse files
authored
test: adding stub backend log false (#27129)
1 parent de42cdb commit 213afde

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

packages/driver/cypress/e2e/commands/exec.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('src/cy/commands/exec', () => {
99
}, () => {
1010
beforeEach(() => {
1111
// call through normally on everything
12-
cy.stub(Cypress, 'backend').callThrough()
12+
cy.stub(Cypress, 'backend').log(false).callThrough()
1313
})
1414

1515
it('sends privileged exec to backend with the right options', () => {

packages/driver/cypress/e2e/commands/files.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const okResponse = {
1010
describe('src/cy/commands/files', () => {
1111
beforeEach(() => {
1212
// call through normally on everything
13-
cy.stub(Cypress, 'backend').callThrough()
13+
cy.stub(Cypress, 'backend').log(false).callThrough()
1414
})
1515

1616
describe('#readFile', () => {
@@ -261,7 +261,7 @@ describe('src/cy/commands/files', () => {
261261
cy.on('fail', (err) => {
262262
const { fileLog } = this
263263

264-
assertLogLength(this.logs, 2)
264+
assertLogLength(this.logs, 1)
265265
expect(fileLog.get('error')).to.eq(err)
266266
expect(fileLog.get('state')).to.eq('failed')
267267
expect(err.message).to.eq(stripIndent`\

packages/driver/cypress/e2e/commands/fixtures.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('src/cy/commands/fixtures', () => {
1313
context('#fixture', () => {
1414
beforeEach(() => {
1515
// call through normally on everything
16-
cy.stub(Cypress, 'backend').callThrough()
16+
cy.stub(Cypress, 'backend').log(false).callThrough()
1717
})
1818

1919
it('triggers \'fixture\' on Cypress', () => {

packages/driver/cypress/e2e/commands/navigation.cy.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ describe('src/cy/commands/navigation', () => {
926926
done()
927927
}
928928

929-
cy.stub(Cypress, 'backend')
929+
cy.stub(Cypress, 'backend').log(false)
930930
.withArgs('resolve:url')
931931
.resolves({
932932
isOkStatusCode: true,
@@ -957,7 +957,7 @@ describe('src/cy/commands/navigation', () => {
957957
.withArgs('http://localhost:4200/foo?bar=baz#/tests/integration/foo_spec.js')
958958
.callsFake(fn)
959959

960-
cy.stub(Cypress, 'backend')
960+
cy.stub(Cypress, 'backend').log(false)
961961
.withArgs('resolve:url')
962962
.resolves({
963963
isOkStatusCode: true,
@@ -1123,7 +1123,7 @@ describe('src/cy/commands/navigation', () => {
11231123
})
11241124

11251125
it('displays file attributes as consoleProps', () => {
1126-
cy.stub(Cypress, 'backend')
1126+
cy.stub(Cypress, 'backend').log(false)
11271127
.withArgs('resolve:url')
11281128
.resolves({
11291129
isOkStatusCode: true,
@@ -1147,7 +1147,7 @@ describe('src/cy/commands/navigation', () => {
11471147
})
11481148

11491149
it('displays http attributes as consoleProps', () => {
1150-
cy.stub(Cypress, 'backend')
1150+
cy.stub(Cypress, 'backend').log(false)
11511151
.withArgs('resolve:url')
11521152
.resolves({
11531153
isOkStatusCode: true,
@@ -1170,7 +1170,7 @@ describe('src/cy/commands/navigation', () => {
11701170
})
11711171

11721172
it('displays originalUrl http attributes as consoleProps', () => {
1173-
cy.stub(Cypress, 'backend')
1173+
cy.stub(Cypress, 'backend').log(false)
11741174
.withArgs('resolve:url')
11751175
.resolves({
11761176
isOkStatusCode: true,
@@ -1194,7 +1194,7 @@ describe('src/cy/commands/navigation', () => {
11941194
})
11951195

11961196
it('indicates redirects in the message', () => {
1197-
cy.stub(Cypress, 'backend')
1197+
cy.stub(Cypress, 'backend').log(false)
11981198
.withArgs('resolve:url')
11991199
.resolves({
12001200
isOkStatusCode: true,
@@ -1281,7 +1281,7 @@ describe('src/cy/commands/navigation', () => {
12811281
})
12821282

12831283
it('sets error command state', function (done) {
1284-
cy.stub(Cypress, 'backend')
1284+
cy.stub(Cypress, 'backend').log(false)
12851285
.withArgs('resolve:url')
12861286
.rejects(new Error)
12871287

@@ -1298,7 +1298,7 @@ describe('src/cy/commands/navigation', () => {
12981298
})
12991299

13001300
it('logs once on error', function (done) {
1301-
cy.stub(Cypress, 'backend')
1301+
cy.stub(Cypress, 'backend').log(false)
13021302
.withArgs('resolve:url')
13031303
.rejects(new Error)
13041304

@@ -1338,7 +1338,7 @@ describe('src/cy/commands/navigation', () => {
13381338
})
13391339
}
13401340

1341-
cy.stub(Cypress, 'backend')
1341+
cy.stub(Cypress, 'backend').log(false)
13421342
.withArgs('resolve:url')
13431343
.callsFake(fn)
13441344

@@ -1442,7 +1442,7 @@ describe('src/cy/commands/navigation', () => {
14421442
// dont log else we create an endless loop!
14431443
const emit = cy.spy(Cypress, 'emit').log(false)
14441444

1445-
cy.stub(Cypress, 'backend')
1445+
cy.stub(Cypress, 'backend').log(false)
14461446
.withArgs('resolve:url')
14471447
.rejects(err1)
14481448

@@ -1491,7 +1491,7 @@ describe('src/cy/commands/navigation', () => {
14911491

14921492
obj.url = obj.originalUrl
14931493

1494-
cy.stub(Cypress, 'backend')
1494+
cy.stub(Cypress, 'backend').log(false)
14951495
.withArgs('resolve:url')
14961496
.resolves(obj)
14971497

@@ -1540,7 +1540,7 @@ describe('src/cy/commands/navigation', () => {
15401540

15411541
obj.url = obj.originalUrl
15421542

1543-
cy.stub(Cypress, 'backend')
1543+
cy.stub(Cypress, 'backend').log(false)
15441544
.withArgs('resolve:url')
15451545
.resolves(obj)
15461546

@@ -1590,7 +1590,7 @@ describe('src/cy/commands/navigation', () => {
15901590

15911591
obj.url = obj.originalUrl
15921592

1593-
cy.stub(Cypress, 'backend')
1593+
cy.stub(Cypress, 'backend').log(false)
15941594
.withArgs('resolve:url', 'https://google.com/foo')
15951595
.resolves(obj)
15961596

@@ -1639,7 +1639,7 @@ describe('src/cy/commands/navigation', () => {
16391639

16401640
obj.url = obj.originalUrl
16411641

1642-
cy.stub(Cypress, 'backend')
1642+
cy.stub(Cypress, 'backend').log(false)
16431643
.withArgs('resolve:url', 'https://google.com/foo')
16441644
.resolves(obj)
16451645

@@ -1733,7 +1733,7 @@ describe('src/cy/commands/navigation', () => {
17331733

17341734
obj.url = obj.originalUrl
17351735

1736-
cy.stub(Cypress, 'backend')
1736+
cy.stub(Cypress, 'backend').log(false)
17371737
.withArgs('resolve:url', 'https://google.com/foo')
17381738
.resolves(obj)
17391739

packages/driver/cypress/e2e/commands/request.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('src/cy/commands/request', () => {
99
responseTimeout: RESPONSE_TIMEOUT,
1010
}, () => {
1111
beforeEach(() => {
12-
cy.stub(Cypress, 'backend').callThrough()
12+
cy.stub(Cypress, 'backend').log(false).callThrough()
1313
})
1414

1515
describe('argument signature', () => {

packages/driver/cypress/e2e/commands/task.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('src/cy/commands/task', () => {
66
taskTimeout: 2500,
77
}, () => {
88
beforeEach(() => {
9-
cy.stub(Cypress, 'backend').callThrough()
9+
cy.stub(Cypress, 'backend').log(false).callThrough()
1010
})
1111

1212
it('sends privileged task to backend with the right options', () => {

packages/driver/cypress/e2e/e2e/origin/commands/files.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ context('cy.origin files', { browser: '!webkit' }, () => {
2828
cy.origin('http://www.foobar.com:3500', () => {
2929
const contents = JSON.stringify({ foo: 'bar' })
3030

31-
cy.stub(Cypress, 'backend').resolves({
31+
cy.stub(Cypress, 'backend').log(false).resolves({
3232
contents,
3333
filePath: 'foo.json',
3434
})
@@ -80,7 +80,7 @@ context('cy.origin files', { browser: '!webkit' }, () => {
8080
cy.origin('http://www.foobar.com:3500', () => {
8181
const contents = JSON.stringify({ foo: 'bar' })
8282

83-
cy.stub(Cypress, 'backend').resolves({
83+
cy.stub(Cypress, 'backend').log(false).resolves({
8484
contents,
8585
filePath: 'foo.json',
8686
})

packages/driver/cypress/e2e/e2e/origin/patches.cy.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('src/cross-origin/patches', { browser: '!webkit', defaultCommandTimeout
6363
describe('from the AUT', () => {
6464
beforeEach(() => {
6565
cy.intercept('/test-request').as('testRequest')
66-
cy.stub(Cypress, 'backend').callThrough()
66+
cy.stub(Cypress, 'backend').log(false).callThrough()
6767

6868
cy.visit('/fixtures/primary-origin.html')
6969
cy.get('a[data-cy="xhr-fetch-requests"]').click()
@@ -184,7 +184,7 @@ describe('src/cross-origin/patches', { browser: '!webkit', defaultCommandTimeout
184184
describe('from the spec bridge', () => {
185185
beforeEach(() => {
186186
cy.intercept('/test-request').as('testRequest')
187-
cy.stub(Cypress, 'backend').callThrough()
187+
cy.stub(Cypress, 'backend').log(false).callThrough()
188188

189189
cy.visit('/fixtures/primary-origin.html')
190190
cy.get('a[data-cy="xhr-fetch-requests"]').click()
@@ -338,7 +338,7 @@ describe('src/cross-origin/patches', { browser: '!webkit', defaultCommandTimeout
338338
// manually remove the spec bridge iframe to ensure Cypress.state('window') is not already set
339339
window.top?.document.getElementById('Spec\ Bridge:\ foobar.com')?.remove()
340340

341-
cy.stub(Cypress, 'backend').callThrough()
341+
cy.stub(Cypress, 'backend').log(false).callThrough()
342342

343343
cy.visit('/fixtures/primary-origin.html')
344344
cy.get('a[data-cy="xhr-fetch-requests-onload"]').click()
@@ -353,7 +353,7 @@ describe('src/cross-origin/patches', { browser: '!webkit', defaultCommandTimeout
353353
})
354354

355355
it('does not patch fetch in the spec window or the AUT if the AUT is on the primary', () => {
356-
cy.stub(Cypress, 'backend').callThrough()
356+
cy.stub(Cypress, 'backend').log(false).callThrough()
357357
cy.visit('fixtures/xhr-fetch-requests.html')
358358

359359
cy.window().then((win) => {
@@ -386,7 +386,7 @@ describe('src/cross-origin/patches', { browser: '!webkit', defaultCommandTimeout
386386
describe('from the AUT', () => {
387387
beforeEach(() => {
388388
cy.intercept('/test-request').as('testRequest')
389-
cy.stub(Cypress, 'backend').callThrough()
389+
cy.stub(Cypress, 'backend').log(false).callThrough()
390390

391391
cy.visit('/fixtures/primary-origin.html')
392392
cy.get('a[data-cy="xhr-fetch-requests"]').click()
@@ -460,9 +460,9 @@ describe('src/cross-origin/patches', { browser: '!webkit', defaultCommandTimeout
460460
describe('from the spec bridge', () => {
461461
beforeEach(() => {
462462
cy.intercept('/test-request').as('testRequest')
463-
cy.stub(Cypress, 'backend').callThrough()
463+
cy.stub(Cypress, 'backend').log(false).callThrough()
464464
cy.origin('http://www.foobar.com:3500', () => {
465-
cy.stub(Cypress, 'backend').callThrough()
465+
cy.stub(Cypress, 'backend').log(false).callThrough()
466466
})
467467

468468
cy.visit('/fixtures/primary-origin.html')
@@ -566,7 +566,7 @@ describe('src/cross-origin/patches', { browser: '!webkit', defaultCommandTimeout
566566
// manually remove the spec bridge iframe to ensure Cypress.state('window') is not already set
567567
window.top?.document.getElementById('Spec\ Bridge:\ foobar.com')?.remove()
568568

569-
cy.stub(Cypress, 'backend').callThrough()
569+
cy.stub(Cypress, 'backend').log(false).callThrough()
570570

571571
cy.visit('/fixtures/primary-origin.html')
572572
cy.get('a[data-cy="xhr-fetch-requests-onload"]').click()
@@ -581,7 +581,7 @@ describe('src/cross-origin/patches', { browser: '!webkit', defaultCommandTimeout
581581
})
582582

583583
it('does not patch xmlHttpRequest in the spec window or the AUT if the AUT is on the primary', () => {
584-
cy.stub(Cypress, 'backend').callThrough()
584+
cy.stub(Cypress, 'backend').log(false).callThrough()
585585
cy.visit('fixtures/xhr-fetch-requests.html')
586586

587587
cy.window().then((win) => {

0 commit comments

Comments
 (0)