Switch dartdoc to /// style
diff --git a/lib/src/alert.dart b/lib/src/alert.dart
index 65601fe..3a6d8b9 100644
--- a/lib/src/alert.dart
+++ b/lib/src/alert.dart
@@ -6,43 +6,31 @@
/// A JavaScript alert(), confirm(), or prompt() dialog
class Alert extends _WebDriverBase {
- /**
- * The text of the JavaScript alert(), confirm(), or
- * prompt() dialog.
- */
+ /// The text of the JavaScript alert(), confirm(), or prompt() dialog.
final String text;
Alert._(this.text, driver) : super(driver, '');
- /**
- * Accepts the currently displayed alert (may not be the alert for which
- * this object was created).
- *
- * Throws [WebDriverError] no such alert exception if there isn't currently an
- * alert.
- */
+ /// Accepts the currently displayed alert (may not be the alert for which this
+ /// object was created).
+ ///
+ /// Throws [NoSuchAlertException] if there isn't currently an alert.
Future accept() async {
await _post('accept_alert');
}
- /**
- * Dismisses the currently displayed alert (may not be the alert for which
- * this object was created).
- *
- * Throws [WebDriverError] no such alert exception if there isn't currently an
- * alert.
- */
+ /// Dismisses the currently displayed alert (may not be the alert for which
+ /// this object was created).
+ ///
+ /// Throws [NoSuchAlertException] if there isn't currently an alert.
Future dismiss() async {
await _post('dismiss_alert');
}
- /**
- * Sends keys to the currently displayed alert (may not be the alert for which
- * this object was created).
- *
- * Throws [WebDriverError] no such alert exception if there isn't currently an
- * alert.
- */
+ /// Sends keys to the currently displayed alert (may not be the alert for
+ /// which this object was created).
+ ///
+ /// Throws [NoSuchAlertException] if there isn't currently an alert
Future sendKeys(String keysToSend) async {
await _post('alert_text', {'text': keysToSend});
}
diff --git a/lib/src/common.dart b/lib/src/common.dart
index 4b7d740..6f12503 100644
--- a/lib/src/common.dart
+++ b/lib/src/common.dart
@@ -6,10 +6,8 @@
const String _ELEMENT = 'ELEMENT';
-/**
- * Simple class to provide access to indexed properties such as WebElement
- * attributes or css styles.
- */
+/// Simple class to provide access to indexed properties such as WebElement
+/// attributes or css styles.
class Attributes extends _WebDriverBase {
Attributes._(driver, command) : super(driver, command);
@@ -64,12 +62,9 @@
/// Searches for multiple elements within the context.
Stream<WebElement> findElements(By by);
- /**
- * Searchs for an element within the context.
- *
- * Throws [WebDriverError] no such element exception if no matching element is
- * found.
- */
+ /// Searchs for an element within the context.
+ ///
+ /// Throws [NoSuchElementException] if no matching element is found.
Future<WebElement> findElement(By by);
}
@@ -112,10 +107,8 @@
/// Returns an anchor element whose visible text matches the search value.
const By.linkText(String linkText) : this._('link text', linkText);
- /**
- * Returns an anchor element whose visible text partially matches the search
- * value.
- */
+ /// Returns an anchor element whose visible text partially matches the search
+ /// value.
const By.partialLinkText(String partialLinkText)
: this._('partial link text', partialLinkText);
diff --git a/lib/src/exception.dart b/lib/src/exception.dart
index 0c290a0..53d5db9 100644
--- a/lib/src/exception.dart
+++ b/lib/src/exception.dart
@@ -5,15 +5,11 @@
part of webdriver;
abstract class WebDriverException {
- /**
- * Either the status value returned in the JSON response (preferred) or the
- * HTTP status code.
- */
+ /// Either the status value returned in the JSON response (preferred) or the
+ /// HTTP status code.
final int statusCode;
- /**
- * A message describing the error.
- */
+ /// A message describing the error.
final String message;
factory WebDriverException(
diff --git a/lib/src/keyboard.dart b/lib/src/keyboard.dart
index aed4c7d..87e441b 100644
--- a/lib/src/keyboard.dart
+++ b/lib/src/keyboard.dart
@@ -7,9 +7,7 @@
class Keyboard extends _WebDriverBase {
Keyboard._(driver) : super(driver, '');
- /**
- * Send [keysToSend] to the active element.
- */
+ /// Send [keysToSend] to the active element.
Future sendKeys(String keysToSend) async {
await _post('keys', {'value': [keysToSend]});
}
diff --git a/lib/src/logs.dart b/lib/src/logs.dart
index 846c965..eaa2ce5 100644
--- a/lib/src/logs.dart
+++ b/lib/src/logs.dart
@@ -30,6 +30,7 @@
@override
bool operator ==(other) => other is Logs && other.driver == driver;
}
+
class LogEntry {
final String message;
final DateTime timestamp;
diff --git a/lib/src/mouse.dart b/lib/src/mouse.dart
index b0c873f..6ff42ff 100644
--- a/lib/src/mouse.dart
+++ b/lib/src/mouse.dart
@@ -20,10 +20,8 @@
await _post('click', json);
}
- /**
- * Click and hold any mouse button (at the coordinates set by the last
- * moveTo command).
- */
+ /// Click and hold any mouse button (at the coordinates set by the last
+ /// moveTo command).
Future down([int button]) async {
var json = {};
if (button is num) {
@@ -32,10 +30,7 @@
await _post('buttondown', json);
}
- /**
- * Releases the mouse button previously held (where the mouse is currently
- * at).
- */
+ /// Releases the mouse button previously held (where the mouse is currently at).
Future up([int button]) async {
var json = {};
if (button is num) {
@@ -49,20 +44,17 @@
await _post('doubleclick');
}
- /**
- * Move the mouse.
- *
- * If [element] is specified and [xOffset] and [yOffset] are not, will move
- * the mouse to the center of the [element].
- *
- * If [xOffset] and [yOffset] are specified, will move the mouse that distance
- * from its current location.
- *
- * If all three are specified, will move the mouse to the offset relative to
- * the top-left corner of the [element].
- *
- * All other combinations of parameters are illegal.
- */
+ /// Move the mouse.
+ ///
+ /// If [element] is specified and [xOffset] and [yOffset] are not, will move
+ /// the mouse to the center of the [element].
+ ///
+ /// If [xOffset] and [yOffset] are specified, will move the mouse that distance
+ /// from its current location.
+ ///
+ /// If all three are specified, will move the mouse to the offset relative to
+ /// the top-left corner of the [element].
+ /// All other combinations of parameters are illegal.
Future moveTo({WebElement element, int xOffset, int yOffset}) async {
var json = {};
if (element is WebElement) {
diff --git a/lib/src/target_locator.dart b/lib/src/target_locator.dart
index ff29d0b..33f3916 100644
--- a/lib/src/target_locator.dart
+++ b/lib/src/target_locator.dart
@@ -7,31 +7,24 @@
class TargetLocator extends _WebDriverBase {
TargetLocator._(driver) : super(driver, '');
- /**
- * Change focus to another frame on the page.
- *
- * If [frame] is a:
- * int: select by its zero-based index
- * String: select frame by the name of the frame window or the id of the
- * frame or iframe tag.
- * WebElement: select the frrame for a previously found frame or iframe
- * element.
- * not provided: selects the first frame on the page or the main document.
- *
- * Throws [WebDriverError] no such frame if the specified frame can't be
- * found.
- */
+ /// Change focus to another frame on the page.
+ /// If [frame] is a:
+ /// [int]: select by its zero-based index
+ /// [String]: select frame by the name of the frame window or the id of the
+ /// frame or iframe tag.
+ /// [WebElement]: select the frame for a previously found frame or iframe
+ /// element.
+ /// not provided: selects the first frame on the page or the main document.
+ ///
+ /// Throws [NoSuchFrameException] if the specified frame can't be found.
Future frame([frame]) async {
await _post('frame', {'id': frame});
}
- /**
- * Switch the focus of future commands for this driver to the window with the
- * given name/handle.
- *
- * Throws [WebDriverError] no such window if the specified window can't be
- * found.
- */
+ /// Switch the focus of future commands for this driver to the window with the
+ /// given name/handle.
+ ///
+ /// Throws [NoSuchWindowException] if the specified window can't be found.
Future window(dynamic window) async {
if (window is Window) {
await _post('window', {'name': window.handle});
@@ -42,12 +35,10 @@
}
}
- /**
- * Switches to the currently active modal dialog for this particular driver
- * instance.
- *
- * Throws WebDriverEror no alert present if there is not currently an alert.
- */
+ /// Switches to the currently active modal dialog for this particular driver
+ /// instance.
+ ///
+ /// Throws [NoAlertPresentException] if there is not currently an alert.
Future<Alert> get alert async {
var text = await _get('alert_text');
return new Alert._(text, driver);
diff --git a/lib/src/web_driver.dart b/lib/src/web_driver.dart
index 093be62..6ee0df2 100644
--- a/lib/src/web_driver.dart
+++ b/lib/src/web_driver.dart
@@ -76,11 +76,9 @@
// }
// }
- /**
- * Search for an element within the entire current page.
- *
- * Throws [WebDriverError] no such element if a matching element is not found.
- */
+ /// Search for an element within the entire current page.
+ /// Throws [NoSuchElementException] if a matching element is not found.
+ @override
Future<WebElement> findElement(By by) async {
var element = await _post('element', by);
return new WebElement._(this, element[_ELEMENT], this, by);
@@ -129,10 +127,8 @@
return new Window._(this, handle);
}
- /**
- * The currently focused element, or the body element if no
- * element has focus.
- */
+ /// The currently focused element, or the body element if no element has
+ /// focus.
Future<WebElement> get activeElement async {
var element = await _post('element/active');
if (element != null) {
@@ -159,45 +155,41 @@
Future<List<int>> captureScreenshot() => _get('screenshot')
.then((screenshot) => CryptoUtils.base64StringToBytes(screenshot));
- /**
- * Inject a snippet of JavaScript into the page for execution in the context
- * of the currently selected frame. The executed script is assumed to be
- * asynchronous and must signal that is done by invoking the provided
- * callback, which is always provided as the final argument to the function.
- * The value to this callback will be returned to the client.
- *
- * Asynchronous script commands may not span page loads. If an unload event
- * is fired while waiting for a script result, an error will be thrown.
- *
- * The script argument defines the script to execute in the form of a
- * function body. The function will be invoked with the provided args array
- * and the values may be accessed via the arguments object in the order
- * specified. The final argument will always be a callback function that must
- * be invoked to signal that the script has finished.
- *
- * Arguments may be any JSON-able object. WebElements will be converted to
- * the corresponding DOM element. Likewise, any DOM Elements in the script
- * result will be converted to WebElements.
- */
+ /// Inject a snippet of JavaScript into the page for execution in the context
+ /// of the currently selected frame. The executed script is assumed to be
+ /// asynchronous and must signal that is done by invoking the provided
+ /// callback, which is always provided as the final argument to the function.
+ /// The value to this callback will be returned to the client.
+ ///
+ /// Asynchronous script commands may not span page loads. If an unload event
+ /// is fired while waiting for a script result, an error will be thrown.
+ ///
+ /// The script argument defines the script to execute in the form of a
+ /// function body. The function will be invoked with the provided args array
+ /// and the values may be accessed via the arguments object in the order
+ /// specified. The final argument will always be a callback function that must
+ /// be invoked to signal that the script has finished.
+ ///
+ /// Arguments may be any JSON-able object. WebElements will be converted to
+ /// the corresponding DOM element. Likewise, any DOM Elements in the script
+ /// result will be converted to WebElements.
Future executeAsync(String script, List args) => _post('execute_async', {
'script': script,
'args': args
}).then(_recursiveElementify);
- /**
- * Inject a snippet of JavaScript into the page for execution in the context
- * of the currently selected frame. The executed script is assumed to be
- * synchronous and the result of evaluating the script is returned.
- *
- * The script argument defines the script to execute in the form of a
- * function body. The value returned by that function will be returned to the
- * client. The function will be invoked with the provided args array and the
- * values may be accessed via the arguments object in the order specified.
- *
- * Arguments may be any JSON-able object. WebElements will be converted to
- * the corresponding DOM element. Likewise, any DOM Elements in the script
- * result will be converted to WebElements.
- */
+ /// Inject a snippet of JavaScript into the page for execution in the context
+ /// of the currently selected frame. The executed script is assumed to be
+ /// synchronous and the result of evaluating the script is returned.
+ ///
+ /// The script argument defines the script to execute in the form of a
+ /// function body. The value returned by that function will be returned to the
+ /// client. The function will be invoked with the provided args array and the
+ /// values may be accessed via the arguments object in the order specified.
+ ///
+ /// Arguments may be any JSON-able object. WebElements will be converted to
+ /// the corresponding DOM element. Likewise, any DOM Elements in the script
+ /// result will be converted to WebElements.
Future execute(String script, List args) => _post(
'execute', {'script': script, 'args': args}).then(_recursiveElementify);
diff --git a/lib/src/web_element.dart b/lib/src/web_element.dart
index 9721529..45a3c05 100644
--- a/lib/src/web_element.dart
+++ b/lib/src/web_element.dart
@@ -63,11 +63,9 @@
/// Visible text within this element.
Future<String> get text => _get('text');
- /**
- * Find an element nested within this element.
- *
- * Throws [WebDriverError] no such element if matching element is not found.
- */
+ ///Find an element nested within this element.
+ ///
+ /// Throws [NoSuchElementException] if matching element is not found.
Future<WebElement> findElement(By by) async {
var element = await _post('element', by);
return new WebElement._(driver, element[_ELEMENT], this, by);
@@ -101,25 +99,19 @@
// }
// }
- /**
- * Access to the HTML attributes of this tag.
- *
- * TODO(DrMarcII): consider special handling of boolean attributes.
- */
+ /// Access to the HTML attributes of this tag.
+ ///
+ /// TODO(DrMarcII): consider special handling of boolean attributes.
Attributes get attributes => new Attributes._(driver, '$_prefix/attribute');
- /**
- * Access to the cssProperties of this element.
- *
- * TODO(DrMarcII): consider special handling of color and possibly other
- * properties.
- */
+ /// Access to the cssProperties of this element.
+ ///
+ /// TODO(DrMarcII): consider special handling of color and possibly other
+ /// properties.
Attributes get cssProperties => new Attributes._(driver, '$_prefix/css');
- /**
- * Does this element represent the same element as another element?
- * Not the same as ==
- */
+ /// Does this element represent the same element as another element?
+ /// Not the same as ==
Future<bool> equals(WebElement other) => _get('equals/${other.id}');
Map<String, String> toJson() => {_ELEMENT: id};