cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.51k stars 3.2k forks source link

DEBUG log error message incorrectly claims WebKit is enabled #30229

Open MikeMcC399 opened 2 months ago

MikeMcC399 commented 2 months ago

Current behavior

Although experimentalWebKitSupport is undefined and defaults to false DEBUG setting with cypress:server:browsers:utils logs an error

cypress:server:browsers:utils WebKit is enabled, but there was an error constructing the WebKit browser: { err: Error: Cannot find module 'playwright-webkit' Require stack: - /home/mike/.cache/Cypress/13.14.2/Cypress/resources/app/packages/server/lib/browsers/utils.ts at node:internal/modules/cjs/loader:1084:15 at Function._resolveFilename (node:electron/js2c/browser_init:2:116118) at resolve (node:internal/modules/cjs/helpers:127:19) at Function.resolve (evalmachine.:1:758945) at P (:2753:103503) at Object.I [as get] (:2753:104338) at W (:2844:92715) at Object.J (:2844:95421) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/mike/.cache/Cypress/13.14.2/Cypress/resources/app/packages/server/lib/browsers/utils.ts' ] } } +0ms

Desired behavior

If experimentalWebKitSupport is undefined or set to to false, there should be no WebKit browser error in the debug logs. This is a misleading message.

Test code to reproduce

Execute:

git clone https://github.com/cypress-io/github-action
cd github-action/examples/basic
npm ci
DEBUG=cypress:server:browsers:utils,cypress:config:browser npx cypress run

Cypress Version

13.14.2

Node version

v20.17.0 LTS

Operating System

Ubuntu 22.04.5 LTS

Debug Logs

experimentalWebKitSupport: false,

 ...

  cypress:config:browser validating configuration {} +3ms
  cypress:server:browsers:utils searching for browser { nameOrPath: 'electron', filter: { name: 'electron', channel: 'stable' }, knownBrowsers: [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '128.0.6613.137', path: 'google-chrome', minSupportedVersion: 64, majorVersion: '128' }, { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', version: '128.0.6613.119', path: 'chromium', profilePath: '/home/mike/snap/chromium/current', minSupportedVersion: 64, majorVersion: '128' }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', version: '130.0', path: 'firefox', profilePath: '/home/mike/snap/firefox/current', minSupportedVersion: 86, majorVersion: '130' }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', version: '128.0.2739.67', path: 'microsoft-edge', minSupportedVersion: 79, majorVersion: '128' }, { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '118.0.5993.159', path: '', majorVersion: 118 } ] } +319ms
  cypress:server:browsers:utils getBrowsers +17ms
  cypress:server:browsers:utils WebKit is enabled, but there was an error constructing the WebKit browser: { err: Error: Cannot find module 'playwright-webkit' Require stack: - /home/mike/.cache/Cypress/13.14.2/Cypress/resources/app/packages/server/lib/browsers/utils.ts     at node:internal/modules/cjs/loader:1084:15     at Function._resolveFilename (node:electron/js2c/browser_init:2:116118)     at resolve (node:internal/modules/cjs/helpers:127:19) at Function.resolve (evalmachine.<anonymous>:1:758945) at P (<embedded>:2753:103503) at Object.I [as get] (<embedded>:2753:104338) at W (<embedded>:2844:92715) at Object.J (<embedded>:2844:95421) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/mike/.cache/Cypress/13.14.2/Cypress/resources/app/packages/server/lib/browsers/utils.ts' ] } } +0ms

Other

No response

jennifer-shehane commented 2 months ago

@MikeMcC399 Yah this is not the best wording. I would just remove the 'Webkit is enabled, but ' part entirely

MikeMcC399 commented 2 months ago

@jennifer-shehane

I would just remove the 'Webkit is enabled, but ' part entirely

Changing the text would remove the inconsistency in the error message, however the bigger question is why it's trying to find the WebKit browser when WebKit is disabled.