بنقرة واحدة
test-runner
Run pytest + structured failure analysis. Trigger: run tests, run test, pytest, failure analysis, allure.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Run pytest + structured failure analysis. Trigger: run tests, run test, pytest, failure analysis, allure.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Incrementally add regression test points to an existing PageObject. Trigger: add test point, add regression point, add test point, increase coverage, extend page methods.
POM layering and context sharing decision tree. Trigger: architecture, layering, POM, Page Object, base class design, add new role.
Browser viewport / headless / timeout layered configuration. Trigger: viewport, browser config, navigation timeout, headless, slow_mo, incognito.
Under a shared page, a test case that leaves the start page must return via the UI and assert. Trigger: round-trip closure, case round trip, reset timeout, scope shared page.
AST knowledge graph: change review, exploration, debugging, refactoring. Trigger: knowledge graph, code review, impact analysis, blast radius, refactoring.
One-click generation of PageObject + matching tests. Trigger: new page, generate page, gen page, create page, add page object.
| name | test-runner |
| description | Run pytest + structured failure analysis. Trigger: run tests, run test, pytest, failure analysis, allure. |
⚠️ Must confirm
--envwith the user before running (see agent-behavior.md P0.2). Even ifconfig/settings.py::DEFAULT_ENV="prod"or the examples below show--env=<pre|prod>(examples ≠ defaults), you must still ask the user.
# Confirm virtual environment is activated
source .venv/bin/activate
# Confirm dependencies are installed
pip list | grep -E "playwright|pytest|allure"
All tests run against a real environment (URL + token).
Scenario: Verify after replacing locators, debug a single page regression point
# Corresponding role
pytest tests/<role>/test_<role>_flow.py --env=<pre|prod> -v -k "test_xxx"
# Corresponding role
pytest tests/<role>/test_<role>_home.py --env=<pre|prod> -v -k "test_<case_name>"
Scenario: Pre-release verification, complete regression
# Role A full regression
pytest tests/<roleA>/ --env=<pre|prod>
# Role B full regression
pytest tests/<roleB>/ --env=<pre|prod>
# Full regression
pytest tests/ --env=<pre|prod>
# Launch report server (available immediately after running tests)
allure serve reports/allure-results
# Generate static report (deployable)
allure generate reports/allure-results -o reports/allure-report --clean
tests/test_xxx.py::TestXxx::test_method PASSED → passed
tests/test_xxx.py::TestXxx::test_method FAILED → failed (needs analysis)
tests/test_xxx.py::TestXxx::test_method ERROR → fixture/setup exception
tests/test_xxx.py::TestXxx::test_method SKIPPED → skipped
After a run fails, diagnose by the following classification:
Signature:
TimeoutError: Timeout 10000ms exceeded.
waiting for locator("text=<feature name>")
Action: Trigger locator-replacer skill, use agent-browser to access the real page and re-extract locators (tool selection follows agent-behavior P0.4).
Signature:
TimeoutError: page.wait_for_load_state: Timeout 30000ms exceeded.
waiting for "networkidle"
Action:
DEFAULT_TIMEOUT (temporary measure)Signature:
AssertionError: <Page Name> failed to load
assert False
Action:
PAGE_IDENTIFIER locator is still validSignature:
AssertionError: Token login failed
Action:
config/settings.py is valid--env parameter is correctWhen a failure needs deeper investigation (locator failure, page structure change, etc.), consider entering quick-debug mode: jump directly to the problem page via token login-free access, avoiding re-running the full flow from login.
After a run completes, output a summary in the following format:
## Test Run Summary
**Run Mode:** Single story / Full main flow
**Environment:** pre / prod
**Time:** 2026-04-15 15:30
### Results
| Status | Count |
|------|------|
| PASSED | X |
| FAILED | X |
| ERROR | X |
| SKIPPED | X |
### Failure Details (if any)
| Test Case | Failure Type | Reason | Suggested Action |
|----------|---------|------|---------|
| test_xxx | A: Locator failure | text=xxx not unique | Use locator-replacer |
| test_yyy | D: Auth failure | token expired | Update settings.py |