diff --git a/.wiki/Playground-Testing.md b/.wiki/Playground-Testing.md index c7006df..24eca5c 100644 --- a/.wiki/Playground-Testing.md +++ b/.wiki/Playground-Testing.md @@ -15,9 +15,9 @@ This document explains how to use WordPress Playground for testing our plugin. The easiest way to test our plugin with WordPress Playground is to use the online version: -1. Single site testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=7) +1. Single site testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=8) -2. Multisite testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=20) +2. Multisite testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=21) These links will automatically set up WordPress with multisite enabled, WP_DEBUG enabled, and both the Plugin Toggle and Hello Dolly plugins activated. @@ -111,8 +111,8 @@ We have two blueprints for testing: To run tests with WordPress Playground: 1. Open the appropriate WordPress Playground link: - - [Single site](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=7) - - [Multisite](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=20) + - [Single site](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=8) + - [Multisite](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=21) 2. Test the plugin manually in the browser @@ -182,7 +182,8 @@ await playground.run({ { step: 'enableMultisite' }, { step: 'wp-cli', command: 'wp site create --slug=testsite' }, { step: 'wp-cli', command: 'wp plugin install plugin-toggle --activate-network' }, - { step: 'wp-cli', command: 'wp plugin install hello-dolly --activate-network' } + { step: 'installPlugin', pluginData: { resource: 'wordpress.org/plugins', slug: 'hello-dolly' } }, + { step: 'wp-cli', command: 'wp plugin activate hello-dolly --network' } ] }); @@ -217,7 +218,8 @@ describe('Plugin Tests', () => { { step: 'enableMultisite' }, { step: 'wp-cli', command: 'wp site create --slug=testsite' }, { step: 'wp-cli', command: 'wp plugin install plugin-toggle --activate-network' }, - { step: 'wp-cli', command: 'wp plugin install hello-dolly --activate-network' } + { step: 'installPlugin', pluginData: { resource: 'wordpress.org/plugins', slug: 'hello-dolly' } }, + { step: 'wp-cli', command: 'wp plugin activate hello-dolly --network' } ] }); }); diff --git a/.wiki/Testing.md b/.wiki/Testing.md index 5a1bdf0..b675d67 100644 --- a/.wiki/Testing.md +++ b/.wiki/Testing.md @@ -104,9 +104,9 @@ WordPress Playground runs WordPress entirely in the browser using WebAssembly. T The easiest way to test our plugin with WordPress Playground is to use the online version: -1. Single site testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=7) +1. Single site testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=8) -2. Multisite testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=20) +2. Multisite testing: [Open in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=21) These links will automatically set up WordPress with multisite enabled, WP_DEBUG enabled, and both the Plugin Toggle and Hello Dolly plugins activated. diff --git a/playground/blueprint.json b/playground/blueprint.json index 07e5016..aa11b89 100644 --- a/playground/blueprint.json +++ b/playground/blueprint.json @@ -16,9 +16,16 @@ "slug": "plugin-toggle" } }, + { + "step": "installPlugin", + "pluginData": { + "resource": "wordpress.org/plugins", + "slug": "hello-dolly" + } + }, { "step": "wp-cli", - "command": "wp plugin install hello-dolly --activate" + "command": "wp plugin activate hello-dolly" } ] } diff --git a/playground/hello-dolly-test.html b/playground/hello-dolly-test.html new file mode 100644 index 0000000..c81d862 --- /dev/null +++ b/playground/hello-dolly-test.html @@ -0,0 +1,46 @@ + + +
+ + +