Merge pull request #103 from staats-google/patch-1
Add notifyListener flag to webdriver.dart.
diff --git a/lib/src/web_driver.dart b/lib/src/web_driver.dart
index 6d76839..19f03c2 100644
--- a/lib/src/web_driver.dart
+++ b/lib/src/web_driver.dart
@@ -23,6 +23,9 @@
final bool filterStackTraces;
Stepper stepper;
+ /// If true, WebDriver actions are recorded as [WebDriverCommandEvent]s.
+ bool notifyListeners = true;
+
final _onCommandController =
new StreamController<WebDriverCommandEvent>.broadcast();
@@ -226,15 +229,17 @@
exception = e;
return new Future.error(e, trace);
} finally {
- _onCommandController.add(new WebDriverCommandEvent(
- method: method,
- endPoint: command,
- params: params,
- startTime: startTime,
- endTime: new DateTime.now(),
- exception: exception,
- result: result,
- stackTrace: trace));
+ if (notifyListeners) {
+ _onCommandController.add(new WebDriverCommandEvent(
+ method: method,
+ endPoint: command,
+ params: params,
+ startTime: startTime,
+ endTime: new DateTime.now(),
+ exception: exception,
+ result: result,
+ stackTrace: trace));
+ }
}
}