chrome-testing
# Chrome Testing Skill
What this skill does
# Chrome Testing Skill
Reference for manual QA testing of Telegram Mini Apps using Chrome browser automation tools.
## Quick Reference: MCP Tools
| Tool | Purpose | When to Use |
|------|---------|-------------|
| `navigate` | Load Mini App URL | Start of test, navigation |
| `computer` | Click, type, interact | Buttons, forms, UI elements |
| `form_input` | Type in text fields | Complex input validation |
| `read_network_requests` | Inspect HTTP traffic | API validation, auth testing |
| `read_console_messages` | Check JS errors | Error detection, debugging |
| `javascript_tool` | Run JS in page | State inspection, DOM querying |
| `find` | Locate elements | Element verification |
| `read_page` | Get full page content | DOM structure analysis |
## Testing Environments
### Local Development (Fastest)
```
URL: http://localhost:5173
SDK: Mocked via @telegram-apps/sdk
Use: Daily development testing
```
### TMA Studio (Realistic)
```
Download: https://github.com/erfanmola/TMA-Studio
Features: 90%+ Mini App API coverage
Use: Pre-release testing
```
### Real Device (Final)
```
Requires: HTTPS via Cloudflare Tunnel
Setup: cloudflared tunnel --url http://localhost:5173
Use: Final validation
```
## Standard Test Workflow
### 1. Setup
```
navigate("http://localhost:5173")
screenshot() -> verify page loads
```
### 2. UI Interaction
```
computer(click, element)
screenshot() -> verify state changed
```
### 3. API Verification
```
computer(click, saveButton)
read_network_requests() ->
- Verify: PUT /api/v1/miniapp/chats/{id}/settings
- Check: Authorization: tma {initData}
- Status: 200 OK
```
### 4. Error Checking
```
read_console_messages() ->
- No console.error entries
- No "Failed to fetch" messages
```
### 5. State Inspection
```
javascript_tool("window.appState?.selectedChat")
javascript_tool("localStorage.getItem('key')")
```
## API Testing Checklist
### Request Verification
| Check | How |
|-------|-----|
| Correct endpoint | `read_network_requests()` + urlPattern |
| HTTP method | GET/POST/PUT/DELETE as expected |
| Auth header | `Authorization: tma <initData>` present |
| Request body | JSON payload matches expected |
### Response Verification
| Check | Expected |
|-------|----------|
| Success | Status 200, data returned |
| Not found | Status 404, error message |
| Unauthorized | Status 401, no data exposed |
| Validation error | Status 400, field errors |
### API Endpoints (Example)
```
GET /api/v1/miniapp/chats - List user's chats
GET /api/v1/miniapp/chats/{id} - Get chat details
GET /api/v1/miniapp/chats/{id}/settings - Get chat settings
PUT /api/v1/miniapp/chats/{id}/settings - Update settings
GET /api/v1/miniapp/chats/{id}/blocklist - Get blocklist
POST /api/v1/miniapp/chats/{id}/blocklist - Add pattern
DELETE /api/v1/miniapp/chats/{id}/blocklist/{id} - Remove pattern
GET /api/v1/miniapp/chats/{id}/locks - Get locks
PUT /api/v1/miniapp/chats/{id}/locks - Update locks
```
## Console Error Patterns
### Critical Errors (Must Fix)
```
Cannot read property 'WebApp' of undefined -> Telegram SDK not loaded
initData is undefined -> Not in Telegram context
Authorization header missing -> API client misconfigured
CORS error -> Backend CORS not configured
```
### Common Warnings (Review)
```
React key prop warning -> Add unique keys to lists
useEffect dependency warning -> Fix dependency array
Unused variable warning -> Clean up code
```
## JavaScript Inspection Examples
### Check Telegram SDK
```javascript
window.Telegram?.WebApp?.initDataUnsafe?.user
window.Telegram?.WebApp?.platform
window.Telegram?.WebApp?.version
```
### Check App State
```javascript
window.__store?.getState?.()
localStorage.getItem('lastSelectedChat')
sessionStorage.getItem('formData')
```
### Check DOM State
```javascript
document.querySelector('.error-message')?.textContent
document.querySelector('button[type="submit"]').disabled
getComputedStyle(document.documentElement).getPropertyValue('--tg-theme-bg-color')
```
## Test Scenarios
### Scenario: Chat Settings Save
1. **Navigate**: `navigate("http://localhost:5173")`
2. **Select Chat**: `computer(click, chatSelector)` -> select chat
3. **Toggle Setting**: `computer(click, collectionToggle)`
4. **Save**: `computer(click, saveButton)`
5. **Verify Request**:
- `read_network_requests()` -> PUT /chats/{id}/settings
- Authorization header present
- Response 200
6. **Verify UI**: Success message displayed
7. **Verify State**: `javascript_tool("localStorage.getItem('settings')")`
### Scenario: Auth Failure
1. Mock invalid initData (if testing auth)
2. Perform action requiring auth
3. `read_network_requests()` -> Status 401
4. `read_console_messages()` -> No sensitive data leaked
5. UI shows generic "Not authorized" message
### Scenario: Form Validation
1. Fill form with invalid data
2. Click submit
3. `read_network_requests()` -> No request made (frontend validation)
4. UI shows validation errors
5. Fill with valid data
6. Click submit
7. `read_network_requests()` -> Request made, Status 200/400
## Platform Testing
### Desktop (Telegram Desktop Beta)
- Right-click in WebView -> Inspect
- Standard Chrome DevTools
### Android
- Enable USB debugging
- Connect device
- `chrome://inspect/#devices`
- Inspect WebView
### iOS (Requires macOS)
- Enable Web Inspector in Safari settings
- Safari -> Develop -> [Device] -> WebView
## Theme Testing
### Check Theme Variables
```javascript
javascript_tool(`
const style = getComputedStyle(document.documentElement);
return {
bg: style.getPropertyValue('--tg-theme-bg-color'),
text: style.getPropertyValue('--tg-theme-text-color'),
hint: style.getPropertyValue('--tg-theme-hint-color'),
button: style.getPropertyValue('--tg-theme-button-color')
};
`)
```
### Toggle Theme (TMA Studio)
- Settings -> Theme -> Dark/Light
- Verify colors update
- Screenshot both themes
## Release Checklist
### Functionality
- [ ] All buttons respond to clicks
- [ ] Forms submit correctly
- [ ] Settings persist after refresh
- [ ] Lists paginate properly
- [ ] Modals open/close
### API Integration
- [ ] All endpoints return expected data
- [ ] Authorization headers sent
- [ ] Error responses handled gracefully
- [ ] Loading states visible
### Error Handling
- [ ] No console errors on normal flow
- [ ] Network errors show user-friendly messages
- [ ] Invalid input rejected with clear errors
### UI/UX
- [ ] Layout correct on all platforms
- [ ] Theme colors applied
- [ ] Loading spinners visible
- [ ] Success/error toasts work
### Security
- [ ] No sensitive data in console
- [ ] initData not exposed
- [ ] Admin checks enforced
- [ ] HTTPS in production
## Limitations & Workarounds
| Limitation | Workaround |
|-----------|-----------|
| HTTPS required in prod | Cloudflare Tunnel for local HTTPS |
| initData expires ~1hr | Refresh app or use mock |
| Can't test MainButton in browser | Use TMA Studio |
| iOS requires macOS | Use Android or Desktop |
| WebSocket may not work | Test HTTP polling first |
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.