Skip to main content
Glama
test-all-integrations.jsโ€ข28.4 kB
#!/usr/bin/env node /** * Comprehensive Integration Test for Fluent Suite MCP v2.1.0 * Tests all 5 plugin integrations + WordPress core */ import { makeWordPressRequest, initWordPress } from './build/wordpress.js'; // Set WordPress credentials for test site (from your mcp.json) process.env.WORDPRESS_API_URL = 'https://fccmanagermcp.instawp.co'; process.env.WORDPRESS_USERNAME = 'yiculafagu6588'; process.env.WORDPRESS_PASSWORD = 'IYxSufRipbU4YKnwBCbD5h3z'; const tests = []; let passed = 0; let failed = 0; // Test helper async function test(name, fn) { try { console.log(`\n๐Ÿงช Testing: ${name}`); await fn(); console.log(`โœ… PASSED: ${name}`); passed++; tests.push({ name, status: 'PASSED' }); } catch (error) { console.log(`โŒ FAILED: ${name}`); console.log(` Error: ${error.message}`); failed++; tests.push({ name, status: 'FAILED', error: error.message }); } } // Run all tests async function runTests() { console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•'); console.log('๐Ÿš€ FLUENT SUITE MCP v2.1.0 - INTEGRATION TEST SUITE'); console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\n'); // Initialize WordPress client console.log('๐Ÿ”Œ Initializing WordPress connection...'); try { await initWordPress(); console.log('โœ… WordPress client initialized successfully\n'); } catch (error) { console.error('โŒ Failed to initialize WordPress client:', error.message); console.error(' Make sure environment variables are set in mcp.json or .env'); process.exit(1); } // ============================================================ // 1. WORDPRESS CORE // ============================================================ console.log('\n๐Ÿ“ฆ WORDPRESS CORE TESTS'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('WordPress - List Posts', async () => { const response = await makeWordPressRequest('GET', 'wp/v2/posts?per_page=1'); if (!Array.isArray(response)) throw new Error('Expected array of posts'); }); await test('WordPress - List Users', async () => { const response = await makeWordPressRequest('GET', 'wp/v2/users?per_page=1'); if (!Array.isArray(response)) throw new Error('Expected array of users'); }); await test('WordPress - List Media', async () => { const response = await makeWordPressRequest('GET', 'wp/v2/media?per_page=1'); if (!Array.isArray(response)) throw new Error('Expected array of media'); }); // ============================================================ // 2. FLUENTCOMMUNITY // ============================================================ console.log('\n๐ŸŒ FLUENTCOMMUNITY TESTS'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('FluentCommunity - List Spaces (Custom Endpoint)', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/spaces?per_page=5'); if (!response.spaces) throw new Error('Expected spaces array'); }); await test('FluentCommunity - List Posts (Custom Endpoint)', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/posts?per_page=5'); if (!response.posts) throw new Error('Expected posts array'); }); await test('FluentCommunity - Native API - Spaces', async () => { const response = await makeWordPressRequest('GET', 'fluent-community/v2/spaces?per_page=5'); if (!response.spaces && !Array.isArray(response)) throw new Error('Expected spaces data'); }); await test('FluentCommunity - Native API - Members', async () => { // Try the members endpoint instead of users const response = await makeWordPressRequest('GET', 'fluent-community/v2/members?per_page=5'); if (!response.members && !response.data && !Array.isArray(response)) throw new Error('Expected members data'); }); await test('FluentCommunity - Design Tools - Get Colors', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/settings/colors?mode=light'); if (!response.colors && !response.message) throw new Error('Expected colors data'); }); // ============================================================ // 3. FLUENTCRM // ============================================================ console.log('\n๐Ÿ“ง FLUENTCRM TESTS'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('FluentCRM - List Contacts (Proxy)', async () => { try { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcrm/contacts?per_page=5'); if (!response.contacts && !Array.isArray(response)) throw new Error('Expected contacts data'); } catch (error) { // If 404, FluentCRM might not be installed - that's okay, skip this test if (error.message.includes('404')) { console.log(' โš ๏ธ FluentCRM not installed or endpoint not available - skipping'); return; } throw error; } }); await test('FluentCRM - Native API Direct', async () => { try { const response = await makeWordPressRequest('GET', 'fluent-crm/v2/contacts?per_page=5'); if (!response.contacts && !Array.isArray(response)) throw new Error('Expected contacts data'); } catch (error) { // If 404, FluentCRM might not be installed - that's okay, skip this test if (error.message.includes('404')) { console.log(' โš ๏ธ FluentCRM not installed or API not enabled - skipping'); return; } throw error; } }); await test('FluentCRM - List Lists', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcrm/lists'); if (!response.lists && !Array.isArray(response)) throw new Error('Expected lists data'); }); await test('FluentCRM - List Tags', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcrm/tags'); if (!response.tags && !Array.isArray(response)) throw new Error('Expected tags data'); }); // ============================================================ // 4. FLUENTCART // ============================================================ console.log('\n๐Ÿ›’ FLUENTCART TESTS'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('FluentCart - List Products', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/products?per_page=5'); if (!response.products && !Array.isArray(response)) throw new Error('Expected products data'); }); await test('FluentCart - List Orders', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/orders?per_page=5'); if (!response.orders && !Array.isArray(response)) throw new Error('Expected orders data'); }); await test('FluentCart - List Customers', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/customers?per_page=5'); if (!response.customers && !Array.isArray(response)) throw new Error('Expected customers data'); }); // ============================================================ // 5. FLUENTAFFILIATE (NEW!) // ============================================================ console.log('\n๐Ÿ’ฐ FLUENTAFFILIATE TESTS (NEW!)'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('FluentAffiliate - Native API - List Affiliates', async () => { const response = await makeWordPressRequest('GET', 'fluent-affiliate/v2/affiliates?per_page=5'); if (!response.affiliates && !Array.isArray(response)) throw new Error('Expected affiliates data'); }); await test('FluentAffiliate - Native API - Dashboard Stats', async () => { const response = await makeWordPressRequest('GET', 'fluent-affiliate/v2/reports/dashboard-stats'); if (!response.stats && !response.data && typeof response !== 'object') throw new Error('Expected stats data'); }); await test('FluentAffiliate - Native API - List Payouts', async () => { const response = await makeWordPressRequest('GET', 'fluent-affiliate/v2/payouts?per_page=5'); if (!response.payouts && !Array.isArray(response)) throw new Error('Expected payouts data'); }); await test('FluentAffiliate - Native API - List Referrals', async () => { const response = await makeWordPressRequest('GET', 'fluent-affiliate/v2/referrals?per_page=5'); if (!response.referrals && !Array.isArray(response)) throw new Error('Expected referrals data'); }); await test('FluentAffiliate - Native API - List Visits', async () => { const response = await makeWordPressRequest('GET', 'fluent-affiliate/v2/visits?per_page=5'); if (!response.visits && !Array.isArray(response)) throw new Error('Expected visits data'); }); // ============================================================ // 6. ML CANVAS BLOCK // ============================================================ console.log('\n๐ŸŽจ ML CANVAS BLOCK TESTS'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('ML Canvas - Get API Docs', async () => { const response = await makeWordPressRequest('GET', 'ml-canvas/v1/api-docs'); if (!response.endpoints && !response.message) throw new Error('Expected API docs'); }); await test('ML Canvas - Create Page Test', async () => { const testHTML = '<div style="padding: 20px; background: #f0f0f0;"><h1>Test Page</h1><p>Created by MCP Integration Test</p></div>'; const testCSS = 'body { font-family: Arial, sans-serif; }'; const response = await makeWordPressRequest('POST', 'ml-canvas/v1/create-page', { title: 'MCP Integration Test Page', html: testHTML, css: testCSS, status: 'draft' }); console.log(` ๐Ÿ“„ ML Canvas Response:`, JSON.stringify(response, null, 2)); // Check for various possible success indicators if (!response.id && !response.post_id && !response.success && response.code !== 'success') { throw new Error(`Expected page ID or success indicator. Got: ${JSON.stringify(response)}`); } const pageId = response.id || response.post_id || response.data?.id; if (pageId) { console.log(` ๐Ÿ“„ Created test page ID: ${pageId}`); } }); // ============================================================ // RESULTS SUMMARY // ============================================================ console.log('\n\nโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•'); console.log('๐Ÿ“Š TEST RESULTS SUMMARY'); console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\n'); const total = passed + failed; const passRate = ((passed / total) * 100).toFixed(1); console.log(`Total Tests: ${total}`); console.log(`โœ… Passed: ${passed}`); console.log(`โŒ Failed: ${failed}`); console.log(`๐Ÿ“ˆ Pass Rate: ${passRate}%\n`); // Group results by category const categories = { 'WordPress Core': [], 'FluentCommunity': [], 'FluentCRM': [], 'FluentCart': [], 'FluentAffiliate': [], 'ML Canvas Block': [] }; tests.forEach(test => { if (test.name.includes('WordPress -')) categories['WordPress Core'].push(test); else if (test.name.includes('FluentCommunity')) categories['FluentCommunity'].push(test); else if (test.name.includes('FluentCRM')) categories['FluentCRM'].push(test); else if (test.name.includes('FluentCart')) categories['FluentCart'].push(test); else if (test.name.includes('FluentAffiliate')) categories['FluentAffiliate'].push(test); else if (test.name.includes('ML Canvas')) categories['ML Canvas Block'].push(test); }); console.log('๐Ÿ“‹ DETAILED RESULTS BY CATEGORY:\n'); for (const [category, categoryTests] of Object.entries(categories)) { if (categoryTests.length === 0) continue; const categoryPassed = categoryTests.filter(t => t.status === 'PASSED').length; const categoryTotal = categoryTests.length; const icon = categoryPassed === categoryTotal ? 'โœ…' : 'โš ๏ธ'; console.log(`${icon} ${category}: ${categoryPassed}/${categoryTotal} passed`); categoryTests.forEach(test => { const status = test.status === 'PASSED' ? 'โœ…' : 'โŒ'; console.log(` ${status} ${test.name}`); if (test.error) { console.log(` โ””โ”€ ${test.error}`); } }); console.log(''); } console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\n'); if (failed === 0) { console.log('๐ŸŽ‰ ALL TESTS PASSED! The Fluent Suite MCP is fully operational!\n'); process.exit(0); } else { console.log('โš ๏ธ Some tests failed. Review the errors above.\n'); process.exit(1); } } // Run the test suite runTests().catch(error => { console.error('\n๐Ÿ’ฅ FATAL ERROR:', error.message); console.error(error.stack); process.exit(1); }); /** * Comprehensive Integration Test for Fluent Suite MCP v2.1.0 * Tests all 5 plugin integrations + WordPress core */ import { makeWordPressRequest, initWordPress } from './build/wordpress.js'; // Set WordPress credentials for test site (from your mcp.json) process.env.WORDPRESS_API_URL = 'https://fccmanagermcp.instawp.co'; process.env.WORDPRESS_USERNAME = 'yiculafagu6588'; process.env.WORDPRESS_PASSWORD = 'IYxSufRipbU4YKnwBCbD5h3z'; const tests = []; let passed = 0; let failed = 0; // Test helper async function test(name, fn) { try { console.log(`\n๐Ÿงช Testing: ${name}`); await fn(); console.log(`โœ… PASSED: ${name}`); passed++; tests.push({ name, status: 'PASSED' }); } catch (error) { console.log(`โŒ FAILED: ${name}`); console.log(` Error: ${error.message}`); failed++; tests.push({ name, status: 'FAILED', error: error.message }); } } // Run all tests async function runTests() { console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•'); console.log('๐Ÿš€ FLUENT SUITE MCP v2.1.0 - INTEGRATION TEST SUITE'); console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\n'); // Initialize WordPress client console.log('๐Ÿ”Œ Initializing WordPress connection...'); try { await initWordPress(); console.log('โœ… WordPress client initialized successfully\n'); } catch (error) { console.error('โŒ Failed to initialize WordPress client:', error.message); console.error(' Make sure environment variables are set in mcp.json or .env'); process.exit(1); } // ============================================================ // 1. WORDPRESS CORE // ============================================================ console.log('\n๐Ÿ“ฆ WORDPRESS CORE TESTS'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('WordPress - List Posts', async () => { const response = await makeWordPressRequest('GET', 'wp/v2/posts?per_page=1'); if (!Array.isArray(response)) throw new Error('Expected array of posts'); }); await test('WordPress - List Users', async () => { const response = await makeWordPressRequest('GET', 'wp/v2/users?per_page=1'); if (!Array.isArray(response)) throw new Error('Expected array of users'); }); await test('WordPress - List Media', async () => { const response = await makeWordPressRequest('GET', 'wp/v2/media?per_page=1'); if (!Array.isArray(response)) throw new Error('Expected array of media'); }); // ============================================================ // 2. FLUENTCOMMUNITY // ============================================================ console.log('\n๐ŸŒ FLUENTCOMMUNITY TESTS'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('FluentCommunity - List Spaces (Custom Endpoint)', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/spaces?per_page=5'); if (!response.spaces) throw new Error('Expected spaces array'); }); await test('FluentCommunity - List Posts (Custom Endpoint)', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/posts?per_page=5'); if (!response.posts) throw new Error('Expected posts array'); }); await test('FluentCommunity - Native API - Spaces', async () => { const response = await makeWordPressRequest('GET', 'fluent-community/v2/spaces?per_page=5'); if (!response.spaces && !Array.isArray(response)) throw new Error('Expected spaces data'); }); await test('FluentCommunity - Native API - Members', async () => { // Try the members endpoint instead of users const response = await makeWordPressRequest('GET', 'fluent-community/v2/members?per_page=5'); if (!response.members && !response.data && !Array.isArray(response)) throw new Error('Expected members data'); }); await test('FluentCommunity - Design Tools - Get Colors', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/settings/colors?mode=light'); if (!response.colors && !response.message) throw new Error('Expected colors data'); }); // ============================================================ // 3. FLUENTCRM // ============================================================ console.log('\n๐Ÿ“ง FLUENTCRM TESTS'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('FluentCRM - List Contacts (Proxy)', async () => { try { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcrm/contacts?per_page=5'); if (!response.contacts && !Array.isArray(response)) throw new Error('Expected contacts data'); } catch (error) { // If 404, FluentCRM might not be installed - that's okay, skip this test if (error.message.includes('404')) { console.log(' โš ๏ธ FluentCRM not installed or endpoint not available - skipping'); return; } throw error; } }); await test('FluentCRM - Native API Direct', async () => { try { const response = await makeWordPressRequest('GET', 'fluent-crm/v2/contacts?per_page=5'); if (!response.contacts && !Array.isArray(response)) throw new Error('Expected contacts data'); } catch (error) { // If 404, FluentCRM might not be installed - that's okay, skip this test if (error.message.includes('404')) { console.log(' โš ๏ธ FluentCRM not installed or API not enabled - skipping'); return; } throw error; } }); await test('FluentCRM - List Lists', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcrm/lists'); if (!response.lists && !Array.isArray(response)) throw new Error('Expected lists data'); }); await test('FluentCRM - List Tags', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcrm/tags'); if (!response.tags && !Array.isArray(response)) throw new Error('Expected tags data'); }); // ============================================================ // 4. FLUENTCART // ============================================================ console.log('\n๐Ÿ›’ FLUENTCART TESTS'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('FluentCart - List Products', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/products?per_page=5'); if (!response.products && !Array.isArray(response)) throw new Error('Expected products data'); }); await test('FluentCart - List Orders', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/orders?per_page=5'); if (!response.orders && !Array.isArray(response)) throw new Error('Expected orders data'); }); await test('FluentCart - List Customers', async () => { const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/customers?per_page=5'); if (!response.customers && !Array.isArray(response)) throw new Error('Expected customers data'); }); // ============================================================ // 5. FLUENTAFFILIATE (NEW!) // ============================================================ console.log('\n๐Ÿ’ฐ FLUENTAFFILIATE TESTS (NEW!)'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('FluentAffiliate - Native API - List Affiliates', async () => { const response = await makeWordPressRequest('GET', 'fluent-affiliate/v2/affiliates?per_page=5'); if (!response.affiliates && !Array.isArray(response)) throw new Error('Expected affiliates data'); }); await test('FluentAffiliate - Native API - Dashboard Stats', async () => { const response = await makeWordPressRequest('GET', 'fluent-affiliate/v2/reports/dashboard-stats'); if (!response.stats && !response.data && typeof response !== 'object') throw new Error('Expected stats data'); }); await test('FluentAffiliate - Native API - List Payouts', async () => { const response = await makeWordPressRequest('GET', 'fluent-affiliate/v2/payouts?per_page=5'); if (!response.payouts && !Array.isArray(response)) throw new Error('Expected payouts data'); }); await test('FluentAffiliate - Native API - List Referrals', async () => { const response = await makeWordPressRequest('GET', 'fluent-affiliate/v2/referrals?per_page=5'); if (!response.referrals && !Array.isArray(response)) throw new Error('Expected referrals data'); }); await test('FluentAffiliate - Native API - List Visits', async () => { const response = await makeWordPressRequest('GET', 'fluent-affiliate/v2/visits?per_page=5'); if (!response.visits && !Array.isArray(response)) throw new Error('Expected visits data'); }); // ============================================================ // 6. ML CANVAS BLOCK // ============================================================ console.log('\n๐ŸŽจ ML CANVAS BLOCK TESTS'); console.log('โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'); await test('ML Canvas - Get API Docs', async () => { const response = await makeWordPressRequest('GET', 'ml-canvas/v1/api-docs'); if (!response.endpoints && !response.message) throw new Error('Expected API docs'); }); await test('ML Canvas - Create Page Test', async () => { const testHTML = '<div style="padding: 20px; background: #f0f0f0;"><h1>Test Page</h1><p>Created by MCP Integration Test</p></div>'; const testCSS = 'body { font-family: Arial, sans-serif; }'; const response = await makeWordPressRequest('POST', 'ml-canvas/v1/create-page', { title: 'MCP Integration Test Page', html: testHTML, css: testCSS, status: 'draft' }); console.log(` ๐Ÿ“„ ML Canvas Response:`, JSON.stringify(response, null, 2)); // Check for various possible success indicators if (!response.id && !response.post_id && !response.success && response.code !== 'success') { throw new Error(`Expected page ID or success indicator. Got: ${JSON.stringify(response)}`); } const pageId = response.id || response.post_id || response.data?.id; if (pageId) { console.log(` ๐Ÿ“„ Created test page ID: ${pageId}`); } }); // ============================================================ // RESULTS SUMMARY // ============================================================ console.log('\n\nโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•'); console.log('๐Ÿ“Š TEST RESULTS SUMMARY'); console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\n'); const total = passed + failed; const passRate = ((passed / total) * 100).toFixed(1); console.log(`Total Tests: ${total}`); console.log(`โœ… Passed: ${passed}`); console.log(`โŒ Failed: ${failed}`); console.log(`๐Ÿ“ˆ Pass Rate: ${passRate}%\n`); // Group results by category const categories = { 'WordPress Core': [], 'FluentCommunity': [], 'FluentCRM': [], 'FluentCart': [], 'FluentAffiliate': [], 'ML Canvas Block': [] }; tests.forEach(test => { if (test.name.includes('WordPress -')) categories['WordPress Core'].push(test); else if (test.name.includes('FluentCommunity')) categories['FluentCommunity'].push(test); else if (test.name.includes('FluentCRM')) categories['FluentCRM'].push(test); else if (test.name.includes('FluentCart')) categories['FluentCart'].push(test); else if (test.name.includes('FluentAffiliate')) categories['FluentAffiliate'].push(test); else if (test.name.includes('ML Canvas')) categories['ML Canvas Block'].push(test); }); console.log('๐Ÿ“‹ DETAILED RESULTS BY CATEGORY:\n'); for (const [category, categoryTests] of Object.entries(categories)) { if (categoryTests.length === 0) continue; const categoryPassed = categoryTests.filter(t => t.status === 'PASSED').length; const categoryTotal = categoryTests.length; const icon = categoryPassed === categoryTotal ? 'โœ…' : 'โš ๏ธ'; console.log(`${icon} ${category}: ${categoryPassed}/${categoryTotal} passed`); categoryTests.forEach(test => { const status = test.status === 'PASSED' ? 'โœ…' : 'โŒ'; console.log(` ${status} ${test.name}`); if (test.error) { console.log(` โ””โ”€ ${test.error}`); } }); console.log(''); } console.log('โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\n'); if (failed === 0) { console.log('๐ŸŽ‰ ALL TESTS PASSED! The Fluent Suite MCP is fully operational!\n'); process.exit(0); } else { console.log('โš ๏ธ Some tests failed. Review the errors above.\n'); process.exit(1); } } // Run the test suite runTests().catch(error => { console.error('\n๐Ÿ’ฅ FATAL ERROR:', error.message); console.error(error.stack); process.exit(1); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wplaunchify/fluent-community-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server