New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enableFlutterDriverExtension: optionally disable text entry emulation #71656
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@googlebot I fixed it. |
Could you consider using That already handles this use case, and going forward that's the library that the team is more focused on maintaining. |
Sorry, I checked Note: We're running E2E tests against pre-built .apk/.ipa and pre-deployed web -> without |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the doc needs a little work but overall this seems fine to me.
FYI @nturgut in case this might have some implication for Web testing that I'm missing.
I would like to understand more in details why we needed to enable emulation for text entry. Which platform is this for and what is use case? Does text entry emulation uses real platform channels? As Flutter for Web team, text editing is the area that lead us start writing integration tests. So far we haven't had any issues with text entry. I also think enabling emulation for default might lead developers to emulate text entry more. When we were designing e2e tests initially our goal was to provide a testing environment which will test the real (not simulated) code paths as much as possible. Such as real platform channels. |
My understanding is the goal is to allow developers to build the test application but be able to manually interact with it. |
I will happily explain this need a bit further:
Use case of disabling text entry emulation is related to how we test and release our product.
To all testing environments (dev & staging & validation/pre-live) we deploy versions with The problem applies for both platforms (mobile & web), though it's more painful for web, as for web the application is hosted (no way really to build locally without As you possibly can figure from above, we must do validation against pre-built applications instead of running tests in isolation from app codebase (for ex. by
I believe so, excerpt from FlutterDriver.setTextEntryEmulation documentation:
|
Looks like the documentation also clearly says If this is critical for your scenario, we can have it as an option, however the value of Is there a reason that you initially wanted to set it to |
@nturgut In current implementation (already before this change) it's Added comment to change that illustrates above-mentioned: https://github.com/flutter/flutter/pull/71656/files#r542194908
That is how |
@voobel thanks a lot for the explanation! Looks like I got that part wrong. PR looks good to me then 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM.
The flutter_svg failure in customer_testing is because of an engine roll that happened since you opened this PR. I'm going to land this as is because I'm fairly certain about that - if it fails on post we can revert and figure it out.
Description
Added option to
enableFlutterDriverExtension
so that it can be built without text entry emulation.Default selection remains as is (enabled text entry emulation).
The change is needed because we want to test also manually the builds that we deploy to test environments. With text entry emulation enabled it is impossible for us to do so.
In tests side having text entry emulation disabled by default causes no harm, as simply running
await driver.setTextEntryEmulation(enabled: true);
enables it for testing.In short: it will unblock manual testing with automation builds.
Related Issues
Issue that the change is alleviating/fixing: #9383
Tests
Conformed existing tests in
packages/flutter_driver/test/src/real_tests/extension_test.dart
and added 2 new tests to cover new parameter behavior:enableTextEntryEmulation false
verifies thatEnterText
fails whenenableTextEntryEmulation
is set asfalse
enableTextEntryEmulation true
verifies thatEnterText
fails whenenableTextEntryEmulation
is set astrue
Checklist
///
).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.