75209383eab9aaaf61d78d2c81637238b7bda3c4
[WebKit-https.git] / WebDriverTests / imported / w3c / webdriver / tests / actions / conftest.py
1 import pytest
2
3
4 @pytest.fixture
5 def key_chain(session):
6     return session.actions.sequence("key", "keyboard_id")
7
8
9 @pytest.fixture
10 def mouse_chain(session):
11     return session.actions.sequence(
12         "pointer",
13         "pointer_id",
14         {"pointerType": "mouse"})
15
16
17 @pytest.fixture(autouse=True)
18 def release_actions(session, request):
19     # release all actions after each test
20     # equivalent to a teardown_function, but with access to session fixture
21     request.addfinalizer(session.actions.release)
22
23
24 @pytest.fixture
25 def key_reporter(session, test_actions_page, request):
26     """Represents focused input element from `test_keys_page` fixture."""
27     input_el = session.find.css("#keys", all=False)
28     input_el.click()
29     return input_el
30
31
32 @pytest.fixture
33 def test_actions_page(session, url):
34     session.url = url("/webdriver/tests/actions/support/test_actions_wdspec.html")