Giter VIP home page Giter VIP logo

cypress-playwright-webkit's Introduction

cypress-playwright-webkit

Cypress supports Playwright-Webkit

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

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-Webkit

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

What is the difference between testing on Safari vs 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

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.

WebKit

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.

How to implement this new experimental feature in your framework?

  1. Open your cypress.config.js/ts and add the following property:
        experimentalWebKitSupport: true,
  2. Install the playwright-webkit in your project
        npm install --save-dev playwright-webkit
  3. You can specify the browser you need as a cli flag, as well:
        --browser webkit

Known issues:

You can find the known issues in the official documentation: known-issues

Check all the details at:

ANDROID TESTING VIDEO

cypress-playwright-webkit's People

Contributors

joanesquivel avatar

Stargazers

 avatar  avatar Saymon Oliveira avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.