From 9aac81b2cab875e613c0c35e0c26347b372b8af7 Mon Sep 17 00:00:00 2001 From: Zach Bloomquist Date: Mon, 5 Dec 2022 23:32:48 -0500 Subject: [PATCH] remove outdated (as of cy 12) tests --- .../cypress/e2e/cypress/proxy-logging.cy.ts | 104 ------------------ 1 file changed, 104 deletions(-) diff --git a/packages/driver/cypress/e2e/cypress/proxy-logging.cy.ts b/packages/driver/cypress/e2e/cypress/proxy-logging.cy.ts index 29878eab0ad9..c90269b61e2e 100644 --- a/packages/driver/cypress/e2e/cypress/proxy-logging.cy.ts +++ b/packages/driver/cypress/e2e/cypress/proxy-logging.cy.ts @@ -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[] = []