-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp_test.dart
38 lines (30 loc) · 1.12 KB
/
app_test.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart';
void main() {
FlutterDriver driver;
setUpAll(() async {
driver = await FlutterDriver.connect();
});
tearDownAll(() {
driver?.close();
});
test('Test flutter driver health', () async {
final health = await driver.checkHealth();
expect(health.status, HealthStatus.ok);
});
test('Test first page is splash page', () async {
//splash page
await driver.waitFor(find.byValueKey('splash_page'));
await Future<void>.delayed(Duration(milliseconds: 7000));
await driver.waitForAbsent(find.byValueKey('splash_page'));
await driver.waitFor(find.byValueKey('login_page'));
await driver.tap(find.byValueKey('login_email_field'));
await driver.enterText('[email protected]');
await driver.waitFor(find.text('[email protected]'));
await driver.tap(find.byValueKey('login_pwd_field'));
await driver.enterText('123456');
await driver.tap(find.byValueKey('login_btn_idle'));
await driver.waitFor(find.byValueKey('login_snackbar'));
await Future<void>.delayed(Duration(milliseconds: 5000));
});
}