AgentSkillsCN

green-selenium

实现用例代码,使一项已禁用的测试顺利通过(TDD绿色阶段)。读取测试,实现最小化的生产代码,启用测试,验证测试结果为绿色。在用户想要实现用例逻辑,或提及“/green-usecase”命令时使用此功能。

SKILL.md
--- frontmatter
name: green-selenium
description: Enable a disabled Selenium test and verify it passes (TDD green phase). Checks prerequisites, removes @Disabled, runs browser test, confirms GREEN state. Use when user wants to verify Selenium test implementation or mentions /green-selenium command.

/green-selenium - Verify Selenium Browser Test (Green Phase)

Orchestrates green-agent for selenium layer.

Usage

code
/green-selenium "Story name" "Scenario name"
/green-selenium "RegistrationUiTest" "userSeesRegistrationForm"
/green-selenium                                        # Interactive selection

Prerequisites

Before enabling Selenium test, ensure:

  1. Frontend logic implemented (all /green-frontend tests pass)
  2. Frontend API client implemented (all /green-frontend-api tests pass)
  3. Backend running (/run-backend)
  4. Frontend running (/run-frontend)
  5. React component renders correctly with all data-testid attributes

Workflow

  1. Parse user input (test class, method name)
  2. Load agent instructions from .claude/agents/green-agent.md
  3. Execute the following steps:
    • Find disabled test in acceptance/app-acceptance/
    • Read test (understand expectations) - READ-ONLY
    • Verify prerequisites: logic + API tests pass, backend + frontend running
    • Remove @Disabled annotation (ONLY allowed test change)
    • Run test using Skill tool: skill="test-acceptance", args="frontend {TestClassName}"
    • Verify GREEN state
    • If FAILED: re-add @Disabled and analyze failure
      • May need to implement React component changes
      • May need to add missing data-testid attributes
      • May need to fix routing or navigation
  4. Return result summary

Key Rules

  • TESTS ARE READ-ONLY - only remove @Disabled
  • If test fails, re-add @Disabled and report what needs fixing
  • Must have backend AND frontend running before test execution
  • All frontend logic and API tests must pass before attempting
  • Use Skill tool for test execution (not gradle directly)

Story Mapping

#Story
01Login/Logout
02Registration
03Password Reset
04Connect Calendar
05Create Task
06Edit Task
07Delete Task
08Archive/Restore Task
09Task Detail View
10Activity Log
11Dashboard
12Billing & Subscription

Next Step

After green phase: commit or /refactor