- 모든 서비스 메서드 시그니처를 실제 구현에 맞게 수정 - TestDataGenerator 제거하고 직접 객체 생성으로 변경 - 모델 필드명 및 타입 불일치 수정 - 불필요한 Either 패턴 사용 제거 - null safety 관련 이슈 해결 수정된 파일: - test/integration/screens/company_integration_test.dart - test/integration/screens/equipment_integration_test.dart - test/integration/screens/user_integration_test.dart - test/integration/screens/login_integration_test.dart
96 lines
2.8 KiB
Bash
Executable File
96 lines
2.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# 통합 테스트 실행 스크립트
|
|
# 실제 API를 호출하는 통합 테스트를 실행합니다.
|
|
|
|
echo "=========================================="
|
|
echo "Flutter Superport 통합 테스트 실행"
|
|
echo "=========================================="
|
|
echo ""
|
|
|
|
# 색상 정의
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m' # No Color
|
|
|
|
# 테스트 결과 변수
|
|
TOTAL_TESTS=0
|
|
PASSED_TESTS=0
|
|
FAILED_TESTS=0
|
|
|
|
# 환경 변수 체크
|
|
if [ ! -f ".env" ]; then
|
|
echo -e "${YELLOW}경고: .env 파일이 없습니다. 기본 설정을 사용합니다.${NC}"
|
|
fi
|
|
|
|
# 함수: 테스트 실행
|
|
run_test() {
|
|
local test_name=$1
|
|
local test_file=$2
|
|
|
|
echo -e "\n${YELLOW}[$test_name 테스트 실행]${NC}"
|
|
echo "파일: $test_file"
|
|
echo "----------------------------------------"
|
|
|
|
TOTAL_TESTS=$((TOTAL_TESTS + 1))
|
|
|
|
if flutter test "$test_file" --reporter expanded; then
|
|
echo -e "${GREEN}✓ $test_name 테스트 성공${NC}"
|
|
PASSED_TESTS=$((PASSED_TESTS + 1))
|
|
else
|
|
echo -e "${RED}✗ $test_name 테스트 실패${NC}"
|
|
FAILED_TESTS=$((FAILED_TESTS + 1))
|
|
fi
|
|
}
|
|
|
|
# 테스트 시작 시간
|
|
START_TIME=$(date +%s)
|
|
|
|
echo "테스트 환경 준비 중..."
|
|
echo ""
|
|
|
|
# 1. 로그인 테스트
|
|
run_test "로그인 화면" "test/integration/screens/login_integration_test.dart"
|
|
|
|
# 2. 회사 관리 테스트
|
|
run_test "회사 관리 화면" "test/integration/screens/company_integration_test.dart"
|
|
|
|
# 3. 장비 관리 테스트
|
|
run_test "장비 관리 화면" "test/integration/screens/equipment_integration_test.dart"
|
|
|
|
# 4. 사용자 관리 테스트
|
|
run_test "사용자 관리 화면" "test/integration/screens/user_integration_test.dart"
|
|
|
|
# 5. 라이선스 관리 테스트 (파일이 있는 경우)
|
|
if [ -f "test/integration/screens/license_integration_test.dart" ]; then
|
|
run_test "라이선스 관리 화면" "test/integration/screens/license_integration_test.dart"
|
|
fi
|
|
|
|
# 6. 창고 관리 테스트 (파일이 있는 경우)
|
|
if [ -f "test/integration/screens/warehouse_integration_test.dart" ]; then
|
|
run_test "창고 관리 화면" "test/integration/screens/warehouse_integration_test.dart"
|
|
fi
|
|
|
|
# 테스트 종료 시간
|
|
END_TIME=$(date +%s)
|
|
EXECUTION_TIME=$((END_TIME - START_TIME))
|
|
|
|
# 결과 요약
|
|
echo ""
|
|
echo "=========================================="
|
|
echo "통합 테스트 실행 완료"
|
|
echo "=========================================="
|
|
echo "총 테스트: $TOTAL_TESTS개"
|
|
echo -e "성공: ${GREEN}$PASSED_TESTS개${NC}"
|
|
echo -e "실패: ${RED}$FAILED_TESTS개${NC}"
|
|
echo "실행 시간: ${EXECUTION_TIME}초"
|
|
echo ""
|
|
|
|
if [ $FAILED_TESTS -eq 0 ]; then
|
|
echo -e "${GREEN}모든 통합 테스트가 성공했습니다! 🎉${NC}"
|
|
exit 0
|
|
else
|
|
echo -e "${RED}일부 테스트가 실패했습니다. 로그를 확인하세요.${NC}"
|
|
exit 1
|
|
fi |