Skip to content

Commit

Permalink
remove outdated (as of cy 12) tests
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Dec 6, 2022
1 parent bd64fe6 commit 9aac81b
Showing 1 changed file with 0 additions and 104 deletions.
104 changes: 0 additions & 104 deletions packages/driver/cypress/e2e/cypress/proxy-logging.cy.ts
Expand Up @@ -106,110 +106,6 @@ describe('Proxy Logging', () => {
})
})

// @see https://github.com/cypress-io/cypress/issues/18757 and https://github.com/cypress-io/cypress/issues/17656
// TODO: fix flaky test https://github.com/cypress-io/cypress/issues/23250
it.skip('xhr log has response body/status code when xhr response is logged first', {
// TODO: unskip in Electron: https://cypress-io.atlassian.net/browse/UNIFY-1753
browser: '!electron',
}, (done) => {
cy.visit('/fixtures/empty.html')

cy.window()
.then({ timeout: 10000 }, (win) => {
cy.on('log:changed', (log) => {
try {
expect(log.snapshots.map((v) => v.name)).to.deep.eq(['request', 'response'])
expect(log.consoleProps['Response Headers']).to.include({
'x-powered-by': 'Express',
})

expect(log.consoleProps['Response Body']).to.include('Cannot GET /some-url')
expect(log.consoleProps['Response Status Code']).to.eq(404)

expect(log.renderProps).to.include({
indicator: 'bad',
message: 'GET 404 /some-url',
})

expect(Object.keys(log.consoleProps)).to.deep.eq(
['Event', 'Resource Type', 'Method', 'URL', 'Request went to origin?', 'XHR', 'groups', 'Request Headers', 'Response Status Code', 'Response Headers', 'Response Body'],
)

done()
} catch (err) {
done(new Error(err))
}
})

const oldUpdateRequestWithResponse = Cypress.ProxyLogging.updateRequestWithResponse

cy.stub(Cypress.ProxyLogging, 'updateRequestWithResponse').log(false).callsFake(function (...args) {
setTimeout(() => {
oldUpdateRequestWithResponse.call(this, ...args)
}, 500)
})

const xhr = new win.XMLHttpRequest()

xhr.open('GET', '/some-url')
xhr.send()
})
})

// @see https://github.com/cypress-io/cypress/issues/18757 and https://github.com/cypress-io/cypress/issues/17656
// TODO: fix flaky test https://github.com/cypress-io/cypress/issues/23203
it.skip('xhr log has response body/status code when xhr response is logged second', (done) => {
cy.visit('/fixtures/empty.html')

cy.window()
.then({ timeout: 10000 }, (win) => {
cy.on('log:changed', (log) => {
try {
expect(log.snapshots.map((v) => v.name)).to.deep.eq(['request', 'response'])
expect(log.consoleProps['Response Headers']).to.include({
'x-powered-by': 'Express',
})

expect(log.consoleProps['Response Body']).to.include('Cannot GET /some-url')
expect(log.consoleProps['Response Status Code']).to.eq(404)

expect(log.renderProps).to.include({
indicator: 'bad',
message: 'GET 404 /some-url',
})

expect(Object.keys(log.consoleProps)).to.deep.eq(
['Event', 'Resource Type', 'Method', 'URL', 'Request went to origin?', 'XHR', 'groups', 'Request Headers', 'Response Status Code', 'Response Headers', 'Response Body'],
)

done()
} catch (err) {
done(new Error(err))
}
})

const xhr = new win.XMLHttpRequest()

const logIncomingRequest = Cypress.ProxyLogging.logIncomingRequest
const updateRequestWithResponse = Cypress.ProxyLogging.updateRequestWithResponse

// To simulate the xhr call landing second, we send updateRequestWithResponse immediately after
// the call is intercepted
cy.stub(Cypress.ProxyLogging, 'logIncomingRequest').log(false).callsFake(function (...args) {
logIncomingRequest.call(this, ...args)
updateRequestWithResponse.call(this, {
requestId: args[0].requestId,
status: 404,
})
})

cy.stub(Cypress.ProxyLogging, 'updateRequestWithResponse').log(false).callsFake(function () {})

xhr.open('GET', '/some-url')
xhr.send()
})
})

it('does not log an unintercepted non-xhr/fetch request', (done) => {
const img = new Image()
const logs: any[] = []
Expand Down

4 comments on commit 9aac81b

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9aac81b Dec 6, 2022

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.0.0/linux-arm64/retry-flake-9aac81b2cab875e613c0c35e0c26347b372b8af7/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9aac81b Dec 6, 2022

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.0.0/linux-x64/retry-flake-9aac81b2cab875e613c0c35e0c26347b372b8af7/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9aac81b Dec 6, 2022

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.0.0/darwin-x64/retry-flake-9aac81b2cab875e613c0c35e0c26347b372b8af7/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9aac81b Dec 6, 2022

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.0.0/win32-x64/retry-flake-9aac81b2cab875e613c0c35e0c26347b372b8af7/cypress.tgz

Please sign in to comment.