44 lines
1.2 KiB
JSON
44 lines
1.2 KiB
JSON
{
|
|
"required_plugins": [
|
|
{ "plugin_slug": "woocommerce", "source": "wordpress.org", "activate": true }
|
|
],
|
|
"test_scenarios": [
|
|
{
|
|
"name": "Plugin activates without errors",
|
|
"type": "custom",
|
|
"wp_cli_command": "plugin activate {plugin_slug}",
|
|
"assertions": { "wp_cli_success": true, "not_contains": ["Fatal error", "Parse error"] }
|
|
},
|
|
{
|
|
"name": "Home page responds",
|
|
"type": "endpoint",
|
|
"url": "/",
|
|
"assertions": { "status_code": 200, "contains": ["<html"] }
|
|
},
|
|
{
|
|
"name": "Admin settings page loads",
|
|
"type": "admin_page",
|
|
"url": "/admin.php?page=example-settings",
|
|
"assertions": { "status_code": 200 }
|
|
},
|
|
{
|
|
"name": "AJAX ping",
|
|
"type": "ajax",
|
|
"ajax_action": "pc_ping",
|
|
"assertions": { "contains": ["pong"] }
|
|
},
|
|
{
|
|
"name": "Shortcode renders",
|
|
"type": "shortcode",
|
|
"shortcode": "[pc_example]",
|
|
"assertions": { "contains": ["Example output"] }
|
|
},
|
|
{
|
|
"name": "Activation hook check (logs)",
|
|
"type": "custom",
|
|
"wp_cli_command": "tail -n 50 /var/log/wp-errors.log || echo 'No errors found'",
|
|
"assertions": { "not_contains": ["Fatal error", "Parse error"] }
|
|
}
|
|
]
|
|
}
|