Awesome-omni-skill webapp-test-docker-demo
Dedicated test Agent responsible for managing all E2E tests for the webapp-test-docker-demo project. Use this skill when you need to run tests, view test lists, generate test reports, or create new tests. This Agent knows all test files in the project, can execute tests and provide detailed reports. The project uses Docker Compose and Playwright for end-to-end testing.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/webapp-test-docker-demo" ~/.claude/skills/diegosouzapw-awesome-omni-skill-webapp-test-docker-demo && rm -rf "$T"
skills/development/webapp-test-docker-demo/SKILL.mdWebapp Test Docker Demo - Test Agent
This skill transforms Claude into a dedicated test Agent that can:
- 📋 List all tests: View all test files and test cases in the project
- ▶️ Run tests: Execute all or specific tests (default uses remote mode, automatically checks Docker service)
- 📊 Generate reports: Automatically generate and display detailed reports after running tests
- ✨ Create new tests: Generate new test cases based on requirements
- 🔍 Auto-check: Automatically check if Docker service is running before executing tests
Project Location
Project path:
/Users/dennis.liu/Documents/code_space/webapp-test-docker-demo
Quick Start
Important: This skill defaults to remote test mode (
test:remote), requires setting Docker service URL first.
Step 1: Ensure Docker Service is Running
Start Docker service on local machine or remote server:
cd /Users/dennis.liu/Documents/code_space/webapp-test-docker-demo docker-compose up -d
Step 2: Set Service URL
Set environment variable in Claude:
Method A: Use host IP (recommended, same network)
# Find IP on local machine: ipconfig getifaddr en0 (macOS) export DOCKER_SERVICE_URL=http://192.168.1.100:8080 # Replace with actual IP
Method B: Use port forwarding tool (different network)
# On local machine: npx localtunnel --port 8080 export DOCKER_SERVICE_URL=https://your-tunnel-url.loca.lt
Step 3: Run Tests
cd /Users/dennis.liu/Documents/code_space/webapp-test-docker-demo npm run test:remote:ui # UI mode (recommended) # or npm run test:remote # Standard mode
Script will automatically check if Docker service is accessible, if unable to connect will provide detailed prompts.
Core Features
0. List All Tests
When PM requests to list all tests, execute the following:
Method 1: Use Playwright command (recommended):
cd /Users/dennis.liu/Documents/code_space/webapp-test-docker-demo npx playwright test --list
Method 2: Use helper script:
cd /Users/dennis.liu/Documents/code_space/webapp-test-docker-demo python scripts/list_tests.py
Method 3: Directly read test directory:
cd /Users/dennis.liu/Documents/code_space/webapp-test-docker-demo ls -la tests/e2e/
Output format: When listing all tests, should provide:
- Test file list (.spec.ts files)
- Test cases in each file
- Test tags (@smoke, @regression)
- Test descriptions
Example output format:
📋 Test File List: 1. login.spec.ts 📁 Login Feature - Successful login @smoke - Login failure - wrong password @regression 2. logout.spec.ts 📁 Logout Feature - Logout feature @smoke 3. shopping-cart.spec.ts 📁 Shopping Cart Feature - Add item to cart @smoke - Checkout feature @smoke - Checkout with empty cart @regression
1. Run Tests and Generate Report
When PM requests "Run all current tests and give me report", execute the following complete flow:
Important: Default uses remote test mode (
test:remote), will automatically check if Docker service is running.
Complete flow:
cd /Users/dennis.liu/Documents/code_space/webapp-test-docker-demo # 1. Check and set Docker service URL # If Docker runs locally, need to get host IP first (Sandbox cannot access localhost) # On local machine execute: ipconfig getifaddr en0 (macOS) or hostname -I (Linux) # Then set: export DOCKER_SERVICE_URL=http://192.168.1.100:8080 # Replace with actual IP # 2. Run all tests (will automatically check if Docker service is running) npm run test:remote # 3. Display test report npx playwright show-report
Note:
- Script will automatically check if Docker service is accessible
- If unable to connect, will provide detailed error prompts and solution suggestions
- No need to manually start/stop Docker (Docker should run in external environment)
Report content should include:
-
Test Summary:
- Total tests
- Passed
- Failed
- Execution time
-
Detailed Results:
- Status of each test (passed/failed)
- Error messages for failed tests
- Screenshot locations for failed tests
-
HTML Report Path:
playwright-report/index.html
-
Test Results Directory:
- Contains screenshots and trace filestest-results/
Using Python script (recommended, automatically checks Docker):
cd /Users/dennis.liu/Documents/code_space/webapp-test-docker-demo export DOCKER_SERVICE_URL=http://192.168.1.100:8080 # Replace with actual IP python scripts/run_tests_remote.py all
2. Run Specific Tests
Specific test file:
cd /Users/dennis.liu/Documents/code_space/webapp-test-docker-demo export DOCKER_SERVICE_URL=http://192.168.1.100:8080 # Replace with actual IP python scripts/run_tests_remote.py all --test-file tests/e2e/login.spec.ts
UI mode (visual testing, recommended):
cd /Users/dennis.liu/Documents/code_space/webapp-test-docker-demo export DOCKER_SERVICE_URL=http://192.168.1.100:8080 # Replace with actual IP npm run test:remote:ui # or use Python script python scripts/run_tests_remote.py ui
Debug mode:
cd /Users/dennis.liu/Documents/code_space/webapp-test-docker-demo export DOCKER_SERVICE_URL=http://192.168.1.100:8080 # Replace with actual IP npm run test:remote:debug # or use Python script python scripts/run_tests_remote.py debug
3. View Test Results
After tests complete, view results:
HTML Report:
cd /Users/dennis.liu/Documents/code_space/webapp-test-docker-demo npx playwright show-report
Test Results Directory:
- Test execution results and screenshotstest-results/
- HTML test reportplaywright-report/
4. Generate New Tests
When PM requests to generate new tests:
-
Understand requirements: Ask PM what feature to test
- Feature description
- Test scenarios (success/failure)
- Expected behavior
-
Check existing tests: View existing tests in
directory to avoid duplicatestests/e2e/
- Login feature testlogin.spec.ts
- Logout feature testlogout.spec.ts
- Shopping cart feature testshopping-cart.spec.ts
-
Generate test file: Create new
file in.spec.ts
directorytests/e2e/
Test file template: Reference
templates/test_template.spec.ts or use the following structure:
import { test, expect } from '@playwright/test'; test.describe('Feature Name', () => { test.beforeEach(async ({ page }) => { await page.goto('/'); await page.waitForLoadState('networkidle'); }); test('Test scenario description @smoke', async ({ page }) => { // Arrange: Prepare test environment // Act: Perform actions // Assert: Verify results }); });
Test tag explanation:
- Smoke tests (core functionality)@smoke
- Regression tests (edge cases)@regression
-
Test account information:
- Email:
test@example.com - Password:
password123
- Email:
-
Common selectors:
- Login button:
page.getByRole('button', { name: 'Login' }) - Email input:
page.locator('[data-testid="email-input"]') - Password input:
page.locator('[data-testid="password-input"]') - Login submit:
page.locator('[data-testid="login-button"]') - Product list:
page.locator('.product-list') - Shopping cart:
page.locator('#cart')
- Login button:
5. Debug Test Failures
When tests fail:
- View screenshots: Check screenshots in
directorytest-results/ - View trace: Use
for debuggingnpm run test:remote:debug - Check Docker service status:
- Script will automatically check if service is accessible
- If unable to connect, check:
- Is Docker service running in external environment
- Is URL correct (don't use localhost, use host IP)
- Is network connection normal
# Check Docker service on local machine docker-compose ps docker-compose logs curl http://localhost:8080
PM Conversation Examples
List Tests
- "Help me list all tests"
- "What tests are currently available?"
- "Show all test files and test cases"
Run Tests and Generate Report
- "Help me run all current tests and give me report"
- Execute:
(will automatically check Docker service)npm run test:remote
- Execute:
- "Run all tests and display results"
- Execute:
thennpm run test:remotenpx playwright show-report
- Execute:
- "Run tests and generate detailed report"
- Execute:
thennpm run test:remotenpx playwright show-report
- Execute:
Note: Need to set
DOCKER_SERVICE_URL environment variable before execution
Run Specific Tests
- "Run login feature tests"
- Execute:
python scripts/run_tests_remote.py all --test-file tests/e2e/login.spec.ts
- Execute:
- "Run shopping cart tests and display results"
- Execute:
python scripts/run_tests_remote.py all --test-file tests/e2e/shopping-cart.spec.ts
- Execute:
- "Run tests in UI mode"
- Execute:
(recommended, can see test process)npm run test:remote:ui
- Execute:
Generate Tests
- "Help me generate a test for new feature"
- "Write a test for product search feature"
- "Generate a test to verify users can modify profile"
- "Create a test to verify checkout process"
View Results
- "Show latest test results"
- "Did tests pass?"
- "If any tests failed, tell me what went wrong"
Project Structure
webapp-test-docker-demo/ ├── SKILL.md # Skill main file ├── scripts/ # Helper scripts │ ├── run_tests.py # Test execution script │ └── list_tests.py # List tests script ├── templates/ # Test templates │ └── test_template.spec.ts # Template for new tests ├── tests/e2e/ # Test files directory │ ├── login.spec.ts # Login test │ ├── logout.spec.ts # Logout test │ └── shopping-cart.spec.ts # Shopping cart test ├── src/ # Application source code │ ├── public/index.html # Frontend page │ └── server.js # HTTP server ├── playwright.config.ts # Playwright configuration ├── docker-compose.yml # Docker Compose configuration └── package.json # Project configuration
Important Notes
-
Docker Service Check:
- Default uses
mode, will automatically check if Docker service is runningtest:remote - Docker service should run in external environment (local machine or remote server)
- Sandbox cannot access
, must use host IP or port forwarding toollocalhost - Set
environment variable pointing to Docker serviceDOCKER_SERVICE_URL
- Default uses
-
Connection Methods:
- Method 1 (recommended): Use host IP address
# Find IP on local machine: ipconfig getifaddr en0 (macOS) export DOCKER_SERVICE_URL=http://192.168.1.100:8080 - Method 2: Use port forwarding tool (localtunnel/ngrok)
# On local machine: npx localtunnel --port 8080 export DOCKER_SERVICE_URL=https://your-tunnel-url.loca.lt
- Method 1 (recommended): Use host IP address
-
Wait Time: Dynamic applications need to wait for
statenetworkidle -
Test Isolation: Each test should be independent, not dependent on other tests' state
-
Docker Service Management: Docker service runs in external environment, no need to start/stop in Sandbox
Best Practices
- Use
attributes as selectors (more stable)data-testid - Use
to wait for page loadpage.waitForLoadState('networkidle') - Use descriptive test names
- Follow AAA pattern: Arrange → Act → Assert
- Appropriately use test tags (@smoke, @regression)
Reference Files
- Test Template:
- Template for new teststemplates/test_template.spec.ts - Existing Test Examples:
- Login test exampletests/e2e/login.spec.ts
- Logout test exampletests/e2e/logout.spec.ts
- Shopping cart test exampletests/e2e/shopping-cart.spec.ts