alexandervashurin/semaphore / .claude/skills/browse
browse
FlaggedFast headless browser for QA testing and site dogfooding. Navigate any URL, interact with elements, verify page state, diff before/after actions, take annotated screenshots, check responsive layouts, test forms and uploads, handle dialogs, and assert element states. ~100ms per command. Use when you need to test a feature, verify a deployment, dogfood a user flow, or file a bug with evidence. Use when asked to "open in browser", "test the site", "take a screenshot", or "dogfood this".
test/find-browse.test.ts
View on GitHub/**
* Tests for find-browse binary locator.
*/
import { describe, test, expect } from 'bun:test';
import { locateBinary } from '../src/find-browse';
import { existsSync } from 'fs';
describe('locateBinary', () => {
test('returns null when no binary exists at known paths', () => {
// This test depends on the test environment — if a real binary exists at
// ~/.claude/skills/gstack/browse/dist/browse, it will find it.
// We mainly test that the function doesn't throw.
const result = locateBinary();
expect(result === null || typeof result === 'string').toBe(true);
});
test('returns string path when binary exists', () => {
const result = locateBinary();
if (result !== null) {
expect(existsSync(result)).toBe(true);
}
});
test('priority chain checks .codex, .agents, .claude markers', () => {
// Verify the source code implements the correct priority order.
// We read the function source to confirm the markers array order.
const src = require('fs').readFileSync(require('path').join(__dirname, '../src/find-browse.ts'), 'utf-8');
// The markers array should list .codex first, then .agents, then .claude
const markersMatch = src.match(/const markers = \[([^\]]+)\]/);
expect(markersMatch).not.toBeNull();
const markers = markersMatch![1];
const codexIdx = markers.indexOf('.codex');
const agentsIdx = markers.indexOf('.agents');
const claudeIdx = markers.indexOf('.claude');
// All three must be present
expect(codexIdx).toBeGreaterThanOrEqual(0);
expect(agentsIdx).toBeGreaterThanOrEqual(0);
expect(claudeIdx).toBeGreaterThanOrEqual(0);
// .codex before .agents before .claude
expect(codexIdx).toBeLessThan(agentsIdx);
expect(agentsIdx).toBeLessThan(claudeIdx);
});
test('function signature accepts no arguments', () => {
// locateBinary should be callable with no arguments
expect(typeof locateBinary).toBe('function');
expect(locateBinary.length).toBe(0);
});
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |