flutter-test-integrationlisted
Install: claude install-skill noory-code/noory-ai
# Flutter Integration Test
Test complete end-to-end app flows on real devices and emulators.
---
## Installation
```bash
flutter pub add 'dev:integration_test:{"sdk":"flutter"}'
```
---
## Folder Structure
```
lib/
main.dart
integration_test/ # separate from test/
app_test.dart
test_driver/ # required for web testing
integration_test.dart
```
---
## Quick Reference
### Basic Structure
```dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:my_app/main.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('E2E Test', () {
testWidgets('complete user flow', (tester) async {
// launch app
await tester.pumpWidget(const MyApp());
// test logic
expect(find.text('Home'), findsOneWidget);
await tester.tap(find.byKey(const Key('login_button')));
await tester.pumpAndSettle();
expect(find.text('Welcome'), findsOneWidget);
});
});
}
```
### Using Keys (Required)
```dart
// lib/main.dart
ElevatedButton(
key: const Key('submit_button'), // Key for finding the widget in tests
onPressed: _submit,
child: const Text('Submit'),
)
```
### Web Test Driver
```dart
// test_driver/integration_test.dart
import 'package:integration_test/integration_test_driver.dart';
Future<void> main() => integrationDriver();
```
---
## Running Tests
```bash
# mobil