Open alexsch01 opened 19 hours ago
$ npx cypress run
DevTools listening on ws://127.0.0.1:57100/devtools/browser/d909cab7-fff6-45a2-8123-d318d726b2db ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.15.0 │ │ Browser: Electron 118 (headless) │ │ Node Version: v18.13.0 (C:\Program Files\nodejs\node.exe) │ │ Specs: 1 found (spec.cy.js) │ │ Searched: cypress/e2e/**/*.cy.{js,jsx,ts,tsx} │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: spec.cy.js (1 of 1) 720 1280 √ (41ms) 1 passing (55ms) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: false │ │ Duration: 0 seconds │ │ Spec Ran: spec.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ √ spec.cy.js 57ms 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ √ All specs passed! 57ms 1 1 - - -
DevTools listening on ws://127.0.0.1:57100/devtools/browser/d909cab7-fff6-45a2-8123-d318d726b2db ==================================================================================================== (Run Starting) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 13.15.0 │ │ Browser: Electron 118 (headless) │ │ Node Version: v18.13.0 (C:\Program Files\nodejs\node.exe) │ │ Specs: 1 found (spec.cy.js) │ │ Searched: cypress/e2e/**/*.cy.{js,jsx,ts,tsx} │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── Running: spec.cy.js (1 of 1) 1080 1920 √ (41ms) 1 passing (55ms) (Results) ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Tests: 1 │ │ Passing: 1 │ │ Failing: 0 │ │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ │ Video: false │ │ Duration: 0 seconds │ │ Spec Ran: spec.cy.js │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ==================================================================================================== (Run Finished) Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ √ spec.cy.js 57ms 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ √ All specs passed! 57ms 1 1 - - -
cypress.config.js
const { defineConfig } = require('cypress'); module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { on('task', { log(args) { console.log(...args) return null; }, }); }, }, viewportWidth: 1920, viewportHeight: 1080, });
cypress/e2e/console.js
class console { log(...args) { cy.task('log', args) } }; export default new console;
cypress/e2e/spec.js
import console from './console' it('', () => { console.log(window.outerHeight, window.outerWidth) })
13.15.1
v20.18.0
Windows 10.0.19045
No response
related: https://github.com/cypress-io/cypress/issues/6210#issuecomment-583269127
Current behavior
Desired behavior
Test code to reproduce
cypress.config.js
cypress/e2e/console.js
cypress/e2e/spec.js
Cypress Version
13.15.1
Node version
v20.18.0
Operating System
Windows 10.0.19045
Debug Logs
No response
Other
No response