Use flutter_tools to start WebDriver browser.#49228
Use flutter_tools to start WebDriver browser.#49228fluttergithubbot merged 12 commits intoflutter:masterfrom
Conversation
| bool get supportsFastStart => false; | ||
|
|
||
| /// Whether the device is a web-platform device. | ||
| bool get isWebDevice => false; |
There was a problem hiding this comment.
Instead of adding isWebDevice you could check whether the target platform is web_javascript
…r Web instead of creating isWebDevice.
| factory FlutterDriver.connectedTo({ | ||
| FlutterWebConnection webConnection, | ||
| Browser browser, | ||
| bool supportTimelineAction, |
There was a problem hiding this comment.
This seems like a bit of a roundabout way to specify the web client. Could supportTimelineAction be inferred here?
There was a problem hiding this comment.
Fixed by wrapping it into FlutterWebConnection.
|
|
||
| setUpAll(() async { | ||
| driver = await FlutterDriver.connect(browser: true); | ||
| driver = await FlutterDriver.connect(); |
There was a problem hiding this comment.
You could expose a "supportsTImeline" getter on the driver, then you could wrap the TimelineSummary in that and merge this back with the other test script
There was a problem hiding this comment.
Discussed with Jonah offline. Going to keep this as it is for now so that we can verify flutter driver works with non-chrome browsers (testing on non-chrome browsers will throw exceptions when calling timeline-related actions).
Description
Previously, when running Flutter web driver test, test code is responsible for starting driver browser which is anti-flutter patter (it DOES follows webdriver test pattern). This PR is going to put driver initialization logic into flutter_tools to be consistent.
Tests
I added the following tests:
Added test cased to 'packages/flutter_tools/test/general.shard/web/devices_test.dart' to verify
ChromeDeviceandWebServerDevicewould return true forisWebDevice.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.