Make WordPress Core

Changeset 51989


Ignore:
Timestamp:
11/02/2021 09:03:10 PM (8 months ago)
Author:
hellofromTonya
Message:

Build/Test Tools: Introduce local visual regression testing.

Adds the ability to locally run visual regression testing for wp-admin pages via npm run test:visual. Snapshots are stored on contributors' local machines.

Note:
Wiring to the CI is not included. Why? The challenges for the CI are storage of the artifacts and unreliability of testing these across different environments.

This commit is a first step towards visual regression testing. Running it locally provides a learning opportunity which could help to craft how to build it into the automated CI process.

Props isabel_brison, andraganescu, azaozz, danfarrow, desrosj, hellofromTonya, justinahinon, netweb, talldanwp.
Fixes #49606.

Location:
trunk
Files:
8 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/.gitignore

    r51574 r51989  
    9191# Files for local environment config
    9292/docker-compose.override.yml
     93
     94# Visual regression test diffs
     95tests/visual-regression/specs/__image_snapshots__
  • trunk/package-lock.json

    r51974 r51989  
    1253612536            }
    1253712537        },
     12538        "glur": {
     12539            "version": "1.1.2",
     12540            "resolved": "https://registry.npmjs.org/glur/-/glur-1.1.2.tgz",
     12541            "integrity": "sha1-8g6jbbEDv8KSNDkh8fkeg8NGdok=",
     12542            "dev": true
     12543        },
    1253812544        "gonzales-pe": {
    1253912545            "version": "4.3.0",
     
    1560515611                        "is-number": "^7.0.0"
    1560615612                    }
     15613                }
     15614            }
     15615        },
     15616        "jest-image-snapshot": {
     15617            "version": "3.0.1",
     15618            "resolved": "https://registry.npmjs.org/jest-image-snapshot/-/jest-image-snapshot-3.0.1.tgz",
     15619            "integrity": "sha512-bW8eYxgAVyO8cNLlTt15wd5YiWvRfzQyNQ4K8FKHUEPasQADEZ5NzaWmnOpSdh3/NLYoH++TMp6o/rRVLpOIkQ==",
     15620            "dev": true,
     15621            "requires": {
     15622                "chalk": "^1.1.3",
     15623                "get-stdin": "^5.0.1",
     15624                "glur": "^1.1.2",
     15625                "lodash": "^4.17.4",
     15626                "mkdirp": "^0.5.1",
     15627                "pixelmatch": "^5.1.0",
     15628                "pngjs": "^3.4.0",
     15629                "rimraf": "^2.6.2"
     15630            },
     15631            "dependencies": {
     15632                "ansi-regex": {
     15633                    "version": "2.1.1",
     15634                    "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
     15635                    "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
     15636                    "dev": true
     15637                },
     15638                "ansi-styles": {
     15639                    "version": "2.2.1",
     15640                    "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
     15641                    "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
     15642                    "dev": true
     15643                },
     15644                "chalk": {
     15645                    "version": "1.1.3",
     15646                    "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
     15647                    "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
     15648                    "dev": true,
     15649                    "requires": {
     15650                        "ansi-styles": "^2.2.1",
     15651                        "escape-string-regexp": "^1.0.2",
     15652                        "has-ansi": "^2.0.0",
     15653                        "strip-ansi": "^3.0.0",
     15654                        "supports-color": "^2.0.0"
     15655                    }
     15656                },
     15657                "strip-ansi": {
     15658                    "version": "3.0.1",
     15659                    "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
     15660                    "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
     15661                    "dev": true,
     15662                    "requires": {
     15663                        "ansi-regex": "^2.0.0"
     15664                    }
     15665                },
     15666                "supports-color": {
     15667                    "version": "2.0.0",
     15668                    "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
     15669                    "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
     15670                    "dev": true
    1560715671                }
    1560815672            }
     
    1978619850            }
    1978719851        },
     19852        "pixelmatch": {
     19853            "version": "5.2.1",
     19854            "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-5.2.1.tgz",
     19855            "integrity": "sha512-WjcAdYSnKrrdDdqTcVEY7aB7UhhwjYQKYhHiBXdJef0MOaQeYpUdQ+iVyBLa5YBKS8MPVPPMX7rpOByISLpeEQ==",
     19856            "dev": true,
     19857            "requires": {
     19858                "pngjs": "^4.0.1"
     19859            },
     19860            "dependencies": {
     19861                "pngjs": {
     19862                    "version": "4.0.1",
     19863                    "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-4.0.1.tgz",
     19864                    "integrity": "sha512-rf5+2/ioHeQxR6IxuYNYGFytUyG3lma/WW1nsmjeHlWwtb2aByla6dkVc8pmJ9nplzkTA0q2xx7mMWrOTqT4Gg==",
     19865                    "dev": true
     19866                }
     19867            }
     19868        },
    1978819869        "pkg-dir": {
    1978919870            "version": "3.0.0",
     
    1985719938                "irregular-plurals": "^3.2.0"
    1985819939            }
     19940        },
     19941        "pngjs": {
     19942            "version": "3.4.0",
     19943            "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz",
     19944            "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==",
     19945            "dev": true
    1985919946        },
    1986019947        "polyfill-library": {
  • trunk/package.json

    r51974 r51989  
    6262        "ink-docstrap": "1.3.2",
    6363        "install-changed": "1.1.0",
     64        "jest-image-snapshot": "3.0.1",
    6465        "matchdep": "~2.0.0",
    6566        "prettier": "npm:wp-prettier@2.0.5",
     
    173174        "test:php": "node ./tools/local-env/scripts/docker.js run -T php composer update -W && node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit",
    174175        "test:e2e": "node ./tests/e2e/run-tests.js",
     176        "test:visual": "node ./tests/visual-regression/run-tests.js",
    175177        "wp-packages-update": "wp-scripts packages-update"
    176178    }
  • trunk/tests/e2e/config/bootstrap.js

    r51130 r51989  
    3333// The Jest timeout is increased because these tests are a bit slow
    3434jest.setTimeout( PUPPETEER_TIMEOUT || 100000 );
     35
    3536
    3637/**
Note: See TracChangeset for help on using the changeset viewer.