Make WordPress Core

Changeset 62411 for trunk


Ignore:
Timestamp:
05/22/2026 08:22:56 PM (5 months ago)
Author:
johnbillion
Message:

Build/Test Tools: Switch from Puppeteer to Playwright for the QUnit test runner.

This brings the QUnit tests inline with the e2e and performance tests that switched to Playwright in #59517.

This removes the puppeteer dependency, but puppeteer-core remains a transitive dependency due to wp-scripts and lighthouse.

See #64894

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/reusable-javascript-tests.yml

    r62404 r62411  
    5656        run: npm ci
    5757
    58       # Older branches using outdated versions of Puppeteer fail on newer versions of the `ubuntu-24` image.
     58      # Branches prior to 6.1 using outdated versions of Puppeteer fail on newer versions of the `ubuntu-24` image.
    5959      # This disables AppArmor in order to work around those failures.
    6060      #
  • trunk/Gruntfile.js

    r62258 r62411  
    116116                        'imagemin',
    117117                        'jshint',
    118                         'qunit',
    119118                        'uglify',
    120119                        'watch'
    … …  
    956955                                        'tests/qunit/**/*.js',
    957956                                        '!tests/qunit/vendor/*',
    958                                         '!tests/qunit/editor/**'
     957                                        '!tests/qunit/qunit.js',
     958                                        '!tests/qunit/playwright.config.js'
    959959                                ],
    960960                                options: grunt.file.readJSON( 'tests/qunit/.jshintrc' )
    … …  
    10591059                                }
    10601060                        }
    1061                 },
    1062                 qunit: {
    1063                         files: [
    1064                                 'tests/qunit/**/*.html',
    1065                                 '!tests/qunit/editor/**'
    1066                         ]
    10671061                },
    10681062                phpunit: {
    … …  
    15981592                        test: {
    15991593                                files: [
    1600                                         'tests/qunit/**',
    1601                                         '!tests/qunit/editor/**'
     1594                                        'tests/qunit/**'
    16021595                                ],
    16031596                                tasks: ['qunit']
    … …  
    22212214        });
    22222215
     2216        grunt.registerTask( 'qunit', 'Runs QUnit tests.', function() {
     2217                var done = this.async();
     2218                grunt.util.spawn( {
     2219                        cmd: 'npx',
     2220                        args: [ 'playwright', 'test', '--config', 'tests/qunit/playwright.config.js' ],
     2221                        opts: { stdio: 'inherit' }
     2222                }, function( error, result, code ) {
     2223                        if ( code !== 0 ) {
     2224                                grunt.fail.warn( 'QUnit tests failed.' );
     2225                        }
     2226                        done();
     2227                } );
     2228        } );
     2229
    22232230        grunt.registerTask( 'qunit:compiled', 'Runs QUnit tests on compiled as well as uncompiled scripts.',
    22242231                ['build', 'copy:qunit', 'qunit']
  • trunk/package-lock.json

    r62372 r62411  
    6666                                "grunt-contrib-imagemin": "~4.0.0",
    6767                                "grunt-contrib-jshint": "3.2.0",
    68                                 "grunt-contrib-qunit": "~10.1.1",
    6968                                "grunt-contrib-uglify": "~5.2.2",
    7069                                "grunt-contrib-watch": "~1.1.0",
    … …  
    45614560                        "dev": true
    45624561                },
    4563                 "node_modules/@puppeteer/browsers": {
    4564                         "version": "2.3.0",
    4565                         "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.3.0.tgz",
    4566                         "integrity": "sha512-ioXoq9gPxkss4MYhD+SFaU9p1IHFUX0ILAWFPyjGaBdjLsYAlZw6j1iLA0N/m12uVHLFDfSYNF7EQccjinIMDA==",
    4567                         "dev": true,
    4568                         "license": "Apache-2.0",
    4569                         "dependencies": {
    4570                                 "debug": "^4.3.5",
    4571                                 "extract-zip": "^2.0.1",
    4572                                 "progress": "^2.0.3",
    4573                                 "proxy-agent": "^6.4.0",
    4574                                 "semver": "^7.6.3",
    4575                                 "tar-fs": "^3.0.6",
    4576                                 "unbzip2-stream": "^1.4.3",
    4577                                 "yargs": "^17.7.2"
    4578                         },
    4579                         "bin": {
    4580                                 "browsers": "lib/cjs/main-cli.js"
    4581                         },
    4582                         "engines": {
    4583                                 "node": ">=18"
    4584                         }
    4585                 },
    45864562                "node_modules/@rtsao/scc": {
    45874563                        "version": "1.1.0",
    … …  
    1061710593                        }
    1061810594                },
    10619                 "node_modules/chromium-bidi": {
    10620                         "version": "0.6.3",
    10621                         "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.6.3.tgz",
    10622                         "integrity": "sha512-qXlsCmpCZJAnoTYI83Iu6EdYQpMYdVkCfq08KDh2pmlVqK5t5IA9mGs4/LwCwp4fqisSOMXZxP3HIh8w8aRn0A==",
    10623                         "dev": true,
    10624                         "license": "Apache-2.0",
    10625                         "dependencies": {
    10626                                 "mitt": "3.0.1",
    10627                                 "urlpattern-polyfill": "10.0.0",
    10628                                 "zod": "3.23.8"
    10629                         },
    10630                         "peerDependencies": {
    10631                                 "devtools-protocol": "*"
    10632                         }
    10633                 },
    1063410595                "node_modules/ci-info": {
    1063510596                        "version": "3.9.0",
    … …  
    1700316964                        }
    1700416965                },
    17005                 "node_modules/grunt-contrib-qunit": {
    17006                         "version": "10.1.1",
    17007                         "resolved": "https://registry.npmjs.org/grunt-contrib-qunit/-/grunt-contrib-qunit-10.1.1.tgz",
    17008                         "integrity": "sha512-qSzY/aWl4xn8dQc2eAwKrXNB0171WHgb4aA3ZdKkN88csxS3tCD3Eh8ljfsscFAKIKZkhjierRgQypep/aV4NA==",
    17009                         "dev": true,
    17010                         "license": "MIT",
    17011                         "dependencies": {
    17012                                 "eventemitter2": "^6.4.9",
    17013                                 "puppeteer": "^22.0.0"
    17014                         },
    17015                         "engines": {
    17016                                 "node": ">=18"
    17017                         }
    17018                 },
    17019                 "node_modules/grunt-contrib-qunit/node_modules/eventemitter2": {
    17020                         "version": "6.4.9",
    17021                         "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.9.tgz",
    17022                         "integrity": "sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==",
    17023                         "dev": true
    17024                 },
    1702516966                "node_modules/grunt-contrib-uglify": {
    1702616967                        "version": "5.2.2",
    … …  
    2753827479                        }
    2753927480                },
    27540                 "node_modules/puppeteer": {
    27541                         "version": "22.15.0",
    27542                         "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-22.15.0.tgz",
    27543                         "integrity": "sha512-XjCY1SiSEi1T7iSYuxS82ft85kwDJUS7wj1Z0eGVXKdtr5g4xnVcbjwxhq5xBnpK/E7x1VZZoJDxpjAOasHT4Q==",
    27544                         "deprecated": "< 24.15.0 is no longer supported",
    27545                         "dev": true,
    27546                         "hasInstallScript": true,
    27547                         "license": "Apache-2.0",
    27548                         "dependencies": {
    27549                                 "@puppeteer/browsers": "2.3.0",
    27550                                 "cosmiconfig": "^9.0.0",
    27551                                 "devtools-protocol": "0.0.1312386",
    27552                                 "puppeteer-core": "22.15.0"
    27553                         },
    27554                         "bin": {
    27555                                 "puppeteer": "lib/esm/puppeteer/node/cli.js"
    27556                         },
    27557                         "engines": {
    27558                                 "node": ">=18"
    27559                         }
    27560                 },
    2756127481                "node_modules/puppeteer-core": {
    2756227482                        "version": "23.11.1",
    … …  
    2761827538                },
    2761927539                "node_modules/puppeteer-core/node_modules/ws": {
    27620                         "version": "8.19.0",
    27621                         "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz",
    27622                         "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==",
    27623                         "dev": true,
    27624                         "license": "MIT",
    27625                         "engines": {
    27626                                 "node": ">=10.0.0"
    27627                         },
    27628                         "peerDependencies": {
    27629                                 "bufferutil": "^4.0.1",
    27630                                 "utf-8-validate": ">=5.0.2"
    27631                         },
    27632                         "peerDependenciesMeta": {
    27633                                 "bufferutil": {
    27634                                         "optional": true
    27635                                 },
    27636                                 "utf-8-validate": {
    27637                                         "optional": true
    27638                                 }
    27639                         }
    27640                 },
    27641                 "node_modules/puppeteer/node_modules/argparse": {
    27642                         "version": "2.0.1",
    27643                         "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
    27644                         "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
    27645                         "dev": true
    27646                 },
    27647                 "node_modules/puppeteer/node_modules/cosmiconfig": {
    27648                         "version": "9.0.1",
    27649                         "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.1.tgz",
    27650                         "integrity": "sha512-hr4ihw+DBqcvrsEDioRO31Z17x71pUYoNe/4h6Z0wB72p7MU7/9gH8Q3s12NFhHPfYBBOV3qyfUxmr/Yn3shnQ==",
    27651                         "dev": true,
    27652                         "license": "MIT",
    27653                         "dependencies": {
    27654                                 "env-paths": "^2.2.1",
    27655                                 "import-fresh": "^3.3.0",
    27656                                 "js-yaml": "^4.1.0",
    27657                                 "parse-json": "^5.2.0"
    27658                         },
    27659                         "engines": {
    27660                                 "node": ">=14"
    27661                         },
    27662                         "funding": {
    27663                                 "url": "https://github.com/sponsors/d-fischer"
    27664                         },
    27665                         "peerDependencies": {
    27666                                 "typescript": ">=4.9.5"
    27667                         },
    27668                         "peerDependenciesMeta": {
    27669                                 "typescript": {
    27670                                         "optional": true
    27671                                 }
    27672                         }
    27673                 },
    27674                 "node_modules/puppeteer/node_modules/js-yaml": {
    27675                         "version": "4.1.1",
    27676                         "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
    27677                         "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
    27678                         "dev": true,
    27679                         "license": "MIT",
    27680                         "dependencies": {
    27681                                 "argparse": "^2.0.1"
    27682                         },
    27683                         "bin": {
    27684                                 "js-yaml": "bin/js-yaml.js"
    27685                         }
    27686                 },
    27687                 "node_modules/puppeteer/node_modules/puppeteer-core": {
    27688                         "version": "22.15.0",
    27689                         "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.15.0.tgz",
    27690                         "integrity": "sha512-cHArnywCiAAVXa3t4GGL2vttNxh7GqXtIYGym99egkNJ3oG//wL9LkvO4WE8W1TJe95t1F1ocu9X4xWaGsOKOA==",
    27691                         "dev": true,
    27692                         "license": "Apache-2.0",
    27693                         "dependencies": {
    27694                                 "@puppeteer/browsers": "2.3.0",
    27695                                 "chromium-bidi": "0.6.3",
    27696                                 "debug": "^4.3.6",
    27697                                 "devtools-protocol": "0.0.1312386",
    27698                                 "ws": "^8.18.0"
    27699                         },
    27700                         "engines": {
    27701                                 "node": ">=18"
    27702                         }
    27703                 },
    27704                 "node_modules/puppeteer/node_modules/ws": {
    2770527540                        "version": "8.19.0",
    2770627541                        "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz",
    … …  
    3250932344                        }
    3251032345                },
    32511                 "node_modules/urlpattern-polyfill": {
    32512                         "version": "10.0.0",
    32513                         "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz",
    32514                         "integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==",
    32515                         "dev": true,
    32516                         "license": "MIT"
    32517                 },
    3251832346                "node_modules/use": {
    3251932347                        "version": "3.1.1",
  • trunk/package.json

    r62380 r62411  
    5454                "grunt-contrib-imagemin": "~4.0.0",
    5555                "grunt-contrib-jshint": "3.2.0",
    56                 "grunt-contrib-qunit": "~10.1.1",
    5756                "grunt-contrib-uglify": "~5.2.2",
    5857                "grunt-contrib-watch": "~1.1.0",
Note: See TracChangeset for help on using the changeset viewer.