django-selenium-functional-tests
Design, debug, and maintain Django Selenium functional tests with live server setup, explicit waits, test isolation, page objects, screenshots, CI artifacts, and staging checks. Use when browser tests are flaky, too slow, duplicated, failing in CI, need a page pattern, or should verify a Django user journey end to end.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- django-selenium-functional-tests
- license
- MIT
- metadata
- { "tags": "django,tdd,selenium,functional-tests,testing,browser", "version": "0.1.0", "category": "Django", "displayName": "Django Selenium Functional Tests" }
- description
- Design, debug, and maintain Django Selenium functional tests with live server setup, explicit waits, test isolation, page objects, screenshots, CI artifacts, and staging checks. Use when browser tests are flaky, too slow, duplicated, failing in CI, need a page pattern, or should verify a Django user journey end to end.
- compatibility
- Codex, Claude Code, and other Agent Skills-compatible clients.
02 资源文件 3
- 参考文档agents/openai.yaml233 B
- 参考文档evals/evals.json848 B
- 参考文档references/selenium-patterns.md2.2 KB
03 SKILL.md 正文
Django Selenium Functional Tests
Use Selenium functional tests sparingly and deliberately: they prove that Django, templates, static assets, JavaScript, persistence, and browser behavior work together. Keep them user-facing, isolated, and stable enough to inspire confidence.
Source Traceability
Primary source: Harry Percival, Test-Driven Development with Python, 3rd ed. Guidance is transformed and paraphrased from chapters 1, 2, 4, 6, 13, 22, 23, 25, 26, and Appendix A, especially explicit waits, functional test isolation, page pattern, screenshots, and CI debugging.
Workflow
-
State the user journey in comments or helper names.
- Keep test language at the user behavior level.
- Avoid asserting implementation details unless the browser contract requires them.
-
Use the right server boundary.
- Use
StaticLiveServerTestCasewhen static files matter. - Use a staging URL or Docker URL when verifying deployed/container behavior.
- Keep local and remote setup explicit.
- Use
-
Remove timing guesses.
- Prefer explicit waits for a visible condition, DOM change, URL, or text.
- Avoid
time.sleep()except as a temporary debugging probe that is removed.
-
Isolate state.
- Create per-test data through app APIs, fixtures, management commands, or direct setup helpers.
- Avoid tests depending on order, prior browser state, or shared accounts.
-
Factor repeated journeys.
- Start with helper methods.
- Move to a page pattern when selectors and workflows are repeated enough to obscure intent.
Read selenium-patterns.md for wait helpers, page pattern guidance, and CI debugging tactics.
Debugging Order
- Reproduce locally with the same browser/headless setting when possible.
- Capture the current URL, page source, browser logs, and screenshot.
- Decide whether the failure is timing, selector drift, server error, static asset issue, or data isolation.
- Add the smallest stable wait or assertion that matches the real condition.
- Run the single functional test, then the affected functional test file.
Guardrails
- Do not make Selenium prove every validation branch; faster Django tests should carry detail.
- Do not hide browser failures behind broad retry loops.
- Do not share mutable test accounts across parallel or CI runs.
- Do not assert brittle CSS layout unless layout is the behavior under test.
- Keep screenshots and artifacts for CI failures when they materially reduce diagnosis time.
Verification
Before finishing, confirm:
- The test names and helpers describe user behavior.
- All waits observe a real condition.
- The test can run alone.
- CI/headless-specific behavior is handled or documented.
- Focused command and result are recorded.
04 同仓库更多 Skills
worktable-review-with-annotations
Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.
worktable-find-and-synthesize-context
Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.
worktable-create-or-update-docs
Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.
worktable-create-or-manage-records
Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.
worktable-create-or-manage-interactive-html
Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.
worktable-collaborate-threads
Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.