
Closes https://github.com/flutter/flutter/issues/3149 Closes https://github.com/flutter/flutter/issues/3148
37 lines
1.1 KiB
Cheetah
37 lines
1.1 KiB
Cheetah
// This is a basic Flutter Driver test for the application. A Flutter Driver
|
|
// test is an end-to-end test that "drives" your application from another
|
|
// process or even from another computer. If you are familiar with
|
|
// Selenium/WebDriver for web, Espresso for Android or UI Automation for iOS,
|
|
// this is simply Flutter's version of that.
|
|
|
|
import 'package:flutter_driver/flutter_driver.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
void main() {
|
|
group('end-to-end test', () {
|
|
FlutterDriver driver;
|
|
|
|
setUpAll(() async {
|
|
// Connect to a running Flutter application instance.
|
|
driver = await FlutterDriver.connect();
|
|
});
|
|
|
|
tearDownAll(() async {
|
|
if (driver != null)
|
|
driver.close();
|
|
});
|
|
|
|
test('tap on the floating action button; verify counter', () async {
|
|
// Find floating action button (fab) to tap on
|
|
ObjectRef fab = await driver.findByTooltipMessage('Increment');
|
|
expect(fab, isNotNull);
|
|
|
|
// Tap on the fab
|
|
await driver.tap(fab);
|
|
|
|
// Wait for text to change to the desired value
|
|
expect(await driver.findByText('Button tapped 1 time.'), isNotNull);
|
|
});
|
|
});
|
|
}
|