cypress-io / cypress

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

Opening baseUrl in Webkit results in blank page #24175

Open michallbanas opened 2 years ago

michallbanas commented 2 years ago

Current behavior

When baseUrl is not localhost, but regular website eg. https://www.michalbanas.dev, I get only blank page when using webkit (open mode), and this error An SSL error has occurred and a secure connection to the server cannot be made in headless mode. I've been facing this issue since experiment support for Webkit was released. It works good for other browsers.

CleanShot 2022-10-07 at 11 37 51

Desired behavior

Possibility to use webkit in cypress with any url.

Test code to reproduce

Example project:

https://github.com/michallbanas/cypress-webkit-blankPage

Cypress Version

10.9.0

Node version

18.7.0

Operating System

macOS 12.6

Debug Logs

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        10.9.0                                                                         │
  │ Browser:        WebKit 16 (headless)                                                           │
  │ Node Version:   v18.7.0 (/Users/michalbanas/.nvm/versions/node/v18.7.0/bin/node)               │
  │ Specs:          1 found (test.cy.js)                                                           │
  │ Searched:       cypress/e2e/**/*.cy.{js,jsx,ts,tsx}                                            │
  │ Experiments:    experimentalWebKitSupport=true                                                 │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

────────────────────────────────────────────────────────────────────────────────────────────────────

  Running:  test.cy.js                                                                      (1 of 1)
page.goto: An SSL error has occurred and a secure connection to the server cannot be made.
=========================== logs ===========================
navigating to "https://michalbanas.dev/__/#/specs/runner?file=cypress/e2e/test.cy.js", waiting until "load"
============================================================
page.goto: An SSL error has occurred and a secure connection to the server cannot be made.
=========================== logs ===========================
navigating to "https://michalbanas.dev/__/#/specs/runner?file=cypress/e2e/test.cy.js", waiting until "load"
============================================================
    at WebKitAutomation.reset (/Users/michalbanas/Library/Caches/Cypress/10.9.0/Cypress.app/Contents/Resources/app/packages/server/lib/browsers/webkit-automation.js:134:37)
    at Function.create (/Users/michalbanas/Library/Caches/Cypress/10.9.0/Cypress.app/Contents/Resources/app/packages/server/lib/browsers/webkit-automation.js:108:9)
    at Object.open (/Users/michalbanas/Library/Caches/Cypress/10.9.0/Cypress.app/Contents/Resources/app/packages/server/lib/browsers/webkit.js:84:20)
    at Object.open (/Users/michalbanas/Library/Caches/Cypress/10.9.0/Cypress.app/Contents/Resources/app/packages/server/lib/browsers/index.js:109:27)
    at OpenProject.relaunchBrowser (/Users/michalbanas/Library/Caches/Cypress/10.9.0/Cypress.app/Contents/Resources/app/packages/server/lib/open_project.js:152:20)

Other

Hope I provided everything needed, it's my first issue here 🙂

a-kotova commented 1 year ago

Getting a similar error in headless & browser mode Apple M1 macOS Monterey 12.2.1 Cypress 10.11.0 Node 16.14.2

image
AtofStryker commented 1 year ago

possibly related to https://github.com/microsoft/playwright/issues/9466

AtofStryker commented 1 year ago

@a-kotova what version of playwright-webkit are you using? Have you tried upgrading Cypress to 12.8.1?

AtofStryker commented 1 year ago

Looks to still be an issue on 12.8.1 with playwright-webkit@1.31.2