test: 통합 테스트 오류 및 경고 수정
- 모든 서비스 메서드 시그니처를 실제 구현에 맞게 수정 - 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
This commit is contained in:
56
test/integration/automated/run_company_test.dart
Normal file
56
test/integration/automated/run_company_test.dart
Normal file
@@ -0,0 +1,56 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'company_automated_test.dart';
|
||||
import 'framework/core/api_error_diagnostics.dart';
|
||||
import 'framework/core/auto_fixer.dart';
|
||||
import 'framework/core/test_data_generator.dart';
|
||||
import 'framework/infrastructure/test_context.dart';
|
||||
import 'framework/infrastructure/report_collector.dart';
|
||||
import '../real_api/test_helper.dart';
|
||||
|
||||
void main() {
|
||||
group('Company Automated Test', () {
|
||||
late GetIt getIt;
|
||||
late CompanyAutomatedTest companyTest;
|
||||
|
||||
setUpAll(() async {
|
||||
await RealApiTestHelper.setupTestEnvironment();
|
||||
await RealApiTestHelper.loginAndGetToken();
|
||||
getIt = GetIt.instance;
|
||||
});
|
||||
|
||||
tearDownAll(() async {
|
||||
await RealApiTestHelper.teardownTestEnvironment();
|
||||
});
|
||||
|
||||
test('회사 관리 전체 자동화 테스트', () async {
|
||||
final testContext = TestContext();
|
||||
final errorDiagnostics = ApiErrorDiagnostics();
|
||||
final autoFixer = ApiAutoFixer();
|
||||
final dataGenerator = TestDataGenerator();
|
||||
final reportCollector = ReportCollector();
|
||||
|
||||
companyTest = CompanyAutomatedTest(
|
||||
apiClient: getIt.get(),
|
||||
getIt: getIt,
|
||||
testContext: testContext,
|
||||
errorDiagnostics: errorDiagnostics,
|
||||
autoFixer: autoFixer,
|
||||
dataGenerator: dataGenerator,
|
||||
reportCollector: reportCollector,
|
||||
);
|
||||
|
||||
await companyTest.initializeServices();
|
||||
|
||||
final metadata = companyTest.getScreenMetadata();
|
||||
final features = await companyTest.detectFeatures(metadata);
|
||||
final customFeatures = await companyTest.detectCustomFeatures(metadata);
|
||||
features.addAll(customFeatures);
|
||||
|
||||
final result = await companyTest.executeTests(features);
|
||||
|
||||
expect(result.failedTests, equals(0),
|
||||
reason: '${result.failedTests}개의 테스트가 실패했습니다');
|
||||
}, timeout: Timeout(Duration(minutes: 10)));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user