cypress-io / cypress

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

IndexedDB not working on playwright-webkit #26106

Open sebastiencrevier opened 1 year ago

sebastiencrevier commented 1 year ago

Current behavior

We're building a PWA that stores images in IndexedDB for offline usage.

Right now, launching playwright-webkit in Cypress seems to be launching in non-persistent mode similar to Private Browsing, which makes IndexedDB unusable.

See: https://github.com/cypress-io/cypress/blob/ed0668e24c2ee6753bbd25ae467ce94ae5857741/packages/server/lib/browsers/webkit.ts#L92

According to playwright documentation, the browser needs to be launched with launchPersistentContext to support persistent storage.

Is there any plan to support persistent storage or a workaround for this?

Thanks!

Desired behavior

IndexedDB is working properly.

Test code to reproduce

Open an IndexedDB object store and try to read/write from it.

Cypress Version

12.7.0 playwright-webkit 1.31.2

Node version

v18.13.0

Operating System

Windows 10

Debug Logs

> An internal error was encountered in the Indexed Database server

Other

No response

AtofStryker commented 1 year ago

@sebastiencrevier Thank you for opening an issue. I wonder if we need to do something similar here kind of how we handle the user-data-dir in chrome. I am going to try to spike into this next week if I have time, but if you want to give it a try I would love to see what you come up with!