Automated smoke testing for ProcessMaker 4 CI instances. Run API calls, Playwright tests, and server configuration against remote PM4 servers using bearer token authentication.
Automated testing skill for ProcessMaker 4 CI instances. Provides smoke testing, API validation, and server configuration capabilities through a TypeScript CLI tool.
Run comprehensive automated tests against remote ProcessMaker 4 servers, including:
The TestBench CLI follows this structure:
- `update-server` - Updates remote server environment via API calls (non-interactive)
- `smoketest` - Runs end-to-end tests against the configured server
- `get-token` - Generates bearer tokens for server authentication
When working with ProcessMaker TestBench projects:
- `SERVER_URL`: Remote ProcessMaker server URL
- `BEARER_TOKEN`: Authentication token for API calls
When building or modifying commands:
- Default behavior: Run ALL scripts in `src/actions/` (excluding subfolders) sequentially
- Support `--script` flag to run a single specific script (e.g., `--script=configure-email`)
- MUST be non-interactive (no user prompts or selections)
- Stop execution on first error with clear error message
- Example: `npm run update-server` or `npm run update-server -- --script=configure-email`
- Execute Playwright tests from `src/tests/` directory
- Validate actual server functionality
- Report test results clearly
- Use Playwright to generate bearer tokens for authentication
- Store or display tokens for use in other commands
When writing action scripts in `src/actions/`:
Follow this test structure:
- Test user workflows, API endpoints, UI interactions
- Use Playwright for browser automation
- Focus on real-world scenarios
- Test utilities, actions, command logic
- Use vitest as the testing framework
- Mock external dependencies
- NOT tests - these are setup/configuration scripts
- May include assertions for validation
- Used when API calls are insufficient
Use these npm scripts:
```bash
npm run dev
npm run build
npm start
npm test
npm run smoketest
npm run update-server
npm run update-server -- --script=configure-email
npm run get-token
```
Always include these in the project:
```bash
export SERVER_URL=https://pm4-instance.example.com
export BEARER_TOKEN=your_token_here
npm run update-server
npm run update-server -- --script=configure-email
npm run smoketest
npm run get-token
npm test
```
```typescript
import axios from 'axios';
import { config } from '../config';
export async function actionName() {
try {
const response = await axios.post(
`${config.serverUrl}/api/endpoint`,
{ data },
{
headers: {
'Authorization': `Bearer ${config.bearerToken}`,
'Content-Type': 'application/json'
}
}
);
console.log('✓ Action completed successfully');
return response.data;
} catch (error) {
console.error('✗ Action failed:', error.message);
throw error;
}
}
```
```typescript
import { test, expect } from '@playwright/test';
import { config } from '../config';
test('feature validation', async ({ page }) => {
await page.goto(config.serverUrl);
// Test implementation
await expect(page.locator('selector')).toBeVisible();
});
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/processmaker-testbench-ci-testing/raw