Skip to main content
skill CX Codex

qa-expert · personamanagmentlayer — Claude Code skill: testing, Selenium, pytest

qa-expert — a skill for test automation, QA strategy, and defect management across Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode.

Apache-2.0 184 installs ★ 45 updated 2026-10-12

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add personamanagmentlayer/pcl --skill qa-expert -a claude-code
Open on GitHub

What qa-expert does

Includes base classes for browser management, page-object models, and API test clients. Covers unit, integration, and acceptance testing with built-in fixtures for pytest, response validation, authentication, and rate-limit checks. Reduces boilerplate—focus on test logic instead of framework setup.

Offers complete test execution pipeline from case design to pass-rate reporting. Requires Python, pip, and pytest; add Selenium WebDriver and a browser driver for UI automation.

What it helps with

  • automate browser testing with Selenium and page-object pattern
  • validate REST API responses, status codes, and authentication flows
  • build a pytest test framework with fixtures and reporting
  • test rate limiting and response performance in API endpoints
  • design test strategy and track pass rates across suites

Example prompts for the agent

  • Set up Selenium test automation with page objects for a login workflow
  • Write API test suite to verify endpoints, status codes, and response structure
  • Configure pytest fixtures and generate test execution reports

How to install qa-expert

1Skills CLI (Vercel)

npx skills add personamanagmentlayer/pcl --skill qa-expert -a claude-code

2Manually: put the files in place

~/.claude/skills/qa-expert/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/qa-expert/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about qa-expert

How do I install qa-expert in Claude Code?

Run npx skills add personamanagmentlayer/pcl --skill qa-expert -a claude-code, then check ~/.claude/skills/qa-expert/SKILL.md.

What does qa-expert do?

Provides ready-made classes and examples for test automation: Selenium for UI tests, requests for API tests, page-object patterns, pytest fixtures, and reporting logic for status codes, authentication, and rate limits.

What dependencies does qa-expert require?

Python 3, pip, and pytest. For browser testing, add Selenium WebDriver and a browser driver (Chrome or Firefox). API tests work with requests alone.

Source text

SKILL.md · Apache-2.0
---
name: qa-expert
version: 2.0.0
description: >-
  Expert-level quality assurance, testing strategies, automation, and QA processes. Use
  when the user mentions testing, test automation, quality assurance, or Selenium, or when
  the task involves Testing Types, QA Processes, Test Strategy, or Defect Management.
category: qa
tags: [qa, testing, test-automation, quality-assurance, selenium]
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash(python:*, python3:*, pip:*, pytest:*)
---

# Quality Assurance Expert

Expert guidance for quality assurance, testing strategies, test automation, and QA best practices.

## Core Concepts

### Testing Types

- Unit testing
- Integration testing
- System testing
- Acceptance testing
- Regression testing
- Performance testing
- Security testing

### Test Automation

- Selenium WebDriver
- Cypress, Playwright
- API testing (Postman, REST Assured)
- Mobile testing (Appium)
- CI/CD integration
- Test frameworks (JUnit, pytest, Jest)

### QA Processes

- Test planning
- Test case design
- Defect management
- Test metrics and reporting
- Risk-based testing
- Exploratory testing

## Test Automation Framework

```python
import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from typing import Dict, List

class BasePage:
    """Base page object"""

    def __init__(self, driver):
        self.driver = driver
        self.wait = WebDriverWait(driver, 10)

    def find_element(self, locator):
        return self.wait.until(EC.presence_of_element_located(locator))

    def click(self, locator):
        element = self.find_element(locator)
        element.click()

    def type_text(self, locator, text):
        element = self.find_element(locator)
        element.clear()
        element.send_keys(text)

    def get_text(self, locator):
        element = self.find_element(locator)
        return element.text

class LoginPage(BasePage):
    """Login page object"""

    USERNAME_INPUT = (By.ID, "username")
    PASSWORD_INPUT = (By.ID, "password")
    LOGIN_BUTTON = (By.ID, "login-button")
    ERROR_MESSAGE = (By.CLASS_NAME, "error-message")

    def login(self, username: str, password: str):
        self.type_text(self.USERNAME_INPUT, username)
        self.type_text(self.PASSWORD_INPUT, password)
        self.click(self.LOGIN_BUTTON)

    def get_error_message(self):
        return self.get_text(self.ERROR_MESSAGE)

class TestRunner:
    """Test execution framework"""

    def __init__(self, browser: str = "chrome"):
        self.browser = browser
        self.driver = None
        self.results = []

    def setup(self):
        if self.browser == "chrome":
            options = webdriver.ChromeOptions()
            options.add_argument("--headless")
            self.driver = webdriver.Chrome(options=options)
        elif self.browser == "firefox":
            self.driver = webdriver.Firefox()

        self.driver.implicitly_wait(10)

    def teardown(self):
        if self.driver:
            self.driver.quit()

    def run_test(self, test_func, test_name: str):
        try:
            test_func()
            self.results.append({"test": test_name, "status": "PASS"})
        except Exception as e:
            self.results.append({
                "test": test_name,
                "status": "FAIL",
                "error": str(e)
            })

    def generate_report(self) -> Dict:
        total = len(self.results)
        passed = sum(1 for r in self.results if r["status"] == "PASS")
        failed = total - passed

        return {
            "total": total,
            "passed": passed,
            "failed": failed,
            "pass_rate": (passed / total * 100) if total > 0 else 0,
            "results": self.results
        }

# Pytest fixtures
@pytest.fixture
def driver():
    options = webdriver.ChromeOptions()
    options.add_argument("--headless")
    driver = webdriver.Chrome(options=options)
    yield driver
    driver.quit()

@pytest.fixture
def login_page(driver):
    driver.get("https://example.com/login")
    return LoginPage(driver)

# Test cases
def test_successful_login(login_page):
    login_page.login("testuser", "password123")
    assert "Dashboard" in login_page.driver.title

def test_invalid_credentials(login_page):
    login_page.login("invalid", "wrong")
    error = login_page.get_error_message()
    assert "Invalid credentials" in error
```

## API Testing

```python
import requests
from typing import Dict, Any

class APITestClient:
    """API testing client"""

    def __init__(self, base_url: str):
        self.base_url = base_url
        self.session = requests.Session()
        self.test_results = []

    def test_get_endpoint(self, endpoint: str, expected_status: int = 200,
                         expected_keys: List[str] = None) -> Dict:
        """Test GET endpoint"""
        url = f"{self.base_url}{endpoint}"
        response = self.session.get(url)

        result = {
            "endpoint": endpoint,
            "method": "GET",
            "status_code": response.status_code,
            "passed": response.status_code == expected_status
        }

        if expected_keys and response.status_code == 200:
            data = response.json()
            missing_keys = [k for k in expected_keys if k not in data]
            result["missing_keys"] = missing_keys
            result["passed"] = result["passed"] and len(missing_keys) == 0

        self.test_results.append(result)
        return result

    def test_post_endpoint(self, endpoint: str, payload: Dict,
                          expected_status: int = 201) -> Dict:
        """Test POST endpoint"""
        url = f"{self.base_url}{endpoint}"
        response = self.session.post(url, json=payload)

        result = {
            "endpoint": endpoint,
            "method": "POST",
            "status_code": response.status_code,
            "passed": response.status_code == expected_status,
            "response_time_ms": response.elapsed.total_seconds() * 1000
        }

        self.test_results.append(result)
        return result

    def test_authentication(self, login_endpoint: str,
                           credentials: Dict) -> bool:
        """Test API authentication"""
        response = self.session.post(
            f"{self.base_url}{login_endpoint}",
            json=credentials
        )

        if response.status_code == 200:
            token = response.json().get("token")
            if token:
                self.session.headers.update({"Authorization": f"Bearer {token}"})
                return True

        return False

    def test_rate_limiting(self, endpoint: str, requests_count: int = 100):
        """Test rate limiting"""
        url = f"{self.base_url}{endpoint}"
        rate_limited = False

        for i in range(requests_count):
            response = self.session.get(url)
            if response.status_code == 429:
                rate_limited = True
                break

        return {
            "rate_limited": rate_limited,
            "requests_before_limit": i if rate_limited else requests_count
        }
```

## Test Data Management

```python
import random
from faker import Faker
from typing import Dict, List

class TestDataGenerator:
    """Generate test data"""

    def __init__(self):
        self.faker = Faker()

    def generate_user(self) -> Dict:
        """Generate user test data"""
        return {
            "username": self.faker.user_name(),
            "email": self.faker.email(),
            "first_name": self.faker.first_name(),
            "last_name": self.faker.last_name(),
            "phone": self.faker.phone_number(),
            "address": {
                "street": self.faker.street_address(),
                "city": self.faker.city(),
                "state": self.faker.state(),
                "zip": self.faker.zipcode()
            }
        }

    def generate_users(self, count: int) -> List[Dict]:
        """Generate multiple users"""
        return [self.generate_user() for _ in range(count)]

    def generate_order(self, user_id: str) -> Dict:
        """Generate order test data"""
        return {
            "order_id": self.faker.uuid4(),
            "user_id": user_id,
            "items": [
                {
                    "product_id": self.faker.uuid4(),
                    "quantity": random.randint(1, 5),
                    "price": round(random.uniform(10, 500), 2)
                }
                for _ in range(random.randint(1, 5))
            ],
            "total": 0,  # Calculate based on items
            "status": random.choice(["pending", "processing", "shipped", "delivered"])
        }

    def generate_invalid_data(self, field: str) -> Any:
        """Generate invalid test data for boundary testing"""
        invalid_patterns = {
            "email": ["not-an-email", "missing@domain", "@nodomain.com"],
            "phone": ["123", "abc-def-ghij", "+++"],
            "zip": ["ABC", "123", "12345678"],
            "date": ["99/99/9999", "2023-13-45", "invalid"]
        }

        return random.choice(invalid_patterns.get(field, ["invalid"]))
```

## Defect Tracking

```python
from dataclasses import dataclass
from datetime import datetime
from enum import Enum

class Severity(Enum):
    CRITICAL = "critical"
    HIGH = "high"
    MEDIUM = "medium"
    LOW = "low"

class Priority(Enum):
    P0 = "p0"
    P1 = "p1"
    P2 = "p2"
    P3 = "p3"

@dataclass
class Defect:
    defect_id: str
    title: str
    description: str
    severity: Severity
    priority: Priority
    status: str
    reported_by: str
    assigned_to: str
    created_at: datetime
    environment: str
    steps_to_reproduce: List[str]
    expected_result: str
    actual_result: str

class DefectTracker:
    """Track and manage defects"""

    def __init__(self):
        self.defects: Dict[str, Defect] = {}

    def create_defect(self, defect: Defect) -> str:
        """Create new defect"""
        self.defects[defect.defect_id] = defect
        return defect.defect_id

    def update_status(self, defect_id: str, new_status: str):
        """Update defect status"""
        if defect_id in self.defects:
            self.defects[defect_id].status = new_status

    def get_critical_defects(self) -> List[Defect]:
        """Get all critical defects"""
        return [d for d in self.defects.values()
                if d.severity == Severity.CRITICAL and d.status != "closed"]

    def generate_metrics(self) -> Dict:
        """Generate defect metrics"""
        total = len(self.defects)
        by_severity = {}
        by_status = {}

        for defect in self.defects.values():
            severity = defect.severity.value
            status = defect.status

            by_severity[severity] = by_severity.get(severity, 0) + 1
            by_status[status] = by_status.get(status, 0) + 1

        return {
            "total_defects": total,
            "by_severity": by_severity,
            "by_status": by_status,
            "critical_open": len(self.get_critical_defects())
        }
```

## Best Practices

### Test Strategy

- Define clear test objectives
- Use risk-based testing
- Maintain test coverage metrics
- Automate regression tests
- Perform exploratory testing
- Test early and often
- Review and update test cases

### Automation

- Follow Page Object Model
- Make tests independent
- Use explicit waits
- Implement proper error handling
- Maintain test data separately
- Use CI/CD integration
- Monitor test stability

### Defect Management

- Write clear bug reports
- Include reproduction steps
- Attach screenshots/logs
- Prioritize appropriately
- Track to closure
- Analyze root causes
- Share lessons learned

## Anti-Patterns

❌ Testing only happy paths
❌ No test automation strategy
❌ Vague bug reports
❌ Testing without requirements
❌ Ignoring flaky tests
❌ No regression testing
❌ Testing in production only

## Resources

- Selenium: https://www.selenium.dev/
- Pytest: https://docs.pytest.org/
- Cypress: https://www.cypress.io/
- ISTQB: https://www.istqb.org/
- Test Automation University: https://testautomationu.applitools.com/

© personamanagmentlayer · Apache-2.0 · personamanagmentlayer/pcl

Similar skills

All skills for Testing and QA →

qa-expert by other authors comes first.

qa-expert daymade The qa-expert Claude Code skill organizes QA work and tracks test results. It kicks in for test-case writing, test-plan execution, and bug tracking. CX Codex +1 2,100installs qa-expert zhaono1 qa-expert — a skill for planning test coverage and setting up quality gates. Useful when you need to sort checks by risk level and CI stage. CX Codex +1 764installs test-automation-framework aj-geddes Designs test automation frameworks with Page Object Model, fixtures, and reporting. It kicks in when a test suite grows past the point where ad-hoc scripts stay maintainable. CX Codex +1 507installs improving-test-suites b-mendoza improving-test-suites is a Claude Code skill that reviews test suites and focuses them on important behavior. It activates for requests to trim, rewrite, review, or strengthen tests. CX Codex +1 119installs test-driven-development bobmatnyc test-driven-development — a testing skill for AI agents that enforces the Red-Green-Refactor loop, Arrange-Act-Assert patterns, naming conventions, and test coverage targets. CX Codex +1 409installs selenium-automation Mindrally selenium-automation — a skill that steers your coding agent toward solid Selenium WebDriver tests: Page Object Model, explicit waits, stable locators. CX Codex +1 1,300installs mabl mablhq Remote managed service that lets AI agents run mabl tests, inspect failure causes, and generate cloud suites from chat. CX Codex +1 bmad-tea bmad-code-org bmad-tea — a skill for Claude Code brings in Murat, a Master Test Architect persona. It activates when asking for the Test Architect to direct ATDD, test automation, and CI/CD quality gates. CX Codex +1 1,100installs

From the same set104

The whole set →
monitoring-expert monitoring-expert — a skill for setting up monitoring, metrics and alerting with Prometheus, Grafana, Loki and distributed tracing. Builds observability from scratch or clarifies the three pillars of observation. CX Codex +1 189installs audit-expert audit-expert guides code security reviews, vulnerability checks, and compliance audits for SOC 2, GDPR, HIPAA, and PCI-DSS. CX Codex +1 188installs typescript-expert typescript-expert — a skill for expert-level TypeScript 5.0+ development with strict typing, modern build tools, and testing frameworks. CX Codex +1 187installs ai-architect-expert ai-architect-expert — a skill for AI system design: training pipelines, feature stores, model registries and serving with metrics. Useful when a prototype outgrows the notebook. CX Codex +1 185installs istio-expert The istio-expert skill helps manage Istio traffic, mTLS, and observability in Kubernetes. Use it to inspect a mesh or work through access policies. CX Codex +1 184installs grpc-expert grpc-expert walks the agent through gRPC work: protobuf schemas, the four RPC styles, status codes, and the operational pieces such as load balancing and health checks. CX Codex +1 182installs media-expert media-expert — a skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode that gives the agent deep knowledge of media production, streaming, and broadcasting. CX Codex +1 182installs microservices-expert microservices-expert — a skill for microservices architecture, service communication, and distributed workflows. Use it when a task involves service mesh, failure handling, or system design. CX Codex +1 181installs

Project sponsors

Companies that keep this analytics open