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
21b97504
Unverified
Commit
21b97504
authored
May 16, 2022
by
Yegor
Committed by
GitHub
May 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[web] do not swallow WebDriver errors (#103754)
parent
fe87538b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
20 deletions
+16
-20
web_driver.dart
packages/flutter_driver/lib/src/driver/web_driver.dart
+16
-20
No files found.
packages/flutter_driver/lib/src/driver/web_driver.dart
View file @
21b97504
...
...
@@ -294,34 +294,30 @@ class FlutterWebConnection {
/// Sends command via WebDriver to Flutter web application.
Future
<
dynamic
>
sendCommand
(
String
script
,
Duration
?
duration
)
async
{
dynamic
result
;
String
phase
=
'executing'
;
try
{
// Execute the script, which should leave the result in the `$flutterDriverResult` global variable.
await
_driver
.
execute
(
script
,
<
void
>[]);
}
catch
(
error
)
{
// We should not just arbitrarily throw all exceptions on the ground.
// This is probably hiding real errors.
// TODO(ianh): Determine what exceptions are expected here and handle those specifically.
}
try
{
result
=
await
waitFor
<
dynamic
>(
// Read the result.
phase
=
'reading'
;
final
dynamic
result
=
await
waitFor
<
dynamic
>(
()
=>
_driver
.
execute
(
r'return $flutterDriverResult'
,
<
String
>[]),
matcher:
isNotNull
,
timeout:
duration
??
const
Duration
(
days:
30
),
);
}
catch
(
error
)
{
//
We should not just arbitrarily throw all exceptions on the ground
.
// This is probably hiding real errors.
// TODO(ianh): Determine what exceptions are expected here and handle those specifically.
// Returns null if exception thrown.
return
null
;
}
finally
{
// Resets the result.
await
_driver
.
execute
(
r''
'
$flutterDriverResult
= null
'''
,
<
void
>[]
);
//
Reset the result to null to avoid polluting the results of future commands
.
phase
=
'resetting'
;
await
_driver
.
execute
(
r'$flutterDriverResult = null'
,
<
void
>[]);
return
result
;
}
catch
(
error
,
stackTrace
)
{
throw
DriverError
(
'Error while
$phase
FlutterDriver result for command:
$script
'
,
error
,
stackTrace
,
);
}
return
result
;
}
/// Gets performance log from WebDriver.
...
...
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