-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into find-a-bus-for-child
- Loading branch information
Showing
6 changed files
with
185 additions
and
0 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
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,61 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import 'package:safe_ride_mobile/screens/login/SignUpDriver.dart'; | ||
import 'package:safe_ride_mobile/widgets/PopUp.dart'; | ||
|
||
void main() { | ||
testWidgets('validateFormFields returns correct validation messages', | ||
(WidgetTester tester) async { | ||
|
||
tester.view.devicePixelRatio = 1; | ||
tester.view.physicalSize = const Size(1200, 1200); | ||
|
||
// Build the MaterialApp with LoginPage. | ||
await tester.pumpWidget( | ||
MaterialApp( | ||
home: Scaffold( | ||
body: SignUpDriverPage(), | ||
), | ||
), | ||
); | ||
|
||
await tester.pumpAndSettle(); | ||
|
||
final driverfirstnameFinder = find.byKey(Key('driverfirstname')); | ||
final driverlastnameFinder = find.byKey(Key('driverlastname')); | ||
final driveremailFinder = find.byKey(Key('driveremail')); | ||
final drivernicFinder = find.byKey(Key('drivernic')); | ||
final drivermobileFinder = find.byKey(Key('drivermobile')); | ||
final driverpasswordFinder = find.byKey(Key('driverpassword')); | ||
final driverconpasswordFinder = find.byKey(Key('driverconpassword')); | ||
final driverbtnFinder = find.byKey(Key('driverbtn')); | ||
|
||
|
||
// Fill in the email and password fields | ||
await tester.tap(driverbtnFinder); | ||
await tester.pumpAndSettle(); | ||
|
||
expect(find.byType(BottomPopupBar), findsOneWidget); | ||
expect(find.text('All fields are required'), findsOneWidget); | ||
|
||
expect(find.text('Ok'), findsOneWidget); | ||
await tester.pumpAndSettle(); | ||
|
||
// await tester.enterText(emailFieldFinder, '[email protected]'); | ||
// await tester.pumpAndSettle(); | ||
// | ||
// expect(find.byType(BottomPopupBar), findsOneWidget); | ||
// expect(find.text('All fields are required'), findsOneWidget); | ||
// | ||
// expect(find.text('Ok'), findsOneWidget); | ||
// await tester.pumpAndSettle(); | ||
// | ||
// await tester.enterText(emailFieldFinder, ''); | ||
// await tester.enterText(passwordFieldFinder, '123456'); | ||
// await tester.pumpAndSettle(); | ||
// | ||
// expect(find.byType(BottomPopupBar), findsOneWidget); | ||
// expect(find.text('All fields are required'), findsOneWidget); | ||
}); | ||
} |
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,59 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:safe_ride_mobile/screens/login/SignUpDriverDoc.dart'; | ||
import 'package:safe_ride_mobile/widgets/PopUp.dart'; | ||
|
||
void main() { | ||
testWidgets('validateFormFields returns correct validation messages', | ||
(WidgetTester tester) async { | ||
|
||
tester.view.devicePixelRatio = 1; | ||
tester.view.physicalSize = const Size(1200, 800); | ||
|
||
// Build the MaterialApp with LoginPage. | ||
await tester.pumpWidget( | ||
MaterialApp( | ||
home: Scaffold( | ||
body: SignUpDriverDocPage(firstName: 'firstName', | ||
lastName: 'lastName', | ||
email: 'email', | ||
nic: 'nic', | ||
mobile: 'mobile', | ||
pass: 'pass'), | ||
), | ||
), | ||
); | ||
|
||
await tester.pumpAndSettle(); | ||
|
||
// final emailFieldFinder = find.byKey(Key('emailField')); | ||
// final passwordFieldFinder = find.byKey(Key('passwordField')); | ||
final signupdriverdocButtonFinder = find.byKey(Key('signupdriverdocButton')); | ||
|
||
// Fill in the email and password fields | ||
await tester.tap(signupdriverdocButtonFinder); | ||
await tester.pumpAndSettle(); | ||
|
||
expect(find.byType(BottomPopupBar), findsOneWidget); | ||
expect(find.text('All fields are required'), findsOneWidget); | ||
|
||
expect(find.text('Ok'), findsOneWidget); | ||
await tester.pumpAndSettle(); | ||
|
||
// await tester.enterText(emailFieldFinder, '[email protected]'); | ||
// await tester.pumpAndSettle(); | ||
// | ||
// expect(find.byType(BottomPopupBar), findsOneWidget); | ||
// expect(find.text('All fields are required'), findsOneWidget); | ||
// | ||
// expect(find.text('Ok'), findsOneWidget); | ||
// await tester.pumpAndSettle(); | ||
// | ||
// await tester.enterText(emailFieldFinder, ''); | ||
// await tester.enterText(passwordFieldFinder, '123456'); | ||
// await tester.pumpAndSettle(); | ||
// | ||
// expect(find.byType(BottomPopupBar), findsOneWidget); | ||
// expect(find.text('All fields are required'), findsOneWidget); | ||
}); | ||
} |
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,55 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:safe_ride_mobile/screens/login/SignUpDriverDoc.dart'; | ||
import 'package:safe_ride_mobile/screens/login/SignUpParent.dart'; | ||
import 'package:safe_ride_mobile/widgets/PopUp.dart'; | ||
|
||
void main() { | ||
testWidgets('validateFormFields returns correct validation messages', | ||
(WidgetTester tester) async { | ||
|
||
tester.view.devicePixelRatio = 1; | ||
tester.view.physicalSize = const Size(1200, 1500); | ||
|
||
// Build the MaterialApp with LoginPage. | ||
await tester.pumpWidget( | ||
MaterialApp( | ||
home: Scaffold( | ||
body: SignUpParentPage(), | ||
), | ||
), | ||
); | ||
|
||
await tester.pumpAndSettle(); | ||
|
||
// final emailFieldFinder = find.byKey(Key('emailField')); | ||
// final passwordFieldFinder = find.byKey(Key('passwordField')); | ||
final signupparentButtonFinder = find.byKey(Key('signupparentButton')); | ||
|
||
// Fill in the email and password fields | ||
await tester.tap(signupparentButtonFinder); | ||
await tester.pumpAndSettle(); | ||
|
||
expect(find.byType(BottomPopupBar), findsOneWidget); | ||
expect(find.text('All fields are required'), findsOneWidget); | ||
|
||
expect(find.text('Ok'), findsOneWidget); | ||
await tester.pumpAndSettle(); | ||
|
||
// await tester.enterText(emailFieldFinder, '[email protected]'); | ||
// await tester.pumpAndSettle(); | ||
// | ||
// expect(find.byType(BottomPopupBar), findsOneWidget); | ||
// expect(find.text('All fields are required'), findsOneWidget); | ||
// | ||
// expect(find.text('Ok'), findsOneWidget); | ||
// await tester.pumpAndSettle(); | ||
// | ||
// await tester.enterText(emailFieldFinder, ''); | ||
// await tester.enterText(passwordFieldFinder, '123456'); | ||
// await tester.pumpAndSettle(); | ||
// | ||
// expect(find.byType(BottomPopupBar), findsOneWidget); | ||
// expect(find.text('All fields are required'), findsOneWidget); | ||
}); | ||
} |
Submodule safe-ride-admin-web
added at
a40c84