mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444
This commit is contained in:
parent
25e8bf69e6
commit
665817d2a6
35333 changed files with 1818077 additions and 16036 deletions
|
@ -1,41 +1,12 @@
|
|||
import json
|
||||
import os
|
||||
|
||||
import pytest
|
||||
import webdriver
|
||||
from support.fixtures import (
|
||||
create_frame, create_session, create_window, http, server_config, session,
|
||||
url)
|
||||
|
||||
from util import cleanup
|
||||
from util.http_request import HTTPRequest
|
||||
|
||||
default_host = "http://127.0.0.1"
|
||||
default_port = "4444"
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def _session(request):
|
||||
host = os.environ.get("WD_HOST", default_host)
|
||||
port = int(os.environ.get("WD_PORT", default_port))
|
||||
capabilities = json.loads(os.environ.get("WD_CAPABILITIES", "{}"))
|
||||
|
||||
session = webdriver.Session(host, port, desired_capabilities=capabilities)
|
||||
|
||||
def destroy():
|
||||
if session.session_id is not None:
|
||||
session.end()
|
||||
|
||||
request.addfinalizer(destroy)
|
||||
|
||||
return session
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def session(_session, request):
|
||||
# finalisers are popped off a stack,
|
||||
# making their ordering reverse
|
||||
request.addfinalizer(lambda: cleanup.switch_to_top_level_browsing_context(_session))
|
||||
request.addfinalizer(lambda: cleanup.restore_windows(_session))
|
||||
request.addfinalizer(lambda: cleanup.dismiss_user_prompts(_session))
|
||||
|
||||
return _session
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def http(session):
|
||||
return HTTPRequest(session.transport.host, session.transport.port)
|
||||
pytest.fixture()(create_frame)
|
||||
pytest.fixture()(create_session)
|
||||
pytest.fixture()(create_window)
|
||||
pytest.fixture()(http)
|
||||
pytest.fixture()(server_config)
|
||||
pytest.fixture(scope="function")(session)
|
||||
pytest.fixture()(url)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue