1
1
[ ![ CI] ( https://github.com/google/webdriver.dart/actions/workflows/ci.yaml/badge.svg )] ( https://github.com/google/webdriver.dart/actions/workflows/ci.yaml )
2
2
[ ![ pub package] ( https://img.shields.io/pub/v/webdriver.svg )] ( https://pub.dartlang.org/packages/webdriver )
3
+ [ ![ package publisher] ( https://img.shields.io/pub/publisher/webdriver.svg )] ( https://pub.dev/packages/webdriver/publisher )
3
4
4
5
Provides WebDriver bindings for Dart. These use the WebDriver JSON interface,
5
6
and as such, require the use of the WebDriver remote server.
@@ -12,8 +13,8 @@ import 'package:webdriver/io.dart';
12
13
WebDriver driver = createDriver(...);
13
14
```
14
15
15
- This will use by default the asynchronous, JSON wire spec implementation.
16
- You now can also use a synchronous version of WebDriver:
16
+ This will use by default the asynchronous, JSON wire spec implementation. You
17
+ now can also use a synchronous version of WebDriver:
17
18
18
19
``` dart
19
20
import 'package:webdriver/sync_io.dart';
@@ -22,9 +23,9 @@ final driver = createDriver(...);
22
23
```
23
24
24
25
This version of WebDriver supports both the JSON wire spec and W3C spec,
25
- allowing use with modern versions of Firefox. This defaults to the JSON
26
- wire spec, but can also be configured to use the W3C spec or even to try
27
- and automatically infer the spec during session creation:
26
+ allowing use with modern versions of Firefox. This defaults to the JSON wire
27
+ spec, but can also be configured to use the W3C spec or even to try and
28
+ automatically infer the spec during session creation:
28
29
29
30
``` dart
30
31
final w3cDriver = createDriver(spec: WebDriverSpec.W3c); // Use W3C spec.
@@ -35,11 +36,11 @@ final anyDriver = createDriver(spec: WebDriverSpec.Auto); // Infer spec.
35
36
## Testing
36
37
37
38
Unfortunately using bazel with Dart libraries and Dart WebDriver is not yet
38
- supported. We hope to add this at some point, but for now pub still works.
39
+ supported. We hope to add this at some point, but for now pub still works.
39
40
40
41
As a consequence, running tests is a bit more complicated than we'd like:
41
42
42
- 1 ) Launch a WebDriver binar(ies).
43
+ 1 . Launch a WebDriver binar(ies).
43
44
44
45
First, bring up chromedriver / geckodriver. Other conforming WebDriver
45
46
binaries should work as well, but we test against these:
@@ -53,19 +54,19 @@ As a consequence, running tests is a bit more complicated than we'd like:
53
54
geckodriver is used to test our W3C spec implementation.
54
55
55
56
Synchronous tests are labeled as Chrome/Firefox. All async tests run
56
- exclusively against Chrome (as async, like ChromeDriver supports only the
57
- old JSON wire spec).
57
+ exclusively against Chrome (as async, like ChromeDriver supports only the old
58
+ JSON wire spec).
58
59
59
- 2 ) Run a test. All files suffixed with ' _ test.dart' are tests.
60
+ 2 . Run a test. All files suffixed with ` _test.dart ` are tests.
60
61
61
62
```
62
- pub run test/path/to/test .dart -r expanded -p vm
63
+ dart test test/path/to/the_test .dart -r expanded -p vm
63
64
```
64
65
65
- Or to run * all * tests:
66
+ Or to run _ all _ tests:
66
67
67
68
```
68
- pub run test -r expanded -p vm
69
+ dart test -r expanded -p vm
69
70
```
70
71
71
72
You should probably go get a coffee or something, this is gonna take a while.
0 commit comments