Use Async WebDriver for WebFlutterDriver.#50835
Use Async WebDriver for WebFlutterDriver.#50835fluttergithubbot merged 9 commits intoflutter:masterfrom
Conversation
|
Thanks a lot! This is great! |
|
FYI @zanderso |
|
|
||
| if (isWebPlatform) { | ||
| throwToolExit( | ||
| 'Flutter Driver (web) does not support running without use-existing-app.\n' |
There was a problem hiding this comment.
nit: 2 space indent on a continued line. Here and below.
| import 'dart:math' as math; | ||
|
|
||
| import 'package:webdriver/sync_io.dart' as sync_io; | ||
| import 'package:webdriver/async_io.dart' as async_io; |
| @@ -217,7 +244,7 @@ class DriveCommand extends RunCommandBase { | |||
| } | |||
| throwToolExit('CAUGHT EXCEPTION: $error\n$stackTrace'); | |||
There was a problem hiding this comment.
tool exits should give user-actionable information.
There was a problem hiding this comment.
Switched to throw.
| rethrow; | ||
| } | ||
| throwToolExit('CAUGHT EXCEPTION: $error\n$stackTrace'); | ||
| throw 'Unable to run test: $error\n$stackTrace'; |
There was a problem hiding this comment.
Make this throw an exception or error type instead of a String
| throw 'Unable to run test: $error\n$stackTrace'; | ||
| } finally { | ||
| driver?.quit(); | ||
| await driver?.quit(); |
There was a problem hiding this comment.
Is this where the 15 second timeout happens?
There was a problem hiding this comment.
Not really. The test process will take 15 seconds before exiting.
| y = int.parse(dimensions[1]); | ||
| } on FormatException catch (ex) { | ||
| throw FormatException(''' | ||
| Dimension provided is invalid. |
There was a problem hiding this comment.
This should probably be a tool exit. If you use ''' then you will pick up all the whitespace to the left, instead format it like:
throwToolExit('''
Dimension provided to --browser-dimension is invalid:
$ex
''');
| browser, | ||
| argResults['headless'].toString() == 'true', | ||
| ); | ||
| } catch (ex) { |
There was a problem hiding this comment.
on Exception or other specific type. As is, this will catch NoSuchMethodError and TypeError
Description
chromedriver --port=4444instead ofjava jar selenium-server-standalone-3.141.59.jar.Related Issues
#50144
#50146
Tests
I added the following tests:
Fixed test for drive_test.dart
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.