[web] Smoke tests for web engine (#51003)

* smoke test for web

* fix comments and remove logs

* addressing reviewer comments

* fix analyzer issue

* running the test on cirrus

* cirrus yaml syntax error

* pub get for web_drivers

* go to the examples directory before running the flutter app

* cirrus is not able to find chromedriver. add a sleep to see if timing is the issue.

* run chrome driver in the background

* After PR #51084, flutter drive command can build and run a web app. Clean flutter run command from cirrus.yml

* enable web
This commit is contained in:
Nurhan Turgut
2020-02-24 13:09:21 -08:00
committed by GitHub
parent 3411129cc5
commit 9ba4eb04dd
5 changed files with 117 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_driver/driver_extension.dart';
import 'package:hello_world/main.dart' as app;
void main() {
enableFlutterDriverExtension();
app.main();
}

View File

@@ -0,0 +1,32 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
/// The following test is used as a simple smoke test for verfying Flutter
/// Framework and Flutter Web Engine integration.
void main() {
group('Hello World App', () {
final SerializableFinder titleFinder = find.byValueKey('title');
FlutterDriver driver;
// Connect to the Flutter driver before running any tests.
setUpAll(() async {
driver = await FlutterDriver.connect();
});
// Close the connection to the driver after the tests have completed.
tearDownAll(() async {
if (driver != null) {
driver.close();
}
});
test('title is correct', () async {
expect(await driver.getText(titleFinder), 'Hello, world!');
});
});
}