Files
sam-scenarios/process-management.json

366 lines
12 KiB
JSON
Raw Normal View History

{
"id": "process-management",
"name": "공정관리 테스트",
"screenshotPolicy": {
"onErrorOnly": true,
"captureOn": ["error", "fail", "timeout", "404", "500", "blocked"]
},
"description": "기준정보 관리 > 공정관리 페이지의 공정 등록/조회/수정/삭제 기능을 테스트하는 E2E 테스트",
"baseUrl": "https://dev.codebridge-x.com",
"url": "/master-data/process",
"navigation": {
"targetUrl": "/master-data/process-management",
"urlPattern": "/master-data/process-management|/ko/master-data/process-management|/master-data/process",
"menuHints": ["공정관리", "공정 관리", "기준정보 관리"]
},
"menuNavigation": {
"level1": "기준정보 관리",
"level2": "공정관리",
"expectedUrl": "/master-data/process"
},
"menuNavigationEnhanced": {
"strategy": "scroll-and-search",
"sidebar": {
"scrollContainer": ".sidebar-scroll",
"scrollStep": 200,
"maxScrollAttempts": 5,
"waitAfterScroll": 300
},
"level1": {
"text": "기준정보 관리",
"expandable": true,
"waitAfterClick": 500
},
"level2": {
"text": "공정관리",
"waitAfterClick": 300
},
"fallbackUrl": "/master-data/process",
"expectedUrl": "/master-data/process"
},
"timeout": 90000,
"tags": ["master-data", "process", "crud"],
"login": {
"url": "https://dev.codebridge-x.com/login",
"credentials": {
"id": "TestUser5",
"password": "password123!"
},
"successIndicator": "대시보드"
},
"testData": {
"process": {
"code": "P-E2E-001",
"name": "E2E 테스트 공정",
"type": "생산",
"department": "개발팀",
"workers": "2"
}
},
"steps": [
{
"id": "step-0",
"name": "사이드바 메뉴 전체 펼치기",
"description": "모두 펼치기 버튼을 클릭하여 전체 메뉴를 펼친 후 메뉴 탐색 준비",
"actions": [
{
"type": "evaluate",
"script": "document.querySelector('.sidebar-scroll')?.scrollTo({top:0,behavior:'instant'})"
},
{ "type": "wait", "duration": 300 },
{
"type": "evaluate",
"script": "Array.from(document.querySelectorAll('button')).find(b => b.innerText?.includes('모두 펼치기'))?.click()"
},
{ "type": "wait", "duration": 2000 }
],
"expect": {
"sidebarReady": true
}
},
{
"id": "step-1",
"name": "기준정보 관리 메뉴 진입",
"description": "기준정보 관리 > 공정관리 메뉴로 이동",
"actions": [
{
"type": "scrollAndFind",
"container": ".sidebar-scroll",
"target": "기준정보 관리",
"scrollStep": 200,
"maxAttempts": 5
},
{ "type": "click", "target": "기준정보 관리" },
{ "type": "wait", "duration": 500 },
{ "type": "click", "target": "공정관리" }
],
"expect": {
"url": "/master-data/process",
"visible": ["공정 목록", "공정 등록"]
},
"fallback": {
"type": "navigate",
"url": "/master-data/process"
}
},
{
"id": "step-2",
"name": "페이지 구조 확인",
"description": "통계 카드와 테이블 구조 확인",
"verify": {
"visible": ["전체", "사용중", "미사용"],
"tableColumns": ["번호", "공정코드", "공정명", "구분", "담당부서", "분류규칙", "인원", "상태"]
}
},
{
"id": "step-3",
"name": "탭 기능 확인",
"description": "전체/사용중/미사용 탭 동작 확인",
"actions": [
{ "type": "click", "target": "사용중", "role": "tab" },
{ "type": "wait", "duration": 300 },
{ "type": "click", "target": "미사용", "role": "tab" },
{ "type": "wait", "duration": 300 },
{ "type": "click", "target": "전체", "role": "tab" }
],
"expect": {
"tabsWork": true
}
},
{
"id": "step-4",
"name": "필수 검증 #2: 공정 등록 모달 열기",
"description": "공정 등록 버튼 클릭하여 모달 열기",
"actions": [
{ "type": "openModal", "target": "공정 등록", "description": "공정 등록 모달 열기" }
],
"modalConfig": {
"containerSelector": "[role='dialog'], .modal",
"animationDelay": 300,
"waitForSelector": "[role='dialog']"
},
"expect": {
"modal": "공정 등록",
"visible": ["공정코드", "공정명", "구분", "담당부서", "인원"]
}
},
{
"id": "step-5",
"name": "공정 등록 폼 입력",
"description": "모달 내 공정 정보 입력",
"actions": [
{ "type": "fillInModal", "target": "공정코드", "value": "{testData.process.code}", "options": { "waitAfter": 100 } },
{ "type": "fillInModal", "target": "공정명", "value": "{testData.process.name}", "options": { "waitAfter": 100 } },
{ "type": "selectInModal", "target": "구분", "value": "{testData.process.type}", "options": { "waitAfter": 200 } },
{ "type": "selectInModal", "target": "담당부서", "value": "{testData.process.department}", "options": { "waitAfter": 200 } },
{ "type": "fillInModal", "target": "인원", "value": "{testData.process.workers}", "options": { "waitAfter": 100 } }
]
},
{
"id": "step-6",
"name": "필수 검증 #2: 공정 등록 저장",
"description": "모달 내 등록 버튼 클릭하여 공정 저장",
"actions": [
{ "type": "clickInModal", "target": "등록", "options": { "waitAfter": 500 } }
],
"expect": {
"urlMaintained": true,
"noErrorPage": true,
"toast": ["등록", "완료", "성공"],
"modalClosed": true
},
"verify": {
"apiCall": "POST /api/master-data/process"
}
},
{
"id": "step-7",
"name": "필수 검증 #4: 등록 데이터 반영 확인",
"critical": true,
"note": "토스트 성공 메시지만으로 PASS 판정 불가. 실제 데이터 등록 확인 필수!",
"description": "테이블에서 등록된 공정 확인",
"verify": {
"tableContains": ["{testData.process.code}", "{testData.process.name}"],
"recordCountIncreased": true
}
},
{
"id": "step-8",
"name": "등록된 공정 상세 열기",
"description": "등록된 공정 항목 클릭하여 상세 보기",
"actions": [
{
"type": "findRow",
"contains": "{testData.process.name}",
"then": {
"type": "click",
"target": "row"
}
}
],
"expect": {
"modal": "공정 상세",
"visible": ["수정", "삭제"]
}
},
{
"id": "step-9",
"name": "공정 정보 수정",
"description": "모달 내 공정 정보 수정 테스트",
"actions": [
{ "type": "clickInModal", "target": "수정", "options": { "waitAfter": 300 } },
{ "type": "fillInModal", "target": "공정명", "value": "E2E 테스트 공정 수정", "options": { "waitAfter": 100 } },
{ "type": "clickInModal", "target": "저장", "options": { "waitAfter": 500 } }
],
"expect": {
"toast": ["수정", "완료", "성공"],
"modalClosed": true
}
},
{
"id": "step-10",
"name": "필수 검증 #4: 수정 데이터 반영 확인",
"critical": true,
"note": "토스트 성공 메시지만으로 PASS 판정 불가. 실제 데이터 변경 확인 필수!",
"description": "테이블에서 수정된 공정 확인",
"verify": {
"tableContains": "E2E 테스트 공정 수정"
}
},
{
"id": "step-11",
"name": "공정 삭제 준비",
"description": "삭제할 공정 선택",
"actions": [
{
"type": "findRow",
"contains": "E2E 테스트 공정 수정",
"then": {
"type": "click",
"target": "row"
}
}
],
"expect": {
"modal": "공정 상세",
"visible": ["삭제"]
}
},
{
"id": "step-12",
"name": "공정 삭제",
"description": "삭제 버튼 클릭하여 공정 삭제",
"actions": [
{ "type": "click", "target": "삭제" }
],
"expect": {
"confirmDialog": true,
"dialogText": ["삭제", "하시겠습니까"]
}
},
{
"id": "step-13",
"name": "삭제 확인",
"description": "삭제 확인 다이얼로그에서 확인 클릭",
"actions": [
{ "type": "click", "target": "확인" }
],
"expect": {
"toast": ["삭제", "완료", "성공"],
"modalClosed": true
}
},
{
"id": "step-14",
"name": "필수 검증 #4: 삭제 데이터 반영 확인",
"critical": true,
"note": "토스트 성공 메시지만으로 PASS 판정 불가. 실제 데이터 삭제 확인 필수!",
"description": "테이블에서 삭제된 공정이 없는지 확인",
"verify": {
"tableNotContains": "E2E 테스트 공정",
"recordCountDecreased": true
}
},
{
"id": "step-15",
"name": "날짜 필터 확인",
"description": "날짜 필터 버튼 동작 확인",
"actions": [
{ "type": "click", "target": "당월" },
{ "type": "wait", "duration": 300 }
],
"expect": {
"filterApplied": true,
"dataFiltered": true
}
}
],
"assertions": [
{
"type": "url",
"expected": "/master-data/process",
"message": "공정관리 페이지에 머물러야 함"
},
{
"type": "elementExists",
"selector": "button:has-text('공정 등록')",
"message": "공정 등록 버튼이 표시되어야 함"
}
],
"mandatoryVerifications": {
"description": "E2E_TEST_CONFIG.md 기준 필수 검증 항목",
"items": [
{
"id": 2,
"name": "등록/저장 버튼",
"trigger": "공정 등록 버튼",
"verification": "URL 유지 + 에러 페이지 없음 + 성공 토스트 + 데이터 반영",
"failCondition": "404/500 에러 페이지 이동"
},
{
"id": 4,
"name": "모달 등록 완료",
"trigger": "공정 등록 모달",
"verification": "실제 저장 동작 + 결과 확인",
"failCondition": "열기/닫기만 테스트"
},
{
"id": 5,
"name": "목업/미완성 페이지 감지",
"trigger": "페이지 로드 시",
"verification": "입력 필드 + 동작하는 버튼 + API 호출 확인",
"failCondition": "버튼만 있고 입력 불가, Console LOG만 출력"
}
]
},
"cleanup": {
"enabled": true,
"description": "테스트 중 생성된 공정 데이터 삭제",
"actions": [
{
"type": "deleteTestData",
"condition": "contains:E2E 테스트"
}
]
},
"notes": {
"testScope": "공정 등록 → 조회 → 수정 → 삭제 전체 CRUD 테스트",
"modalFields": {
"공정코드": "고유 코드",
"공정명": "공정 이름",
"구분": "생산/검사 등",
"담당부서": "담당 부서 선택",
"인원": "작업 인원 수"
},
"tableColumns": ["번호", "공정코드", "공정명", "구분", "담당부서", "분류규칙", "인원", "상태"],
"prerequisites": "로그인된 사용자에게 공정 관리 권한 필요"
}
}