본문으로 건너뛰기
cccskills
무료GitHub에 공개

testing

DraftForge test infrastructure for writing backend unit tests, Playwright E2E tests, and managing test data population. This skill should be used when writing new tests, adding test fixtures, creating populate functions for new features, adding Playwright E2E specs, using login/auth fixtures, creating test users/orgs/leagues/tournaments, or understanding the test data architecture. Covers backend Django tests via Docker, Playwright config (projects, workers, sharding), test auth endpoints that expose backend login to frontend, and feature-isolated test data patterns.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구DockerPlaywright
설치 방법 보기

포함된 파일(7)

  • SKILL.md5.2 KB
  • references/backend-test-endpoints.md7.1 KB
  • references/feature-isolation.md4.1 KB
  • references/mobile-iteration-workflow.md5.2 KB
  • references/playwright-config.md2.6 KB
  • references/playwright-fixtures.md10.8 KB
  • references/populate-system.md5.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

DraftForge Testing Infrastructure

Self-Updating

This skill documents live code. When modifying test infrastructure, update the relevant reference file. To verify current state, read the source files referenced in each section.

Critical Rules

  1. Always use data-testid selectors in Playwright tests and demos. Never use getByLabel, getByText, or getByRole('combobox') for element interaction. See playwright-fixtures.md for the full policy and exceptions.
  2. Use postWithCsrf/patchWithCsrf for all POST/PATCH calls to DRF ViewSet endpoints (not test endpoints). See playwright-fixtures.md for CSRF handling.

Architecture Overview

Two-layer test data system:

  1. Data definitions (backend/tests/data/) - Pydantic models (TestUser, TestOrganization, TestLeague, TestTeam, TestTournament)
  2. Populate functions (backend/tests/populate/) - Create DB records from data definitions

Backend exposes /api/tests/* endpoints (TEST=true only) so Playwright can login, reset state, and create test-specific data.

Key Principle: Feature-Isolated Test Data

Each feature's E2E tests MUST use dedicated test data. Never reuse another feature's org/league/tournament.

See references/feature-isolation.md for the full pattern.

Running Tests

# Backend (Docker - use --entrypoint "" to bypass daphne)
docker compose -f docker/docker-compose.test.yaml run --rm --entrypoint "" backend \
  python manage.py test app.tests.test_csv_import -v 2

# Playwright
just test::pw::headless              # All tests
just test::pw::spec csv-import       # Specific suite
just test::pw::ui                    # Interactive UI mode

# Full setup (down, update, build, populate, up)
just test::setup

# Repopulate test data only
just db::populate::all

Cacheops and Test State Resets

Django cacheops is active in the test environment (1-hour TTL for Organization, League, etc.). M2M changes (.add(), .remove(), .clear()) do NOT auto-invalidate cacheops cache.

When writing test reset endpoints or backend views that modify M2M fields:

from cacheops import invalidate_obj

org.admins.clear()
org.admins.add(admin_user)
invalidate_obj(org)  # REQUIRED after M2M changes

Without invalidate_obj(), subsequent GET requests return stale cached data — a common cause of flaky E2E tests where state resets appear to not take effect.

See references/backend-test-endpoints.md for the full pattern.

Reference Files

ReferenceWhen to read
populate-system.mdAdding test data, new populate functions, understanding data models
playwright-fixtures.mdWriting E2E tests, using login fixtures, auth patterns
backend-test-endpoints.mdAdding new test API endpoints, understanding backend-frontend test bridge
feature-isolation.mdCreating dedicated test data for a new feature's E2E tests
playwright-config.mdTest runner config, projects, workers, sharding, timeouts
mobile-iteration-workflow.mdIterating on mobile overflow / hydration regressions across the brand, ui-styling, i18n-react, playwright skills

Quick Reference: Current Test Data

EntityNamePKsteam_league_id
OrgDTX1-
OrgTest Organization2-
OrgCSV Import Org3-
OrgEvents Test Org7-
LeagueDTX League117929
LeagueTest League217930
LeagueCSV Import League317931
LeagueEvents Test League717935
UserPKRoleLogin fixture
kettleofketchup1001superuserloginAdmin()
hurk_1002staffloginStaff()
bucketoffish551003regularloginUser()
org_admin_tester1020org admin (org 1)loginOrgAdmin()
org_staff_tester1021org staff (org 1)loginOrgStaff()
league_admin_tester1030league adminloginLeagueAdmin()
league_staff_tester1031league staffloginLeagueStaff()
event_org_admin1080org admin (org 7)loginEventAdmin()
event_player_11081regularloginEventPlayer()

NOTE: When this table drifts from source, read backend/tests/data/users.py and backend/tests/data/organizations.py for truth.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

aesthetic

무료

Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

kettleofketchup/DraftForge152026년 10월 19일 업데이트

Proper usage of Bash and file operation tools. Use this skill when executing shell commands, writing files, or when tempted to use echo/cat/heredoc to pipe content to files. Prevents permission circumvention patterns like piping multiline content through echo instead of using Write tool. Covers Bash tool, Write tool, Edit tool, and Read tool best practices.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

kettleofketchup/DraftForge152026년 10월 19일 업데이트

brand

무료

DraftForge brand/theming review. Flags raw <button> over PrimaryButton/SecondaryButton, hardcoded violet/slate over brand tokens, inline styles, missing UserAvatar/EntityBreadcrumb.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

kettleofketchup/DraftForge152026년 10월 19일 업데이트

Browser automation, debugging, and performance analysis using Puppeteer CLI scripts. Use for automating browsers, taking screenshots, analyzing performance, monitoring network traffic, web scraping, form automation, and JavaScript debugging.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

kettleofketchup/DraftForge152026년 10월 19일 업데이트

Django Redis caching with django-cacheops. This skill should be used when implementing caching, adding cache invalidation, optimizing API performance, modifying models that affect cached data, or debugging cache-related issues in the Django backend.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

kettleofketchup/DraftForge152026년 10월 19일 업데이트

Frontend development guidelines for React/TypeScript applications. Modern patterns including Suspense, lazy loading, useSuspenseQuery, file organization with features directory, MUI v7 styling, TanStack Router, performance optimization, and TypeScript best practices. Use when creating components, pages, features, fetching data, styling, routing, or working with frontend code.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

kettleofketchup/DraftForge152026년 10월 19일 업데이트

kettleofketchup의 스킬 모두 보기

이 스킬의 문제 신고