-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
71 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,60 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
import 'package:nocodb/main.dart'; | ||
|
||
// https://github.com/flutter/flutter/issues/88765#issuecomment-1113140289 | ||
Future<void> waitFor( | ||
final WidgetTester tester, | ||
final Finder finder, { | ||
final Duration timeout = const Duration(seconds: 20), | ||
}) async { | ||
final end = DateTime.now().add(timeout); | ||
|
||
do { | ||
if (DateTime.now().isAfter(end)) { | ||
throw Exception('Timed out waiting for $finder'); | ||
} | ||
|
||
await tester.pumpAndSettle(); | ||
await Future.delayed(const Duration(milliseconds: 100)); | ||
} while (finder.evaluate().isEmpty); | ||
} | ||
|
||
void main() { | ||
HttpOverrides.global = null; | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
testWidgets('failing test example', (WidgetTester tester) async { | ||
expect(2 + 2, equals(5)); | ||
testWidgets('sign in', (final WidgetTester tester) async { | ||
await tester.pumpWidget( | ||
const ProviderScope( | ||
child: App(), | ||
), | ||
); | ||
await waitFor(tester, find.text('SIGN IN')); | ||
|
||
await tester.enterText( | ||
find.byKey(const ValueKey('email')), | ||
'enm10k@gmail.com', | ||
); | ||
await tester.enterText( | ||
find.byKey(const ValueKey('password')), | ||
'hogehoge', | ||
); | ||
await tester.enterText( | ||
find.byKey(const ValueKey('endpoint')), | ||
'http://10.0.2.2:8080', | ||
); | ||
await tester.tap( | ||
find.byKey(const ValueKey('sign_in_button')), | ||
); | ||
|
||
await tester.pumpAndSettle(); | ||
|
||
await waitFor(tester, find.text('Projects')); | ||
// expect(2 + 2, equals(5)); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
cd ~/Library/Android/sdk/emulator | ||
./emulator -avd $(emulator -list-avds | head -n 1) & | ||
|
This file was deleted.
Oops, something went wrong.