question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress spec window not showing in experiment webkit, resulting in blank page

See original GitHub issue

Current behavior

I have an existing cypress test suite which runs fine in Chrome and Electron, i have experimented with webkit , when the cypress open command runs and selected with Webkit, it resulting to blank page.

playwright-webkit added with command : yarn add --dev playwright-webkit

Engine: node : v18.0.0 yarn : 1.22.18

Specification : β€œcypress”: β€œ~10.11.0” β€œplaywright-webkit”: β€œ~1.28.0”

OS: macOS : v12.6

Cypress Open

image

image

Cypress Run

Cypress started in fd-sb-aw mode [0] [0] ==================================================================================================== [0] [0] (Run Starting) [0] [0] β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” [0] β”‚ Cypress: 10.11.0 β”‚ [0] β”‚ Browser: WebKit 16 (headless) β”‚ [0] β”‚ Node Version: v18.0.0 (/opt/homebrew/Cellar/node/18.0.0/bin/node) β”‚ [0] β”‚ Specs: 71 found (…) β”‚ [0] β”‚ Searched: /…//*.js β”‚ [0] β”‚ Experiments: experimentalInteractiveRunEvents=true,experimentalWebKitSupport=true β”‚ [0] β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ [0] [0] [0] ──────────────────────────────────────────────────────────────────────────────────────────────────── [0]
[0] Running: fd-sb-aw/account/sso_recovery.spec.js (1 of 71) [0] [0] Your project has set the configuration option: chromeWebSecurity to false. [0] [0] This option will not have an effect in Webkit. Tests that rely on web security being disabled will not run as expected. [0] [0] Timed out waiting for the browser to connect. Retrying…

Desired behavior

Like Chrome and Electron, it should load the identified spec in webkit

Test code to reproduce

Engine: node : v18.0.0 yarn : 1.22.18

Specification : β€œcypress”: β€œ~10.11.0” β€œplaywright-webkit”: β€œ~1.28.0”

OS: macOS : v12.6

Cypress Version

10.11.0

Node version

v18.0.0

Operating System

12.6

Debug Logs

No response

Other

No response

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
tbiethmancommented, Dec 6, 2022

Hi @manoj-fd, I started investigating this a bit and had a quick question off the jump. Looking at your example index.js:

module.exports = (on, config) => {
    
    Object.assign(config, {
        baseUrl: 'https://localhost:3001',
    })

    return config
}

Are you actually serving that route over https? I ask because I was able reproduce the blank webkit based on the prior posts, but I saw an error in the WebKit console that pointed out that my local server wasn’t actually serving over https:

Screen Shot 2022-12-06 at 12 58 37 PM

Changing the baseUrl to use http corrected this, as that is how my local server was actually serving it.

Screen Shot 2022-12-06 at 1 35 42 PM

I also ask because you mention that your config works in Chrome and Electron. Those browsers (as well as Firefox) are more graceful when it comes to the protocol mismatch and will show that the connection is not secured in the url bar rather than fail, which could explain the differences in behavior you’re seeing:

Screen Shot 2022-12-06 at 1 00 25 PM

So I’m just curious if this lines up with what you’re seeing locally, and if using http rather than https corrects your immediate issues launching WebKit. If so, there’s definitely work to be done with Cypress to actually surface these errors in the UI. If not, we’ll have to do a bit more digging.

0reactions
vladlearnscommented, Dec 28, 2022

For me, the issue was in playwright-webkit v1.29.0. Downgrading it to v1.28.0 fixed the issue @manoj-fd image

edit: make sure you removed the node_modules and package-lock.json

Read more comments on GitHub >

github_iconTop Results From Across the Web

Launching Browsers | Cypress Documentation
Cypress has experimental support for WebKit, Safari's browser engine. ... Electron will no longer display in the list of available browsers.
Read more >
Visit The Blank Page Between Cypress Tests - Gleb Bahmutov
A good solution to clearly separate the tests and stop any application callbacks is to visit a "neutral" blank page. Unfortunately, using the...
Read more >
cypress-io/cypress - Gitter
I'm trying to wrap my head around to support running through all specs covering ... 18.04 XVFB has a weird behavior where it...
Read more >
Execute Cypress Test Cases in WebKit(Safari)
From Above Screen Click on E2E Testing below screen is open. In the below screen we can see the WebKit browser as an...
Read more >
Playwright End To End Testing Tutorial: A Complete Guide
TypeScript supports types, and JavaScript does not. Let's now check a little piece of code: JavaScript:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found