-
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.
Add minimum integration test & Fix links in RowEditor and
Remembet Me
- Loading branch information
Showing
15 changed files
with
169 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,5 @@ app.*.map.json | |
.fvm/flutter_sdk | ||
|
||
_nocodb | ||
|
||
integration_test/.env |
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,63 @@ | ||
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'; | ||
|
||
const NC_ENDPOINT = String.fromEnvironment('NC_ENDPOINT'); | ||
const NC_USER = String.fromEnvironment('NC_USER'); | ||
const NC_PASS = String.fromEnvironment('NC_PASS'); | ||
|
||
// 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('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')), | ||
NC_USER, | ||
); | ||
await tester.enterText( | ||
find.byKey(const ValueKey('password')), | ||
NC_PASS, | ||
); | ||
await tester.enterText( | ||
find.byKey(const ValueKey('endpoint')), | ||
NC_ENDPOINT, | ||
); | ||
await tester.tap( | ||
find.byKey(const ValueKey('sign_in_button')), | ||
); | ||
|
||
await tester.pumpAndSettle(); | ||
|
||
await waitFor(tester, find.text('Projects')); | ||
}); | ||
} |
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
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
Oops, something went wrong.