Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d

This commit is contained in:
Ms2ger 2016-11-14 11:07:09 +01:00
parent 65dd6d4340
commit ccdb0a3458
1428 changed files with 118036 additions and 9786 deletions

View file

@ -6,3 +6,95 @@ known as [WebDriver](http://w3c.github.io/webdriver/webdriver-spec.html).
The purpose of these tests is determine implementation compliance
so that different driver implementations can determine
whether they meet the recognised standard.
## Chapters of the Spec that still need tests
Note: Sections that are currently we believe are not quite stable enough for tests yet are in <span style="color:red;">red</span>.
Note: Sections that likely have enough tests for now are marked in <span style="color:green;">green</span>.
* Routing Requests
* List of Endpoints (existance tests)
* List of Error Codes (Description is NON Normative)
* Capabilities
* Sessions
* Delete Session
* Set Timeouts
* Navigation
** Get Current URL
** Back
** Forward
** Refresh
** Get Title
* Command Contexts
** Get Window Handle
** Close Window
** Switch To Window
** Get Window Handles
** Switch To Frame
** Switch To Parent Frame
* Resizing and Positioning Windows
** Get Window Size
** Set Window Size
** Get Window Position
** Set Window Position
** Maximize Window
** Minimize Window
** Fullscreen Window
* Elements
** Element Interactability
** Get Active Element
* Element Retrieval
** Locator Strategies
*** CSS Selectors
*** Link Text
*** Partial Link Text
*** XPath
** Find Element
** Find Elements
** Find Element from Element
** Find Elements from Element
* Element State
** Is Element Selected
** Get Element Attribute
** Get Element Property
** Get Element CSS value
** Get Element Text
** Get Element Tag name
** Get Element Rect
** Is Element Enabled
* Element Interaction
** Element Click
** Element Clear
** Element Send Keys
* Document Handling
** Getting Page Source
** Executing Script
** Execute Script
** Execute Async Script
* Cookies
** Get All Cookies
** Get Named Cookies
** Add Cookie
** Delete Cookie
** Delete All Cookies
* <span style="color:red;">Actions
** Input State
** Processing Actions Requests
** Dispatching Actions
** General Actions
** Keyboard Actions
** Pointer Actions
** Perform Actions
** Remote End Steps (non-Normative)
** Releasing Actions</span>
* User Prompts
** Dismiss Alert
** Accept Alert
** Get Alert Text
** Send Alert Text
* Screen Capture
** Take Screenshot
** Take Element Screenshot
* <span style="color:green;">Privacy</span>
* <span style="color:green;">Security</span>
* Element Displayedness

View file

@ -1,27 +1,75 @@
def test_resize(session):
import json
import pytest
import webdriver
@pytest.mark.xfail(raises=webdriver.UnsupportedOperationException)
def test_window_size_types(http, session):
session.start()
with http.get("/session/%s/window/size" % session.session_id) as resp:
assert resp.status == 200
body = json.load(resp)
assert "width" in body
assert "height" in body
assert isinstance(body["width"], int)
assert isinstance(body["height"], int)
size = session.window.size
assert isinstance(size, tuple)
assert isinstance(size[0], int)
assert isinstance(size[1], int)
@pytest.mark.xfail(raises=webdriver.UnsupportedOperationException)
def test_window_resize(session):
# setting the window size by webdriver is synchronous
# so we should see the results immediately
session.window.size = (200, 100)
assert session.window.size == {"width": 100, "height": 200}
session.window.size = (400, 500)
assert session.window.size == (400, 500)
session.window.size = (100, 200)
assert session.window.size == {"width": 200, "height": 100}
session.window.size = (500, 600)
assert session.window.size == (500, 600)
def test_resize_by_script(session):
"""
TODO(ato):
Disable test because the while statements are wrong.
To fix this properly we need to write an explicit wait utility.
def test_window_resize_by_script(session):
# setting the window size by JS is asynchronous
# so we poll waiting for the results
size0 = session.window.size
session.execute_script("window.resizeTo(100, 200)")
session.execute_script("window.resizeTo(700, 800)")
size1 = session.window.size
while size0 == size1:
size1 = session.window.size
assert size1 == {"width": 100, "height": 200}
assert size1 == (700, 800)
session.execute_script("window.resizeTo(200, 100)")
session.execute_script("window.resizeTo(800, 900)")
size2 = session.window.size
while size1 == size2:
size2 = session.window.size
assert size2 == (800, 900)
assert size2 == {"width": 200, "height": 100}
"""
@pytest.mark.xfail(raises=webdriver.UnsupportedOperationException)
def test_window_position_types(http, session):
session.start()
with http.get("/session/%s/window/position" % session.session_id) as resp:
assert resp.status == 200
body = json.load(resp)
assert "x" in body
assert "y" in body
assert isinstance(body["x"], int)
assert isinstance(body["y"], int)
size = session.window.position
assert isinstance(size, tuple)
assert isinstance(size[0], int)
assert isinstance(size[1], int)

View file

@ -1,5 +1,3 @@
import contextlib
import httplib
import json
import pytest
import types
@ -18,32 +16,6 @@ one_frame_doc = inline("<iframe src='%s'></iframe>" % frame_doc)
two_frames_doc = inline("<iframe src='%s'></iframe>" % one_frame_doc)
class HTTPRequest(object):
def __init__(self, host, port):
self.host = host
self.port = port
def head(self, path):
return self._request("HEAD", path)
def get(self, path):
return self._request("GET", path)
@contextlib.contextmanager
def _request(self, method, path):
conn = httplib.HTTPConnection(self.host, self.port)
try:
conn.request(method, path)
yield conn.getresponse()
finally:
conn.close()
@pytest.fixture
def http(request, session):
return HTTPRequest(session.transport.host, session.transport.port)
@pytest.fixture
def new_window(session):
"""Open new window and return the window handle."""