Files
msd-core/tests/playwright-ui-verify.test.cjs
Tom Boucher 522860ceef feat(verify): add optional Playwright-MCP automated UI verification (#1604)
When Playwright-MCP is available in the session, GSD UI verification
steps can be automated via screenshot comparison instead of manual
checkbox review. Falls back to manual flow when Playwright is not
configured.

Closes #1420
2026-04-03 12:40:47 -04:00

50 lines
2.0 KiB
JavaScript

const { test, describe } = require('node:test');
const assert = require('node:assert');
const fs = require('fs');
const path = require('path');
describe('Playwright-MCP UI verification integration', () => {
test('verify-work.md mentions automated UI verification', () => {
const content = fs.readFileSync(
path.join(__dirname, '..', 'get-shit-done', 'workflows', 'verify-work.md'), 'utf-8'
);
assert.ok(
content.toLowerCase().includes('playwright') || content.includes('automated') && content.includes('UI'),
'verify-work.md should mention automated UI verification option'
);
});
test('ui-review.md mentions Playwright-MCP when available', () => {
const content = fs.readFileSync(
path.join(__dirname, '..', 'get-shit-done', 'workflows', 'ui-review.md'), 'utf-8'
);
assert.ok(
content.toLowerCase().includes('playwright') || content.includes('mcp__playwright'),
'ui-review.md should reference Playwright-MCP'
);
});
test('gsd-ui-auditor.md includes automated screenshot guidance', () => {
const content = fs.readFileSync(
path.join(__dirname, '..', 'agents', 'gsd-ui-auditor.md'), 'utf-8'
);
assert.ok(
content.toLowerCase().includes('playwright') || content.includes('screenshot') || content.includes('automated'),
'gsd-ui-auditor.md should mention automated screenshot verification'
);
});
test('automated verification is optional/conditional (falls back to manual)', () => {
const verifyContent = fs.readFileSync(
path.join(__dirname, '..', 'get-shit-done', 'workflows', 'verify-work.md'), 'utf-8'
);
// Must include a fallback / "if available" conditional
const hasConditional =
verifyContent.includes('if available') ||
verifyContent.includes('when available') ||
verifyContent.includes('if Playwright') ||
verifyContent.includes('fall back');
assert.ok(hasConditional, 'Playwright integration must be conditional with manual fallback');
});
});