As you can read in the official blog post, Cypress 10.8.0 has a new experimental feature named experimentalWebKitSupport, so Cypress users can test their web applications using WebKit, the same browser engine used in Safari. By running your existing Cypress tests in WebKit, you can feel confident that your web application is bug-free and works as intended for Safari users.
But, what is WebKit?
WebKit is the web browser engine used by Safari, Mail, App Store, and many other apps on macOS, iOS, and Linux.
WebKit is the open source web platform implementation used by Apple Safari and Epiphany
Playwright provides a WebKit build that can be download as a node package. Playwright WebKit works across all platforms (macOS, Linux, Windows), in both headless and headful modes.
Playwright's WebKit version matches the recent WebKit trunk build, before it is used in Apple Safari and other WebKit-based browsers. This gives a lot of lead time to react on the potential browser update issues.
You can dowload it here: Playwright-Webkit
Answer extracted from this interesting post at https://exchangetuts.com/
Stock browsers like Google Chrome, Apple Safari embed rendering engines (Chromium, WebKit) and add stuff on top of them. In particular, they add proprietary media codecs, inject browser extensions, etc. They also add surrounding interfaces such as bookmarks sync. But they reuse the underlying web platform implementation.
Chromium is the open source web platform implementation used by Google Chrome, Opera, Microsoft Edge and other browsers. It implements web specs, renders content, works with network, etc. Playwright uses a stock Chromium build that can be automated with the Playwright API for e2e testing.
For Google Chrome things are simple: Chromium is a safe target to test, modulo proprietary media codecs and DRM. You can point Playwright against stock Chrome Canary or Edge Canary to use proprietary media codecs.
When WebKit runs on macOS, it is a safe target to test Safari. WebKit on Linux and Windows differs from Apple Safari in the following ways:
- it uses a non-macOS network stack
- uses non-Core Animation to composite scene and produce image raster. This means that screenshots on Linux and Windows will not perfectly match screenshots from macOS.
In terms of the web platform, the same WebKit code will layout the page and run JavaScript—it will match how WebKit works in Safari.
To conclude, we consider the browsers provided by Playwright to be the best of what you can get for e2e testing.
- Open your cypress.config.js/ts and add the following property:
experimentalWebKitSupport: true,
- Install the playwright-webkit in your project
npm install --save-dev playwright-webkit
- You can specify the browser you need as a cli flag, as well:
--browser webkit
You can find the known issues in the official documentation: known-issues