Coder Social home page Coder Social logo

monalego's Introduction

MonaLego cypress version ci status renovate-app badge

Visual testing for HTML canvas drawing

monalego

Mona Lisa example

This Legra.js demo copied from from legra-monalisa.glitch.me/

MonaLego

The test in cypress/integration/mona-spec.js changes the brick size and saves the produced Lego image as a local file.

Related: Fast legoization

Smiley face

Read Canvas Visual Testing with Retries, see the test cypress/integration/smile-spec.js.

Visual canvas testing

Pixel match in the browser

Look at pixelmatch-spec.js where we compare the canvas image to itself after N milliseconds using pixelmatch library. This let's us retry until the canvas stabilizes and becomes static - which means the animation has finished.

Canvas becomes static

Watch the video Canvas image diffing in the browser using pixelmatch.

Bar chart

An animated Chart.js bar chart with multiple visual diffs against it. You can change the animation duration in public/bar.html, the test should still work.

Visual tests against animated bar chart

Watch the video for more details

Native screenshots

This repository is showing how to use Chrome debugger protocol to capture the browser screenshot natively in Chrome browsers. See the screenshot-spec.js test file.

monalego's People

Contributors

bahmutov avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

monalego's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.


Warning

Renovate failed to look up the following dependencies: Could not determine new digest for update (cdnjs package Chart.js/Chart.min.js).

Files affected: public/bar.html


Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/badges.yml
  • actions/checkout v4
  • stefanzweifel/git-auto-commit-action v5
.github/workflows/main.yml
  • actions/checkout v4
  • cypress-io/github-action v2
  • actions/upload-artifact v4
  • ubuntu 22.04
html
public/bar.html
  • Chart.js 2.9.4@sha512-d9xgZrVZpmmQlfonhQUvTR7lMPtO7NkZMkA0ABN3PHCbKA5nqylQ/yWlFAyY6hYgdF1Qh6nYiuADWwKB4C2WSw==
npm
package.json
  • cypress 9.7.0
  • cypress-recurse 1.35.3
  • odiff-bin 3.0.1
  • pixelmatch 5.3.0
  • pngjs 7.0.0
  • prettier 3.3.3
  • serve 12.0.1
  • start-server-and-test 2.0.5

  • Check this box to trigger a request for Renovate to run again on this repository

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.