diff --git a/webdriver/tests/bidi/session/subscribe/subscription_id.py b/webdriver/tests/bidi/session/subscribe/subscription_id.py new file mode 100644 index 00000000000000..36a57111f6d503 --- /dev/null +++ b/webdriver/tests/bidi/session/subscribe/subscription_id.py @@ -0,0 +1,8 @@ +import pytest +import uuid + +@pytest.mark.asyncio +async def test_subscribe_subscription_id(subscribe_events): + result = await subscribe_events(events=["browsingContext"]) + assert isinstance(result['subscription'], str) + uuid.UUID(hex=result['subscription']) diff --git a/webdriver/tests/support/fixtures_bidi.py b/webdriver/tests/support/fixtures_bidi.py index 241ba528ddfaae..ec36eb953ff391 100644 --- a/webdriver/tests/support/fixtures_bidi.py +++ b/webdriver/tests/support/fixtures_bidi.py @@ -65,8 +65,9 @@ async def subscribe_events(bidi_session): subscriptions = [] async def subscribe_events(events, contexts=None): - await bidi_session.session.subscribe(events=events, contexts=contexts) + result = await bidi_session.session.subscribe(events=events, contexts=contexts) subscriptions.append((events, contexts)) + return result yield subscribe_events