chrome.py (815B)
1 import pytest 2 from support.context import using_context 3 from tests.support.asserts import assert_success 4 5 6 def get_window_handle(session): 7 return session.transport.send( 8 "GET", "session/{session_id}/window".format(**vars(session)) 9 ) 10 11 12 @pytest.mark.allow_system_access 13 def test_basic(session): 14 with using_context(session, "chrome"): 15 response = get_window_handle(session) 16 assert_success(response, session.window_handle) 17 18 19 @pytest.mark.allow_system_access 20 def test_different_handle_than_content_scope(session): 21 response = get_window_handle(session) 22 content_handle = assert_success(response) 23 24 with using_context(session, "chrome"): 25 response = get_window_handle(session) 26 chrome_handle = assert_success(response) 27 28 assert chrome_handle != content_handle