-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
fix: Unable to find text in some TextFields #308
Comments
Thanks for opening this issue! Are you able to find the text fields if you have an initial default value assigned to them? Fluttium should technically be able to find them using the provided label, as shown here. So I am curious if something is in the way of the semantics tree lookup (like the AnimatedSwitcher maybe?) |
Hi everyone I faced the same issue trying to make a first test using Fluttium on a Ubuntu Desktop Flutter app. The problem does not seems to be linked to Fluttium or Flutter. If can be reproduced with:
In fact, this is related to the semantics. I found a correlation between tests not finding text in widget tree and invisible semantics labels when running the app with The real problem to me is ability to find the good way to add semantics to each widget.
The only way to be sure is to try to run your app with the semantics debugger on MaterialApp(
showSemanticsDebugger: true,
//...
home: const MyHomePage(),
); Once the expected view appears in semantics mode with the label to find in your test, then Fluttium will find it. Hope it can help @danielroek @wolfenrain |
@PiotrFLEURY thanks for this information! When you mention "invisible semantics labels" do you mean that the Because Fluttium does have some logic to skip those to prevent false positive off nodes that are off-screen. |
Sometimes semantics labels can be hidden by another widget or missplaced. For instance, I'm investigating about a potential Flutter bug where semantics labels are not located at the same place thant their widget. Small example: I've created this dummy project trying few things about Flutter Desktop. https://github.com/PiotrFLEURY/bard_textedit I made a simple file picker like this: I tried to make small tests using When I run the same interface using
Now see what's happening if I just make ListView invisible:
In this example, Fluttium does not find the 3 weird semantics elements which is ok I guess ? |
Description
Not really sure if I'm doing something wrong here, but I'm running into an issue where in one field I am able to use
expectVisible
andpressOn
followed bywriteText
. But in a screen a bit later theexpectVisible
fails.Steps To Reproduce
My test yaml:
Expected Behavior
Unable the field containing
How do you want us to call you?
It is able to find the following three fields:
Screenshots
If applicable, add screenshots to help explain your problem.
Additional Context
I've tried putting
wait
s between the steps, as these are inside an AnimatedSwitcher. But that did not help. I am able to find the next and back button on the page, but not the text in the fields.Hoping anyone has any advice. Happy to help if some extra information is needed
The text was updated successfully, but these errors were encountered: