Make WordPress Core

Changeset 62411 for trunk/Gruntfile.js


Ignore:
Timestamp:
05/22/2026 08:22:56 PM (16 hours 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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']
Note: See TracChangeset for help on using the changeset viewer.