OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library webdriver; | 5 library webdriver; |
6 | 6 |
7 import 'dart:json'; | 7 import 'dart:json'; |
8 import 'dart:uri'; | 8 import 'dart:uri'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import 'dart:math'; | 10 import 'dart:math'; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 String get path => _path; | 195 String get path => _path; |
196 String get url => _url; | 196 String get url => _url; |
197 | 197 |
198 /** | 198 /** |
199 * The default URL for WebDriver remote server is | 199 * The default URL for WebDriver remote server is |
200 * http://localhost:4444/wd/hub. | 200 * http://localhost:4444/wd/hub. |
201 */ | 201 */ |
202 WebDriverBase.fromUrl([this._url = 'http://localhost:4444/wd/hub']) { | 202 WebDriverBase.fromUrl([this._url = 'http://localhost:4444/wd/hub']) { |
203 // Break out the URL components. | 203 // Break out the URL components. |
204 var re = new RegExp('[^:/]+://([^/]+)(/.*)'); | 204 var re = const RegExp('[^:/]+://([^/]+)(/.*)'); |
205 var matches = re.firstMatch(_url); | 205 var matches = re.firstMatch(_url); |
206 _host = matches[1]; | 206 _host = matches[1]; |
207 _path = matches[2]; | 207 _path = matches[2]; |
208 var idx = _host.indexOf(':'); | 208 var idx = _host.indexOf(':'); |
209 if (idx >= 0) { | 209 if (idx >= 0) { |
210 _port = parseInt(_host.substring(idx+1)); | 210 _port = parseInt(_host.substring(idx+1)); |
211 _host = _host.substring(0, idx); | 211 _host = _host.substring(0, idx); |
212 } else { | 212 } else { |
213 _port = 80; | 213 _port = 80; |
214 } | 214 } |
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 * Get the log for a given log type. Log buffer is reset after each request. | 1357 * Get the log for a given log type. Log buffer is reset after each request. |
1358 * Each log entry is a [Map] with these fields: | 1358 * Each log entry is a [Map] with these fields: |
1359 * | 1359 * |
1360 * 'timestamp' (int) - The timestamp of the entry. | 1360 * 'timestamp' (int) - The timestamp of the entry. |
1361 * 'level' (String) - The log level of the entry, for example, "INFO". | 1361 * 'level' (String) - The log level of the entry, for example, "INFO". |
1362 * 'message' (String) - The log message. | 1362 * 'message' (String) - The log message. |
1363 */ | 1363 */ |
1364 Future<List<Map>> getLogs(String type) => | 1364 Future<List<Map>> getLogs(String type) => |
1365 _post('log', params: { 'type': type }); | 1365 _post('log', params: { 'type': type }); |
1366 } | 1366 } |
OLD | NEW |