100+ copy-paste UI components in plain HTML and CSS: no dependencies, no build step.

0 downloads

dbbasic-web-native/test_visual_single.py
Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-web-native.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-web-native.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-web-native.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 Add canonical.html v1.0 - The single source of truth for usability standards fb6e650 1 year ago History
test_visual_single.py · 1.5 KB · 51 lines
1#!/usr/bin/env python3
2"""
3Single-component AI vision testing.
4Cost-efficient way to test only changed components.
5Cost: ~$0.06 per component (3 tests × $0.02)
6Run: On changed files in PR
7"""
8
9import sys
10from test_visual_ai import VisualAIAnalyzer
11import os
12
13def main():
14 if len(sys.argv) < 2:
15 print("Usage: python3 test_visual_single.py <component-name>")
16 print("\nExamples:")
17 print(" python3 test_visual_single.py semantic-modal")
18 print(" python3 test_visual_single.py semantic-action")
19 print("\nAvailable components:")
20 print(" - semantic-action")
21 print(" - semantic-card")
22 print(" - semantic-input")
23 print(" - semantic-modal")
24 print(" - semantic-navigator")
25 print(" - semantic-list")
26 print(" - semantic-menu")
27 print(" - semantic-feedback")
28 print(" - semantic-adjuster")
29 sys.exit(1)
30
31 component = sys.argv[1]
32 if not component.endswith('.html'):
33 component = f"{component}.html"
34
35 api_key = os.getenv('ANTHROPIC_API_KEY')
36 if not api_key:
37 print("❌ ANTHROPIC_API_KEY environment variable not set")
38 sys.exit(1)
39
40 analyzer = VisualAIAnalyzer(api_key)
41
42 # Filter to only test this component
43 analyzer.COMPONENT_PAGES = [component]
44
45 print(f"\n🔍 Testing single component: {component}")
46 print(f" Cost: ~$0.06 (3 AI vision tests)\n")
47
48 analyzer.run_all_tests()
49
50if __name__ == '__main__':
51 main()