Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/reusable-javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Install npm Dependencies
run: npm ci

# Older branches using outdated versions of Puppeteer fail on newer versions of the `ubuntu-24` image.
# Branches prior to 6.1 using outdated versions of Puppeteer fail on newer versions of the `ubuntu-24` image.
# This disables AppArmor in order to work around those failures.
#
# See https://issues.chromium.org/issues/373753919
Expand Down
27 changes: 17 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ module.exports = function(grunt) {
'cssmin',
'imagemin',
'jshint',
'qunit',
'uglify',
'watch'
],
Expand Down Expand Up @@ -955,7 +954,8 @@ module.exports = function(grunt) {
src: [
'tests/qunit/**/*.js',
'!tests/qunit/vendor/*',
'!tests/qunit/editor/**'
'!tests/qunit/qunit.js',
'!tests/qunit/playwright.config.js'
],
options: grunt.file.readJSON( 'tests/qunit/.jshintrc' )
},
Expand Down Expand Up @@ -1059,12 +1059,6 @@ module.exports = function(grunt) {
}
}
},
qunit: {
files: [
'tests/qunit/**/*.html',
'!tests/qunit/editor/**'
]
},
phpunit: {
'default': {
args: ['--verbose', '-c', 'phpunit.xml.dist']
Expand Down Expand Up @@ -1597,8 +1591,7 @@ module.exports = function(grunt) {
},
test: {
files: [
'tests/qunit/**',
'!tests/qunit/editor/**'
'tests/qunit/**'
],
tasks: ['qunit']
}
Expand Down Expand Up @@ -2220,6 +2213,20 @@ module.exports = function(grunt) {
}, this.async());
});

grunt.registerTask( 'qunit', 'Runs QUnit tests.', function() {
var done = this.async();
grunt.util.spawn( {
cmd: 'npx',
args: [ 'playwright', 'test', '--config', 'tests/qunit/playwright.config.js' ],
opts: { stdio: 'inherit' }
Comment thread
johnbillion marked this conversation as resolved.
}, function( error, result, code ) {
if ( code !== 0 ) {
grunt.fail.warn( 'QUnit tests failed.' );
}
done();
} );
} );

grunt.registerTask( 'qunit:compiled', 'Runs QUnit tests on compiled as well as uncompiled scripts.',
['build', 'copy:qunit', 'qunit']
);
Expand Down
172 changes: 0 additions & 172 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"grunt-contrib-cssmin": "~5.0.0",
"grunt-contrib-imagemin": "~4.0.0",
"grunt-contrib-jshint": "3.2.0",
"grunt-contrib-qunit": "~10.1.1",
"grunt-contrib-uglify": "~5.2.2",
"grunt-contrib-watch": "~1.1.0",
"grunt-file-append": "0.0.7",
Expand Down
19 changes: 19 additions & 0 deletions tests/qunit/playwright.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Playwright configuration for QUnit tests.
*/
const path = require( 'path' );
const { defineConfig } = require( '@playwright/test' );

module.exports = defineConfig( {
testDir: __dirname,
outputDir: path.join( __dirname, '..', '..', 'artifacts', 'test-results' ),
testMatch: 'qunit.js',
timeout: 30_000,
workers: 1,
use: {
headless: true,
/* This avoids the need to run `npx playwright install` in CI. */
channel: process.env.CI ? 'chrome' : undefined,
},
reporter: process.env.CI ? 'github' : 'list',
} );
Loading
Loading