Open danielroek opened 1 year ago
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. Some texts were not found at the begining. After few hours digging in the code of Fluttium, Flutter and a lot of documentation reading, I made few widget tests and integration tests to reproduce the issue.
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 showSemanticsDebugger: true
in the material app.
The real problem to me is ability to find the good way to add semantics to each widget.
tooltip
helperText
which is confusing with label
and labelText
propertiessemanticsLabel
Semantics
widget does not work everytimeThe 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 SemanticNode
is .isInvisible
or has the SemantisFlag.isHidden
?
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 Fluttium
and some text were not found by Fluttium. (That's why I'm here).
When I run the same interface using showSemanticsDebugger: true
I got this result:
Enter file name
semantics label should also have a my_file.txt
label but does not.Extension dropdown
semantics label should also be visible between Enter a file name
and Select file button
File list
semantics label should be visible to identidy the ListViewNow 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