forked from flutter/flutter
-
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.
[web] Smoke tests for web engine (flutter#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 flutter#51084, flutter drive command can build and run a web app. Clean flutter run command from cirrus.yml * enable web
- Loading branch information
Nurhan Turgut
authored
Feb 24, 2020
1 parent
3411129
commit 9ba4eb0
Showing
5 changed files
with
117 additions
and
2 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
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,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(); | ||
} |
32 changes: 32 additions & 0 deletions
32
examples/hello_world/test_driver/smoke_web_engine_test.dart
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,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!'); | ||
}); | ||
}); | ||
} |