Skip to main content
Glama

dhis2_generate_test_setup

Set up DHIS2 app testing environments by configuring frameworks like Jest, Cypress, or Playwright and generating unit, integration, e2e, or visual tests with mock setups for APIs, DataStore, and authentication.

Instructions

Generate testing setup and example tests for DHIS2 app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coverageNo
mockSetupNo
testFrameworkYesTesting framework to configure
testTypesNoTypes of tests to set up

Implementation Reference

  • MCP tool handler that extracts arguments, calls generateTestSetup function, and returns markdown-formatted testing setup instructions.
    case 'dhis2_generate_test_setup': const testArgs = args as any; const testSetup = generateTestSetup(testArgs); return { content: [ { type: 'text', text: testSetup, }, ], };
  • Helper function that generates complete testing setup documentation including framework configs, test examples, mocks, and commands for Jest, Cypress, Playwright, etc.
    export function generateTestSetup(args: any): string { const { testFramework, testTypes = [], coverage = {}, mockSetup = {} } = args; return `# DHIS2 Testing Setup ## ${testFramework.toUpperCase()} Configuration ${generateTestFrameworkConfig(testFramework, coverage)} ${testTypes.includes('unit') ? generateUnitTestExamples() : ''} ${testTypes.includes('integration') ? generateIntegrationTestExamples() : ''} ${testTypes.includes('e2e') ? generateE2ETestExamples(testFramework) : ''} ${testTypes.includes('visual') ? generateVisualTestExamples() : ''} ${Object.keys(mockSetup).length > 0 ? generateMockConfiguration(mockSetup) : ''} ## Test Commands \`\`\`bash # Run all tests ${testFramework === 'jest' ? 'npm test' : testFramework === 'cypress' ? 'npx cypress open' : 'npx playwright test'} # Run with coverage ${testFramework === 'jest' ? 'npm test -- --coverage' : 'npm run test:coverage'} # Run specific test file ${testFramework === 'jest' ? 'npm test -- MyComponent.test.js' : testFramework === 'cypress' ? 'npx cypress run --spec "cypress/integration/MyComponent.spec.js"' : 'npx playwright test tests/MyComponent.spec.ts'} # Watch mode ${testFramework === 'jest' ? 'npm test -- --watch' : 'npm run test:watch'} \`\`\` `;
  • Tool permission registration mapping 'dhis2_generate_test_setup' to 'canConfigureApps' permission.
    ['dhis2_generate_test_setup', 'canConfigureApps'],

Other Tools

Related Tools

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/Dradebo/dhis2-mcp'

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