fix(gan): grant evaluator Playwright tools

This commit is contained in:
Suliman Abdulrazzaq
2026-08-24 22:26:25 -03:00
committed by Alex Schmitt
parent b7faf3d70e
commit ef68f816d1
2 changed files with 49 additions and 1 deletions
+34
View File
@@ -0,0 +1,34 @@
/**
* Regression coverage for the GAN evaluator's live-browser capability.
*
* Run with: node tests/ci/gan-evaluator-tools.test.js
*/
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const evaluatorPath = path.join(__dirname, '..', '..', 'agents', 'gan-evaluator.md');
const content = fs.readFileSync(evaluatorPath, 'utf8');
const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
assert.ok(frontmatter, 'gan-evaluator.md should have frontmatter');
const toolsLine = frontmatter[1].match(/^tools:\s*(.+)$/m);
assert.ok(toolsLine, 'gan-evaluator.md should declare tools');
const tools = new Set(toolsLine[1].split(',').map(tool => tool.trim()));
for (const tool of [
'mcp__playwright__browser_navigate',
'mcp__playwright__browser_click',
'mcp__playwright__browser_take_screenshot',
'mcp__playwright__browser_snapshot',
'mcp__playwright__browser_type',
'mcp__playwright__browser_fill_form',
]) {
assert.ok(tools.has(tool), `gan-evaluator.md should grant ${tool}`);
}
assert.match(content, /\*\*Achieved:\*\* `playwright` \| `screenshot` \| `code-only`/);
assert.match(content, /mode that was actually completed/);
console.log('GAN evaluator tools and achieved-mode contract are present.');