From bb2f8a6d4f62588541b26a7744fe8466a3c50174 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 30 Nov 2022 13:16:00 +0000 Subject: [PATCH] Build/Test Tools: Add basic e2e coverage for Gutenberg. Add some minimal e2e test coverage to install and activate the Gutenberg plugin. This will catch naming collisions between Core and Gutenberg and help avoid crashing WordPress installations that run the stable version of the Gutenberg plugin on top of Core trunk. Props costdev. Fixes #57197. git-svn-id: https://develop.svn.wordpress.org/trunk@54913 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/e2e/specs/gutenberg-plugin.test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/e2e/specs/gutenberg-plugin.test.js diff --git a/tests/e2e/specs/gutenberg-plugin.test.js b/tests/e2e/specs/gutenberg-plugin.test.js new file mode 100644 index 0000000000..75ac0a6b6d --- /dev/null +++ b/tests/e2e/specs/gutenberg-plugin.test.js @@ -0,0 +1,24 @@ +import { + activatePlugin, + deactivatePlugin, + installPlugin, + uninstallPlugin, +} from '@wordpress/e2e-test-utils'; + +describe( 'Gutenberg plugin', () => { + beforeAll( async () => { + await installPlugin( 'gutenberg' ); + } ); + + afterAll( async () => { + await uninstallPlugin( 'gutenberg' ); + } ); + + it( 'Activate the Gutenberg plugin', async () => { + await activatePlugin( 'gutenberg' ); + // If plugin activation fails, it will time out and throw an error, + // since the activatePlugin helper is looking for a `.deactivate` link + // which is only there if activation succeeds. + await deactivatePlugin( 'gutenberg' ); + } ); +} );