Files
sam-scenarios/company-info.json

437 lines
14 KiB
JSON
Raw Normal View History

{
"id": "company-info",
"name": "설정 - 회사정보",
"description": "회사 정보 관리 기능 테스트 - 회사 정보 조회, 수정, 회사 추가 기능",
"baseUrl": "https://dev.codebridge-x.com",
"screenshotPolicy": {
"onErrorOnly": true,
"captureOn": ["error", "fail", "timeout", "404", "500", "blocked"]
},
"selectors": {
"pageTitle": "h1, h2, [class*='PageHeader'] h1, [class*='page-header'] h1",
"pageLayout": "[class*='PageLayout'], main",
"addCompanyBtn": "button:has-text('회사 추가')",
"editBtn": "button:has-text('수정')",
"saveBtn": "button:has-text('저장')",
"cancelBtn": "button:has-text('취소')",
"companyNameInput": "#companyName",
"representativeNameInput": "#representativeName",
"businessTypeInput": "#businessType",
"businessCategoryInput": "#businessCategory",
"emailInput": "#email",
"taxInvoiceEmailInput": "#taxInvoiceEmail",
"businessNumberInput": "#businessNumber",
"paymentBankInput": "#paymentBank",
"paymentAccountInput": "#paymentAccount",
"paymentAccountHolderInput": "#paymentAccountHolder",
"addressSearchBtn": "button:has-text('우편번호 찾기')",
"companyInfoCard": "[class*='Card']:has(h3:has-text('회사 정보'))",
"paymentInfoCard": "[class*='Card']:has(h3:has-text('결제 계좌 정보'))",
"dialog": "[role='dialog']",
"dialogTitle": "[role='dialog'] h2",
"dialogCancelBtn": "[role='dialog'] button:has-text('취소')",
"dialogNextBtn": "[role='dialog'] button:has-text('다음')",
"dialogBusinessNumberInput": "[role='dialog'] #businessNumber",
"alertDialog": "[role='alertdialog']",
"alertConfirmBtn": "[role='alertdialog'] button:has-text('확인')"
},
"navigation": {
"targetUrl": "/company-info",
"urlPattern": "/company-info|/ko/company-info",
"menuHints": ["회사정보", "회사 정보", "설정"]
},
"menuNavigation": {
"level1": "설정",
"level2": "회사정보",
"expectedUrl": "/company-info",
"searchWithinParent": true,
"closeOtherMenus": true
},
"auth": {
"username": "TestUser5",
"password": "password123!"
},
"expectedAPIs": [
{ "method": "GET", "path": "/api/v1/company-info", "description": "회사 정보 조회" },
{ "method": "PUT", "path": "/api/v1/company-info/:id", "description": "회사 정보 수정" },
{ "method": "POST", "path": "/api/v1/company-info", "description": "회사 추가" }
],
"steps": [
{
"id": 0,
"name": "사이드바 메뉴 전체 펼치기",
"description": "모두 펼치기 버튼 클릭 후 메뉴 탐색 준비",
"actions": [
{ "type": "scroll", "target": "sidebar", "direction": "top" },
{ "type": "wait", "duration": 300 },
{ "type": "evaluate", "script": "Array.from(document.querySelectorAll('button')).find(b => b.innerText?.includes('모두 펼치기'))?.click()" },
{ "type": "wait", "duration": 2000 }
]
},
{
"id": 1,
"name": "1차 메뉴 클릭: 설정",
"description": "사이드바에서 설정 메뉴 찾아 클릭",
"actions": [
{
"type": "scrollAndFind",
"target": "설정",
"alternativeTexts": ["설정", "Settings", "환경설정"],
"scrollContainer": "sidebar",
"maxAttempts": 10
},
{ "type": "wait", "duration": 300 },
{ "type": "click_if_exists", "target": "설정" },
{ "type": "wait", "duration": 500 }
]
},
{
"id": 2,
"name": "2차 메뉴 클릭: 회사정보",
"description": "서브메뉴에서 회사정보 클릭",
"actions": [
{
"type": "scrollAndFind",
"target": "회사정보",
"alternativeTexts": ["회사정보", "회사 정보"],
"scrollContainer": "submenu",
"maxAttempts": 5
},
{ "type": "wait", "duration": 200 },
{ "type": "click_if_exists", "target": "회사정보" },
{ "type": "wait", "duration": 3000 }
]
},
{
"id": 3,
"name": "페이지 URL 검증",
"description": "회사정보 페이지 URL 확인",
"actions": [
{ "type": "verify_url", "pattern": "/company-info" }
]
},
{
"id": 4,
"name": "페이지 제목 검증",
"description": "페이지 제목이 '회사정보'인지 확인",
"actions": [
{
"type": "verify_element",
"selector": "h1, h2, [class*='PageHeader'] h1",
"contains": "회사정보"
}
]
},
{
"id": 5,
"name": "회사 추가 버튼 존재 확인",
"description": "'회사 추가' 버튼이 화면에 존재하는지 확인",
"actions": [
{
"type": "verify_element",
"selector": "button",
"contains": "회사 추가"
}
]
},
{
"id": 6,
"name": "수정 버튼 존재 확인",
"description": "'수정' 버튼이 화면에 존재하는지 확인",
"actions": [
{
"type": "verify_element",
"selector": "button",
"contains": "수정"
}
]
},
{
"id": 7,
"name": "회사명 입력 필드 확인",
"description": "#companyName 입력 필드가 존재하고 비활성화 상태인지 확인",
"actions": [
{
"type": "verify_element",
"selector": "#companyName"
},
{
"type": "evaluate",
"script": "const el = document.querySelector('#companyName'); return { exists: !!el, disabled: el?.disabled, value: el?.value };"
}
]
},
{
"id": 8,
"name": "대표자명 입력 필드 확인",
"description": "#representativeName 입력 필드 존재 확인",
"actions": [
{
"type": "verify_element",
"selector": "#representativeName"
}
]
},
{
"id": 9,
"name": "업태 입력 필드 확인",
"description": "#businessType 입력 필드 존재 확인",
"actions": [
{
"type": "verify_element",
"selector": "#businessType"
}
]
},
{
"id": 10,
"name": "업종 입력 필드 확인",
"description": "#businessCategory 입력 필드 존재 확인",
"actions": [
{
"type": "verify_element",
"selector": "#businessCategory"
}
]
},
{
"id": 11,
"name": "이메일 입력 필드 확인",
"description": "#email 입력 필드 존재 확인",
"actions": [
{
"type": "verify_element",
"selector": "#email"
}
]
},
{
"id": 12,
"name": "사업자등록번호 입력 필드 확인",
"description": "#businessNumber 입력 필드 존재 확인",
"actions": [
{
"type": "verify_element",
"selector": "#businessNumber"
}
]
},
{
"id": 13,
"name": "조회 모드 - 필드 비활성화 상태 검증",
"description": "수정 버튼 클릭 전 모든 필드가 disabled 상태인지 확인",
"actions": [
{
"type": "evaluate",
"script": "const fields = ['#companyName', '#representativeName', '#businessType', '#businessCategory', '#email', '#businessNumber']; const results = fields.map(sel => { const el = document.querySelector(sel); return { selector: sel, disabled: el?.disabled ?? false }; }); const allDisabled = results.every(r => r.disabled); return { allDisabled, results };"
}
]
},
{
"id": 14,
"name": "[UPDATE] 수정 버튼 클릭",
"phase": "UPDATE",
"description": "수정 모드 진입",
"actions": [
{ "type": "click_button", "text": "수정" },
{ "type": "wait", "duration": 500 }
]
},
{
"id": 15,
"name": "[UPDATE] 수정 모드 - 필드 활성화 검증",
"phase": "UPDATE",
"description": "수정 모드에서 입력 필드들이 활성화되었는지 확인",
"actions": [
{
"type": "evaluate",
"script": "const fields = ['#companyName', '#representativeName', '#businessType', '#businessCategory']; const results = fields.map(sel => { const el = document.querySelector(sel); return { selector: sel, disabled: el?.disabled ?? true }; }); const anyEnabled = results.some(r => !r.disabled); return { anyEnabled, results };"
}
]
},
{
"id": 16,
"name": "[UPDATE] 저장/취소 버튼 표시 확인",
"phase": "UPDATE",
"description": "수정 모드에서 저장, 취소 버튼이 표시되는지 확인",
"actions": [
{
"type": "verify_element",
"selector": "button",
"contains": "저장"
},
{
"type": "verify_element",
"selector": "button",
"contains": "취소"
}
]
},
{
"id": 17,
"name": "[UPDATE] 업태 필드 값 변경",
"phase": "UPDATE",
"description": "업태 필드에 테스트 값 입력",
"actions": [
{ "type": "clear", "selector": "#businessType" },
{ "type": "fill", "selector": "#businessType", "value": "E2E_TEST_업태" }
]
},
{
"id": 18,
"name": "[UPDATE] 저장 버튼 클릭",
"phase": "UPDATE",
"description": "수정된 회사 정보 저장",
"actions": [
{ "type": "click_button", "text": "저장" },
{ "type": "wait", "duration": 2000 }
]
},
{
"id": 19,
"name": "[UPDATE] 저장 성공 토스트 확인",
"phase": "UPDATE",
"description": "저장 성공 메시지 토스트 확인",
"actions": [
{
"type": "verify_toast",
"contains": ["저장", "완료", "성공"]
}
]
},
{
"id": 20,
"name": "[UPDATE] 수정 데이터 반영 확인",
"phase": "UPDATE",
"description": "변경된 업태 값이 필드에 반영되었는지 확인",
"critical": true,
"actions": [
{
"type": "verify_input_value",
"selector": "#businessType",
"contains": "E2E_TEST_업태"
}
]
},
{
"id": 21,
"name": "회사 추가 다이얼로그 열기",
"description": "회사 추가 버튼 클릭하여 다이얼로그 표시",
"actions": [
{ "type": "click_button", "text": "회사 추가" },
{ "type": "wait", "duration": 500 }
]
},
{
"id": 22,
"name": "회사 추가 다이얼로그 표시 검증",
"description": "다이얼로그가 열리고 제목이 '회사 추가'인지 확인",
"actions": [
{
"type": "verify_element",
"selector": "[role='dialog']"
},
{
"type": "verify_element",
"selector": "[role='dialog'] h2",
"contains": "회사 추가"
}
]
},
{
"id": 23,
"name": "다이얼로그 내 사업자등록번호 입력 필드 확인",
"description": "다이얼로그 내 #businessNumber 입력 필드 존재 확인",
"actions": [
{
"type": "verify_element",
"selector": "[role='dialog'] #businessNumber"
}
]
},
{
"id": 24,
"name": "다이얼로그 내 취소/다음 버튼 확인",
"description": "취소, 다음 버튼 존재 확인",
"actions": [
{
"type": "evaluate",
"script": "const dialog = document.querySelector('[role=\"dialog\"]'); if (!dialog) return { error: 'Dialog not found' }; const buttons = Array.from(dialog.querySelectorAll('button')).map(b => b.innerText.trim()); return { buttons, hasCancel: buttons.includes('취소'), hasNext: buttons.includes('다음') };"
}
]
},
{
"id": 25,
"name": "다이얼로그 사업자등록번호 입력",
"description": "10자리 사업자등록번호 입력",
"actions": [
{ "type": "fill", "selector": "[role='dialog'] #businessNumber", "value": "1234567890" },
{ "type": "wait", "duration": 300 }
]
},
{
"id": 26,
"name": "다이얼로그 다음 버튼 활성화 확인",
"description": "10자리 입력 후 다음 버튼이 활성화되는지 확인",
"actions": [
{
"type": "evaluate",
"script": "const dialog = document.querySelector('[role=\"dialog\"]'); const nextBtn = Array.from(dialog?.querySelectorAll('button') || []).find(b => b.innerText.includes('다음')); return { disabled: nextBtn?.disabled ?? true, text: nextBtn?.innerText };"
}
]
},
{
"id": 27,
"name": "다이얼로그 취소 클릭",
"description": "취소 버튼 클릭하여 다이얼로그 닫기",
"actions": [
{
"type": "evaluate",
"script": "const dialog = document.querySelector('[role=\"dialog\"]'); const cancelBtn = Array.from(dialog?.querySelectorAll('button') || []).find(b => b.innerText.includes('취소')); cancelBtn?.click(); return { clicked: !!cancelBtn };"
},
{ "type": "wait", "duration": 500 }
]
},
{
"id": 28,
"name": "다이얼로그 닫힘 확인",
"description": "다이얼로그가 닫혔는지 확인",
"actions": [
{
"type": "evaluate",
"script": "const dialog = document.querySelector('[role=\"dialog\"]'); return { dialogClosed: !dialog || dialog.offsetParent === null };"
}
]
},
{
"id": 29,
"name": "[CLEANUP] 업태 필드 원래 값 복구",
"phase": "CLEANUP",
"description": "테스트 데이터 정리 - 업태 필드 원복",
"actions": [
{ "type": "click_button", "text": "수정" },
{ "type": "wait", "duration": 500 },
{ "type": "clear", "selector": "#businessType" },
{ "type": "fill", "selector": "#businessType", "value": "업태명" },
{ "type": "click_button", "text": "저장" },
{ "type": "wait", "duration": 2000 }
]
}
],
"notes": [
"직접 URL 접근 금지: 반드시 메뉴 클릭으로 페이지 진입 (404 방지)",
"스크롤 필수: 사이드바가 길 경우 메뉴가 화면 밖에 있을 수 있음",
"메뉴 계층: 설정 > 회사정보",
"주요 필드 ID: #companyName, #representativeName, #businessType, #businessCategory, #email, #businessNumber",
"수정 모드: 수정 버튼 클릭 시 필드 활성화, 저장/취소 버튼 표시"
]
}