role-test
БесплатноБез исполняемых скриптовНе проверенExecute comprehensive role-based E2E testing with Playwright, testing all user flows for each role
от mwguerra★ 35 звёзд на GitHubОб этом скилле
E2E Role-Based Testing Skill
Overview
This skill executes comprehensive role-based E2E testing using Playwright MCP. It tests all pages and flows for each user role, verifying proper access control and role-specific functionality.
Standard Test Plan Location
Plan file: tests/e2e-test-plan.md
This skill reads role definitions and test credentials from the test plan at tests/e2e-test-plan.md. If the plan file doesn't exist, the calling command should invoke the test-plan skill first to generate it.
Purpose
Ensure that:
- Each user role can access appropriate resources
- Unauthorized access is properly blocked
- Role-specific features work correctly
- Cross-role security is maintained
Workflow
Step 0: Test Plan Verification (REQUIRED FIRST)
CRITICAL: Before testing roles, verify the test plan exists.
Check for Test Plan
- Look for
tests/e2e-test-plan.md - If the file exists, read the "User Roles" and "Test Credentials" sections
- If the file does NOT exist, STOP and report that the plan must be generated first
- Look for
Read Role Information from Plan
- Extract role names and descriptions
- Extract test credentials for each role
- Extract role-resource access matrix
- Use this information for testing
Step 1: Prepare Role Testing
Identify All Roles
- List all user roles in the system
- Note the role hierarchy
- Map permissions per role
Prepare Test Users
- Identify login credentials for each role
- Ensure test users exist
- Note any role-switching mechanisms
Map Role-Resource Matrix
| Resource | Guest | User | Admin | |----------|-------|------|-------| | /home | Yes | Yes | Yes | | /dashboard | No | Yes | Yes | | /admin | No | No | Yes |
Step 2: Guest Role Testing
Test unauthenticated access:
Public Pages
browser_navigate to each public page browser_snapshot to verify content Confirm: Page loads correctlyProtected Page Blocking
browser_navigate to protected page browser_snapshot to check result Confirm: Redirect to login OR 403 pageGuest-Specific Features
Test: Registration form accessible Test: Login form accessible Test: Password reset accessible
Step 3: Authenticated Role Testing
For EACH authenticated role:
Login as Role
browser_navigate to /login browser_fill_form with role credentials: - fields: [ { name: "Email", type: "textbox", ref: "[email-input-ref]", value: "[email protected]" }, { name: "Password", type: "textbox", ref: "[password-input-ref]", value: "password" } ] browser_click on submit button browser_wait_for dashboard or success indicator browser_snapshot to verify logged inTest Accessible Pages
For each page this role SHOULD access: browser_navigate to page URL browser_snapshot browser_console_messages to check for errors Verify: Page content loads correctly Verify: Role-specific elements presentTest Blocked Pages
For each page this role should NOT access: browser_navigate to page URL browser_snapshot Verify: 403 error OR redirect occurs Verify: No unauthorized data exposedTest Role-Specific Actions
For each action this role can perform: Navigate to action page Perform the action Verify success For each action this role CANNOT perform: Attempt the action Verify it's blockedLogout
browser_click logout button browser_wait_for login page browser_snapshot to confirm logged out
Step 4: Role-Specific Flow Testing
User Role Flows
## User Role Tests
### Profile Management
1. Navigate to /profile
2. Verify can view own profile
3. Edit profile information
4. Save changes
5. Verify changes persisted
### Data Access
1. Navigate to /my-data
2. Verify can see own data only
3. Cannot see other users' data
4. Can create new data
5. Can edit own data
6. Can delete own data
### Restricted Areas
1. Cannot access /admin
2. Cannot access /admin/users
3. Cannot modify other users
Admin Role Flows
## Admin Role Tests
### User Management
1. Navigate to /admin/users
2. View all users list
3. Create new user
4. Edit existing user
5. Delete user (not self)
6. Change user roles
### System Settings
1. Access settings page
2. Modify configurations
3. Save changes
4. Verify persistence
### Admin-Only Features
1. Access reports
2. View audit logs
3. Manage permissions
Step 5: Cross-Role Security Tests
Session Hijacking Prevention
Login as User A Copy session info Try to access User B data Verify: Access deniedPrivilege Escalation Prevention
Login as regular user Attempt admin actions directly Verify: Actions
Установить role-test в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл role-test?
Execute comprehensive role-based E2E testing with Playwright, testing all user flows for each role
Как установить скилл role-test?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл role-test запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic