Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
09fd46a1
Unverified
Commit
09fd46a1
authored
Feb 11, 2021
by
Han van Venrooij
Committed by
GitHub
Feb 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Widen getText support for RichText with multiple text spans in driver (#75603)
parent
a178bba5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
handler_factory.dart
packages/flutter_driver/lib/src/common/handler_factory.dart
+4
-3
extension_test.dart
...es/flutter_driver/test/src/real_tests/extension_test.dart
+13
-0
No files found.
packages/flutter_driver/lib/src/common/handler_factory.dart
View file @
09fd46a1
...
...
@@ -390,9 +390,10 @@ mixin CommandHandlerFactory {
text
=
(
widget
as
Text
).
data
;
}
else
if
(
widget
.
runtimeType
==
RichText
)
{
final
RichText
richText
=
widget
as
RichText
;
if
(
richText
.
text
.
runtimeType
==
TextSpan
)
{
text
=
(
richText
.
text
as
TextSpan
).
text
;
}
text
=
richText
.
text
.
toPlainText
(
includeSemanticsLabels:
false
,
includePlaceholders:
false
,
);
}
else
if
(
widget
.
runtimeType
==
TextField
)
{
text
=
(
widget
as
TextField
).
controller
?.
text
;
}
else
if
(
widget
.
runtimeType
==
TextFormField
)
{
...
...
packages/flutter_driver/test/src/real_tests/extension_test.dart
View file @
09fd46a1
...
...
@@ -599,6 +599,18 @@ void main() {
controller:
TextEditingController
(
text:
'Hello5'
),
),
),
Container
(
height:
25.0
,
child:
RichText
(
key:
const
ValueKey
<
String
>(
'text6'
),
text:
const
TextSpan
(
children:
<
TextSpan
>[
TextSpan
(
text:
'Hello'
),
TextSpan
(
text:
', '
),
TextSpan
(
text:
'World'
),
TextSpan
(
text:
'!'
),
]),
),
),
],
))
)
...
...
@@ -609,6 +621,7 @@ void main() {
expect
(
await
getTextInternal
(
ByValueKey
(
'text3'
)),
'Hello3'
);
expect
(
await
getTextInternal
(
ByValueKey
(
'text4'
)),
'Hello4'
);
expect
(
await
getTextInternal
(
ByValueKey
(
'text5'
)),
'Hello5'
);
expect
(
await
getTextInternal
(
ByValueKey
(
'text6'
)),
'Hello, World!'
);
// Check if error thrown for other types
final
Map
<
String
,
String
>
arguments
=
GetText
(
ByValueKey
(
'column'
),
timeout:
const
Duration
(
seconds:
1
)).
serialize
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment