Skip to content

Commit

Permalink
test: adding stub backend log false (#27129)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschile committed Jul 6, 2023
1 parent de42cdb commit 213afde
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion packages/driver/cypress/e2e/commands/exec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('src/cy/commands/exec', () => {
}, () => {
beforeEach(() => {
// call through normally on everything
cy.stub(Cypress, 'backend').callThrough()
cy.stub(Cypress, 'backend').log(false).callThrough()
})

it('sends privileged exec to backend with the right options', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/driver/cypress/e2e/commands/files.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const okResponse = {
describe('src/cy/commands/files', () => {
beforeEach(() => {
// call through normally on everything
cy.stub(Cypress, 'backend').callThrough()
cy.stub(Cypress, 'backend').log(false).callThrough()
})

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

assertLogLength(this.logs, 2)
assertLogLength(this.logs, 1)
expect(fileLog.get('error')).to.eq(err)
expect(fileLog.get('state')).to.eq('failed')
expect(err.message).to.eq(stripIndent`\
Expand Down
2 changes: 1 addition & 1 deletion packages/driver/cypress/e2e/commands/fixtures.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('src/cy/commands/fixtures', () => {
context('#fixture', () => {
beforeEach(() => {
// call through normally on everything
cy.stub(Cypress, 'backend').callThrough()
cy.stub(Cypress, 'backend').log(false).callThrough()
})

it('triggers \'fixture\' on Cypress', () => {
Expand Down
30 changes: 15 additions & 15 deletions packages/driver/cypress/e2e/commands/navigation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ describe('src/cy/commands/navigation', () => {
done()
}

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

cy.stub(Cypress, 'backend')
cy.stub(Cypress, 'backend').log(false)
.withArgs('resolve:url')
.resolves({
isOkStatusCode: true,
Expand Down Expand Up @@ -1123,7 +1123,7 @@ describe('src/cy/commands/navigation', () => {
})

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

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

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

it('indicates redirects in the message', () => {
cy.stub(Cypress, 'backend')
cy.stub(Cypress, 'backend').log(false)
.withArgs('resolve:url')
.resolves({
isOkStatusCode: true,
Expand Down Expand Up @@ -1281,7 +1281,7 @@ describe('src/cy/commands/navigation', () => {
})

it('sets error command state', function (done) {
cy.stub(Cypress, 'backend')
cy.stub(Cypress, 'backend').log(false)
.withArgs('resolve:url')
.rejects(new Error)

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

it('logs once on error', function (done) {
cy.stub(Cypress, 'backend')
cy.stub(Cypress, 'backend').log(false)
.withArgs('resolve:url')
.rejects(new Error)

Expand Down Expand Up @@ -1338,7 +1338,7 @@ describe('src/cy/commands/navigation', () => {
})
}

cy.stub(Cypress, 'backend')
cy.stub(Cypress, 'backend').log(false)
.withArgs('resolve:url')
.callsFake(fn)

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

cy.stub(Cypress, 'backend')
cy.stub(Cypress, 'backend').log(false)
.withArgs('resolve:url')
.rejects(err1)

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

obj.url = obj.originalUrl

cy.stub(Cypress, 'backend')
cy.stub(Cypress, 'backend').log(false)
.withArgs('resolve:url')
.resolves(obj)

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

obj.url = obj.originalUrl

cy.stub(Cypress, 'backend')
cy.stub(Cypress, 'backend').log(false)
.withArgs('resolve:url')
.resolves(obj)

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

obj.url = obj.originalUrl

cy.stub(Cypress, 'backend')
cy.stub(Cypress, 'backend').log(false)
.withArgs('resolve:url', 'https://google.com/foo')
.resolves(obj)

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

obj.url = obj.originalUrl

cy.stub(Cypress, 'backend')
cy.stub(Cypress, 'backend').log(false)
.withArgs('resolve:url', 'https://google.com/foo')
.resolves(obj)

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

obj.url = obj.originalUrl

cy.stub(Cypress, 'backend')
cy.stub(Cypress, 'backend').log(false)
.withArgs('resolve:url', 'https://google.com/foo')
.resolves(obj)

Expand Down
2 changes: 1 addition & 1 deletion packages/driver/cypress/e2e/commands/request.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('src/cy/commands/request', () => {
responseTimeout: RESPONSE_TIMEOUT,
}, () => {
beforeEach(() => {
cy.stub(Cypress, 'backend').callThrough()
cy.stub(Cypress, 'backend').log(false).callThrough()
})

describe('argument signature', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/driver/cypress/e2e/commands/task.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('src/cy/commands/task', () => {
taskTimeout: 2500,
}, () => {
beforeEach(() => {
cy.stub(Cypress, 'backend').callThrough()
cy.stub(Cypress, 'backend').log(false).callThrough()
})

it('sends privileged task to backend with the right options', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/driver/cypress/e2e/e2e/origin/commands/files.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ context('cy.origin files', { browser: '!webkit' }, () => {
cy.origin('http://www.foobar.com:3500', () => {
const contents = JSON.stringify({ foo: 'bar' })

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

cy.stub(Cypress, 'backend').resolves({
cy.stub(Cypress, 'backend').log(false).resolves({
contents,
filePath: 'foo.json',
})
Expand Down
18 changes: 9 additions & 9 deletions packages/driver/cypress/e2e/e2e/origin/patches.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('src/cross-origin/patches', { browser: '!webkit', defaultCommandTimeout
describe('from the AUT', () => {
beforeEach(() => {
cy.intercept('/test-request').as('testRequest')
cy.stub(Cypress, 'backend').callThrough()
cy.stub(Cypress, 'backend').log(false).callThrough()

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

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

cy.stub(Cypress, 'backend').callThrough()
cy.stub(Cypress, 'backend').log(false).callThrough()

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

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

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

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

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

cy.stub(Cypress, 'backend').callThrough()
cy.stub(Cypress, 'backend').log(false).callThrough()

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

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

cy.window().then((win) => {
Expand Down

5 comments on commit 213afde

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 213afde Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.17.1/linux-arm64/develop-213afdefee9affebdb28fc7c7d2fd0ba6a098d39/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 213afde Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.17.1/linux-x64/develop-213afdefee9affebdb28fc7c7d2fd0ba6a098d39/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 213afde Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.17.1/darwin-x64/develop-213afdefee9affebdb28fc7c7d2fd0ba6a098d39/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 213afde Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.17.1/darwin-arm64/develop-213afdefee9affebdb28fc7c7d2fd0ba6a098d39/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 213afde Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.17.1/win32-x64/develop-213afdefee9affebdb28fc7c7d2fd0ba6a098d39/cypress.tgz

Please sign in to comment.