mirror of
https://github.com/servo/servo.git
synced 2025-08-20 04:45:33 +01:00
Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d
This commit is contained in:
parent
65dd6d4340
commit
ccdb0a3458
1428 changed files with 118036 additions and 9786 deletions
|
@ -1,9 +1,10 @@
|
|||
# WebDriver client for Python
|
||||
|
||||
This package provides a WebDriver client compatible with
|
||||
the [W3C browser automation specification](https://w3c.github.io/webdriver/webdriver-spec.html).
|
||||
This package provides Python bindings
|
||||
that conform to the [W3C WebDriver standard](https://w3c.github.io/webdriver/webdriver-spec.html),
|
||||
which specifies a remote control protocol for web browsers.
|
||||
|
||||
The client is written with determining
|
||||
These bindings are written with determining
|
||||
implementation compliance to the specification in mind,
|
||||
so that different remote end drivers
|
||||
can determine whether they meet the recognised standard.
|
||||
|
@ -13,13 +14,21 @@ in the [Web Platform Tests](https://github.com/w3c/web-platform-tests).
|
|||
## Installation
|
||||
|
||||
To install the package individually
|
||||
in your virtualenv or system-wide::
|
||||
in your virtualenv or system-wide:
|
||||
|
||||
% python setup.py install
|
||||
|
||||
Or if you want to contribute patches::
|
||||
Since this package does not have any external dependencies,
|
||||
you can also use the client directly from the checkout directory,
|
||||
which is useful if you want to contribute patches back:
|
||||
|
||||
% python setup.py develop
|
||||
% cd /path/to/wdclient
|
||||
% python
|
||||
Python 2.7.12+ (default, Aug 4 2016, 20:04:34)
|
||||
[GCC 6.1.1 20160724] on linux2
|
||||
Type "help", "copyright", "credits" or "license" for more information.
|
||||
>>> import webdriver
|
||||
>>>
|
||||
|
||||
If you are writing WebDriver specification tests for
|
||||
[WPT](https://github.com/w3c/web-platform-tests),
|
||||
|
@ -30,10 +39,28 @@ that is checked out in `./tools`.
|
|||
|
||||
## Usage
|
||||
|
||||
You can use the built-in
|
||||
[context manager](https://docs.python.org/2/reference/compound_stmts.html#the-with-statement)
|
||||
to manage the lifetime of the session.
|
||||
The session is started implicitly
|
||||
at the first call to a command if it has not already been started,
|
||||
and will implicitly be ended when exiting the context:
|
||||
|
||||
```py
|
||||
import webdriver
|
||||
|
||||
session = webdriver.Session("127.0.0.1", "4444")
|
||||
with webdriver.Session("127.0.0.1", 4444) as session:
|
||||
session.url = "https://mozilla.org"
|
||||
print "The current URL is %s" % session.url
|
||||
```
|
||||
|
||||
The following is functionally equivalent to the above,
|
||||
but giving you manual control of the session:
|
||||
|
||||
```py
|
||||
import webdriver
|
||||
|
||||
session = webdriver.Session("127.0.0.1", 4444)
|
||||
session.start()
|
||||
|
||||
session.url = "https://mozilla.org"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue