432 lines
13 KiB
JSON
432 lines
13 KiB
JSON
{
|
|
"id": "card-add",
|
|
"name": "카드 등록 테스트 (랜덤 데이터)",
|
|
"screenshotPolicy": {
|
|
"onErrorOnly": true,
|
|
"captureOn": ["error", "fail", "timeout", "404", "500", "blocked"]
|
|
},
|
|
"description": "랜덤 카드 정보를 생성하여 법인카드를 등록하는 E2E 테스트",
|
|
"baseUrl": "https://dev.codebridge-x.com",
|
|
"url": "/ko/hr/card-management",
|
|
"menuNavigation": {
|
|
"level1": "인사관리",
|
|
"level2": "카드관리",
|
|
"expectedUrl": "/ko/hr/card-management"
|
|
},
|
|
"menuNavigationEnhanced": {
|
|
"strategy": "scroll-and-search",
|
|
"scrollContainer": ".sidebar-scroll",
|
|
"scrollStep": 200,
|
|
"maxScrollAttempts": 10,
|
|
"waitAfterScroll": 300,
|
|
"level1": {
|
|
"text": "인사관리",
|
|
"selector": "a:has-text('인사관리'), button:has-text('인사관리')",
|
|
"expandable": true
|
|
},
|
|
"level2": {
|
|
"text": "카드관리",
|
|
"selector": "a:has-text('카드관리')",
|
|
"waitAfterClick": 500
|
|
},
|
|
"fallbackUrl": "/ko/hr/card-management"
|
|
},
|
|
"timeout": 90000,
|
|
"tags": ["hr", "card", "crud", "random"],
|
|
|
|
"login": {
|
|
"url": "https://dev.codebridge-x.com/login",
|
|
"credentials": {
|
|
"id": "TestUser5",
|
|
"password": "password123!"
|
|
},
|
|
"successIndicator": "대시보드"
|
|
},
|
|
|
|
"randomData": {
|
|
"cardCompany": {
|
|
"type": "random",
|
|
"options": ["신한카드", "KB국민카드", "삼성카드", "현대카드", "롯데카드", "BC카드", "우리카드", "하나카드", "NH농협카드", "IBK기업은행"]
|
|
},
|
|
"cardNumber": {
|
|
"type": "composite",
|
|
"pattern": "{part1}-{part2}-{part3}-{part4}",
|
|
"components": {
|
|
"part1": { "type": "randomDigits", "length": 4 },
|
|
"part2": { "type": "randomDigits", "length": 4 },
|
|
"part3": { "type": "randomDigits", "length": 4 },
|
|
"part4": { "type": "randomDigits", "length": 4 }
|
|
}
|
|
},
|
|
"expiryDate": {
|
|
"type": "composite",
|
|
"pattern": "{month}{year}",
|
|
"components": {
|
|
"month": { "type": "random", "options": ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"] },
|
|
"year": { "type": "random", "options": ["27", "28", "29", "30"] }
|
|
}
|
|
},
|
|
"cardPassword": {
|
|
"type": "randomDigits",
|
|
"length": 2
|
|
},
|
|
"cardName": {
|
|
"type": "composite",
|
|
"pattern": "{prefix} 법인카드_{timestamp}",
|
|
"components": {
|
|
"prefix": {
|
|
"type": "random",
|
|
"options": ["영업용", "관리용", "개발팀", "마케팅", "경영지원", "연구소", "생산팀", "품질팀"]
|
|
}
|
|
}
|
|
},
|
|
"cardStatus": {
|
|
"type": "fixed",
|
|
"value": "사용"
|
|
}
|
|
},
|
|
|
|
"steps": [
|
|
{
|
|
"id": "step-0",
|
|
"name": "사이드바 준비",
|
|
"description": "사이드바를 최상단으로 스크롤하여 메뉴 탐색 준비",
|
|
"actions": [
|
|
{
|
|
"type": "evaluate",
|
|
"script": "document.querySelector('.sidebar-scroll')?.scrollTo({top:0,behavior:'instant'})"
|
|
},
|
|
{ "type": "wait", "duration": 500 }
|
|
]
|
|
},
|
|
{
|
|
"id": "step-1",
|
|
"name": "인사관리 메뉴 진입",
|
|
"description": "인사관리 > 카드관리 메뉴로 이동 (scrollAndFind 패턴)",
|
|
"actions": [
|
|
{
|
|
"type": "scrollAndFind",
|
|
"container": ".sidebar-scroll",
|
|
"target": "인사관리",
|
|
"scrollStep": 200,
|
|
"maxAttempts": 10,
|
|
"then": { "type": "click" }
|
|
},
|
|
{ "type": "wait", "duration": 300 },
|
|
{
|
|
"type": "scrollAndFind",
|
|
"container": ".sidebar-scroll",
|
|
"target": "카드관리",
|
|
"scrollStep": 200,
|
|
"maxAttempts": 10,
|
|
"then": { "type": "click" }
|
|
}
|
|
],
|
|
"expect": {
|
|
"url": "/hr/card-management",
|
|
"visible": ["카드관리", "카드 등록"]
|
|
},
|
|
"fallback": {
|
|
"type": "navigate",
|
|
"url": "/ko/hr/card-management"
|
|
}
|
|
},
|
|
{
|
|
"id": "step-2",
|
|
"name": "현재 카드 개수 저장",
|
|
"description": "테스트 전 카드 개수 기록",
|
|
"capture": {
|
|
"variable": "initialCount",
|
|
"selector": "전체 *",
|
|
"extract": "number"
|
|
}
|
|
},
|
|
{
|
|
"id": "step-3",
|
|
"name": "카드 등록 페이지 이동",
|
|
"description": "카드 등록 버튼 클릭하여 등록 페이지로 이동",
|
|
"actions": [
|
|
{ "type": "click", "target": "카드 등록" }
|
|
],
|
|
"expect": {
|
|
"url": "/hr/card-management?mode=new",
|
|
"visible": ["카드 등록", "기본 정보", "사용자 정보"]
|
|
}
|
|
},
|
|
{
|
|
"id": "step-4",
|
|
"name": "카드사 선택",
|
|
"description": "랜덤으로 선택된 카드사 선택",
|
|
"actions": [
|
|
{ "type": "click", "target": "카드사", "role": "combobox" },
|
|
{ "type": "click", "target": "{randomData.cardCompany}", "role": "option" }
|
|
],
|
|
"expect": {
|
|
"selected": "{randomData.cardCompany}"
|
|
}
|
|
},
|
|
{
|
|
"id": "step-5",
|
|
"name": "카드번호 입력",
|
|
"description": "랜덤으로 생성된 카드번호 입력",
|
|
"actions": [
|
|
{
|
|
"type": "fill",
|
|
"target": "카드번호",
|
|
"value": "{randomData.cardNumber}",
|
|
"placeholder": "1234-1234-1234-1234"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "step-6",
|
|
"name": "유효기간 입력",
|
|
"description": "랜덤으로 생성된 유효기간 입력 (MMYY 형식)",
|
|
"actions": [
|
|
{
|
|
"type": "fill",
|
|
"target": "유효기간",
|
|
"value": "{randomData.expiryDate}",
|
|
"placeholder": "MMYY"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "step-7",
|
|
"name": "카드 비밀번호 앞 2자리 입력",
|
|
"description": "랜덤으로 생성된 비밀번호 앞 2자리 입력",
|
|
"actions": [
|
|
{
|
|
"type": "fill",
|
|
"target": "카드 비밀번호 앞 2자리",
|
|
"value": "{randomData.cardPassword}",
|
|
"placeholder": "**"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "step-8",
|
|
"name": "카드명 입력",
|
|
"description": "랜덤으로 생성된 카드명 입력",
|
|
"actions": [
|
|
{
|
|
"type": "fill",
|
|
"target": "카드명",
|
|
"value": "{randomData.cardName}",
|
|
"placeholder": "카드명을 입력해주세요"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "step-9",
|
|
"name": "상태 확인",
|
|
"description": "카드 상태가 '사용'으로 기본 설정되어 있는지 확인",
|
|
"verify": {
|
|
"comboboxValue": {
|
|
"target": "상태",
|
|
"expected": "사용"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": "step-10",
|
|
"name": "카드 등록",
|
|
"description": "등록 버튼 클릭하여 카드 등록 완료",
|
|
"actions": [
|
|
{ "type": "click", "target": "등록" }
|
|
],
|
|
"waitFor": {
|
|
"type": "navigation",
|
|
"url": "/hr/card-management",
|
|
"timeout": 5000
|
|
},
|
|
"expect": {
|
|
"url": "/hr/card-management",
|
|
"toast": ["등록", "완료", "성공"]
|
|
}
|
|
},
|
|
{
|
|
"id": "step-11",
|
|
"name": "카드 등록 확인",
|
|
"description": "목록에서 새로 등록된 카드 확인",
|
|
"verify": {
|
|
"tableContains": "{randomData.cardName}",
|
|
"countIncreased": "{initialCount} + 1"
|
|
}
|
|
},
|
|
{
|
|
"id": "step-12",
|
|
"name": "등록된 카드 상세 페이지 이동",
|
|
"description": "등록된 카드를 클릭하여 상세 페이지로 이동",
|
|
"actions": [
|
|
{
|
|
"type": "findRow",
|
|
"contains": "{randomData.cardName}",
|
|
"then": {
|
|
"type": "click",
|
|
"target": "row",
|
|
"description": "해당 행 클릭하여 상세 페이지 이동"
|
|
}
|
|
}
|
|
],
|
|
"expect": {
|
|
"url": "/hr/card-management/{id}",
|
|
"visible": ["카드 상세", "수정", "삭제", "목록"]
|
|
}
|
|
},
|
|
{
|
|
"id": "step-13",
|
|
"name": "카드 수정 모드 전환",
|
|
"description": "수정 버튼 클릭하여 편집 모드로 전환",
|
|
"actions": [
|
|
{ "type": "click", "target": "수정" }
|
|
],
|
|
"expect": {
|
|
"url": "/hr/card-management/{id}?mode=edit",
|
|
"visible": ["카드 수정", "취소", "저장"]
|
|
}
|
|
},
|
|
{
|
|
"id": "step-14",
|
|
"name": "카드 정보 수정",
|
|
"description": "카드명 변경",
|
|
"actions": [
|
|
{
|
|
"type": "clear",
|
|
"target": "카드명"
|
|
},
|
|
{
|
|
"type": "fill",
|
|
"target": "카드명",
|
|
"value": "{randomData.cardName}_수정됨",
|
|
"description": "카드명 수정"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "step-15",
|
|
"name": "수정 저장",
|
|
"description": "수정된 카드 정보 저장",
|
|
"actions": [
|
|
{ "type": "click", "target": "저장" }
|
|
],
|
|
"waitFor": {
|
|
"type": "navigation",
|
|
"url": "/hr/card-management/{id}",
|
|
"timeout": 5000
|
|
},
|
|
"expect": {
|
|
"toast": ["수정", "완료", "성공", "저장"],
|
|
"url": "/hr/card-management/{id}"
|
|
}
|
|
},
|
|
{
|
|
"id": "step-15-1",
|
|
"name": "⚠️ 필수 검증: 수정 데이터 반영 확인",
|
|
"critical": true,
|
|
"note": "토스트 성공 메시지만으로 PASS 판정 불가. 실제 데이터 변경 확인 필수!",
|
|
"description": "상세 페이지에서 수정된 카드명 확인",
|
|
"verify": {
|
|
"fieldValue": {
|
|
"target": "카드명",
|
|
"expected": "{randomData.cardName}_수정됨"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": "step-16",
|
|
"name": "카드 삭제",
|
|
"description": "삭제 버튼 클릭하여 카드 삭제",
|
|
"actions": [
|
|
{ "type": "click", "target": "삭제" }
|
|
],
|
|
"expect": {
|
|
"confirmDialog": true,
|
|
"dialogText": ["삭제", "하시겠습니까"]
|
|
}
|
|
},
|
|
{
|
|
"id": "step-17",
|
|
"name": "삭제 확인",
|
|
"description": "삭제 확인 다이얼로그에서 확인 클릭",
|
|
"actions": [
|
|
{ "type": "click", "target": "확인", "description": "삭제 확인" }
|
|
],
|
|
"waitFor": {
|
|
"type": "navigation",
|
|
"url": "/hr/card-management",
|
|
"timeout": 5000
|
|
},
|
|
"expect": {
|
|
"toast": ["삭제", "완료", "성공"],
|
|
"url": "/hr/card-management"
|
|
}
|
|
},
|
|
{
|
|
"id": "step-18",
|
|
"name": "⚠️ 필수 검증: 삭제 데이터 반영 확인",
|
|
"critical": true,
|
|
"note": "토스트 성공 메시지만으로 PASS 판정 불가. 실제 데이터 삭제 확인 필수!",
|
|
"description": "목록에서 삭제된 카드가 없어졌는지 확인",
|
|
"verify": {
|
|
"tableNotContains": "{randomData.cardName}_수정됨",
|
|
"countDecreased": "{initialCount}"
|
|
}
|
|
}
|
|
],
|
|
|
|
"assertions": [
|
|
{
|
|
"type": "url",
|
|
"expected": "/hr/card-management",
|
|
"message": "등록 후 카드관리 페이지로 이동해야 함"
|
|
},
|
|
{
|
|
"type": "elementExists",
|
|
"selector": "text={randomData.cardName}",
|
|
"message": "등록된 카드가 목록에 표시되어야 함"
|
|
},
|
|
{
|
|
"type": "tableRow",
|
|
"contains": ["{randomData.cardCompany}", "{randomData.cardName}"],
|
|
"message": "카드사와 카드명이 테이블에 표시되어야 함"
|
|
}
|
|
],
|
|
|
|
"cleanup": {
|
|
"enabled": false,
|
|
"description": "테스트 후 생성된 카드 삭제 (필요시 활성화)",
|
|
"steps": [
|
|
{
|
|
"action": "delete",
|
|
"target": "{randomData.cardName}",
|
|
"description": "등록된 카드 삭제"
|
|
}
|
|
]
|
|
},
|
|
|
|
"notes": {
|
|
"testScope": "카드 등록 → 필수 정보 입력 → 등록 완료 → 목록 확인까지 전체 플로우 테스트",
|
|
"randomGeneration": {
|
|
"cardCompany": "10개 카드사 중 랜덤 선택",
|
|
"cardNumber": "4-4-4-4 형식의 랜덤 숫자",
|
|
"expiryDate": "MMYY 형식 (27~30년)",
|
|
"cardPassword": "2자리 랜덤 숫자",
|
|
"cardName": "prefix(영업용,관리용 등) + '법인카드' + timestamp"
|
|
},
|
|
"duplicateHandling": "timestamp 포함으로 중복 방지",
|
|
"prerequisites": "로그인된 사용자에게 카드 등록 권한 필요",
|
|
"formFields": {
|
|
"required": ["카드사", "카드번호", "유효기간", "카드 비밀번호 앞 2자리", "카드명"],
|
|
"optional": ["상태", "사용자 정보"],
|
|
"defaultValues": {
|
|
"상태": "사용"
|
|
}
|
|
},
|
|
"cardCompanyOptions": [
|
|
"신한카드", "KB국민카드", "삼성카드", "현대카드", "롯데카드",
|
|
"BC카드", "우리카드", "하나카드", "NH농협카드", "IBK기업은행"
|
|
]
|
|
}
|
|
}
|