mirror of
https://github.com/flutter/packages.git
synced 2025-06-05 10:57:11 +08:00
[ci] Add LUCI web platform tests (#4391)
Adds web platform tests for LUCI in bringup mode. The Cirrus version of the test starts `chromedriver` at the beginning and just leaves it running, which is fine since it's a fresh docker image each run. For LUCI we don't want that behavior though, so instead this adds tooling support for running chromedriver as part of running the integration tests, controllable with a flag. This will also be useful for running locally. Part of https://github.com/flutter/flutter/issues/114373
This commit is contained in:
@ -520,6 +520,54 @@ void main() {
|
||||
]));
|
||||
});
|
||||
|
||||
test('runs chromedriver when requested', () async {
|
||||
final RepositoryPackage plugin = createFakePlugin(
|
||||
'plugin',
|
||||
packagesDir,
|
||||
extraFiles: <String>[
|
||||
'example/integration_test/plugin_test.dart',
|
||||
'example/test_driver/integration_test.dart',
|
||||
'example/web/index.html',
|
||||
],
|
||||
platformSupport: <String, PlatformDetails>{
|
||||
platformWeb: const PlatformDetails(PlatformSupport.inline),
|
||||
},
|
||||
);
|
||||
|
||||
final Directory pluginExampleDirectory = getExampleDir(plugin);
|
||||
|
||||
final List<String> output = await runCapturingPrint(
|
||||
runner, <String>['drive-examples', '--web', '--run-chromedriver']);
|
||||
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<Matcher>[
|
||||
contains('Running for plugin'),
|
||||
contains('No issues found!'),
|
||||
]),
|
||||
);
|
||||
|
||||
expect(
|
||||
processRunner.recordedCalls,
|
||||
orderedEquals(<ProcessCall>[
|
||||
const ProcessCall('chromedriver', <String>['--port=4444'], null),
|
||||
ProcessCall(
|
||||
getFlutterCommand(mockPlatform),
|
||||
const <String>[
|
||||
'drive',
|
||||
'-d',
|
||||
'web-server',
|
||||
'--web-port=7357',
|
||||
'--browser-name=chrome',
|
||||
'--driver',
|
||||
'test_driver/integration_test.dart',
|
||||
'--target',
|
||||
'integration_test/plugin_test.dart',
|
||||
],
|
||||
pluginExampleDirectory.path),
|
||||
]));
|
||||
});
|
||||
|
||||
test('drives a web plugin with CHROME_EXECUTABLE', () async {
|
||||
final RepositoryPackage plugin = createFakePlugin(
|
||||
'plugin',
|
||||
|
Reference in New Issue
Block a user