diff --git a/src/bidiMapper/bidiProtocolTypes.ts b/src/bidiMapper/bidiProtocolTypes.ts index 425e59852d..dc70a4937e 100644 --- a/src/bidiMapper/bidiProtocolTypes.ts +++ b/src/bidiMapper/bidiProtocolTypes.ts @@ -136,23 +136,25 @@ export namespace BrowsingContext { context: BrowsingContext; }; - export type BrowsingContextNavigateCommand = { - method: 'browsingContext.navigate'; - params: BrowsingContextNavigateParameters; - }; + export namespace PROTO { + export type BrowsingContextNavigateCommand = { + method: 'PROTO.browsingContext.navigate'; + params: BrowsingContextNavigateParameters; + }; - export type BrowsingContextNavigateParameters = { - context: BrowsingContext; - url: string; - wait?: ReadinessState; - }; + export type BrowsingContextNavigateParameters = { + context: BrowsingContext; + url: string; + wait?: ReadinessState; + }; - export type ReadinessState = 'none'; - // TODO sadym: implement 'interactive' and 'complete' states. - export type BrowsingContextNavigateResult = { - navigation?: Navigation; - url: string; - }; + export type ReadinessState = 'none'; + // TODO sadym: implement 'interactive' and 'complete' states. + export type BrowsingContextNavigateResult = { + navigation?: Navigation; + url: string; + }; + } } export namespace Session { diff --git a/src/bidiMapper/commandProcessor.ts b/src/bidiMapper/commandProcessor.ts index 3efe470c04..eb7c0f5239 100644 --- a/src/bidiMapper/commandProcessor.ts +++ b/src/bidiMapper/commandProcessor.ts @@ -179,9 +179,9 @@ export class CommandProcessor { return await this._contextProcessor.process_browsingContext_create( commandData as BrowsingContext.BrowsingContextCreateCommand ); - case 'browsingContext.navigate': - return await this._contextProcessor.process_browsingContext_navigate( - commandData as BrowsingContext.BrowsingContextNavigateCommand + case 'PROTO.browsingContext.navigate': + return await this._contextProcessor.process_PROTO_browsingContext_navigate( + commandData as BrowsingContext.PROTO.BrowsingContextNavigateCommand ); case 'PROTO.script.invoke': diff --git a/src/bidiMapper/domains/context/browsingContextProcessor.ts b/src/bidiMapper/domains/context/browsingContextProcessor.ts index be44db64ad..5c14fb74a2 100644 --- a/src/bidiMapper/domains/context/browsingContextProcessor.ts +++ b/src/bidiMapper/domains/context/browsingContextProcessor.ts @@ -192,9 +192,9 @@ export class BrowsingContextProcessor { }); } - async process_browsingContext_navigate( - commandData: BrowsingContext.BrowsingContextNavigateCommand - ): Promise { + async process_PROTO_browsingContext_navigate( + commandData: BrowsingContext.PROTO.BrowsingContextNavigateCommand + ): Promise { const params = commandData.params; const context = await this._getKnownContext(params.context); diff --git a/src/bidiMapper/domains/context/context.ts b/src/bidiMapper/domains/context/context.ts index 9412a84cff..6f5f722918 100644 --- a/src/bidiMapper/domains/context/context.ts +++ b/src/bidiMapper/domains/context/context.ts @@ -89,8 +89,8 @@ export class Context { public async navigate( url: string, - wait: BrowsingContext.ReadinessState = 'none' - ): Promise { + wait: BrowsingContext.PROTO.ReadinessState = 'none' + ): Promise { // TODO sadym: implement. if (wait !== 'none') { throw new Error(`Not implenented wait '${wait}'`); diff --git a/tests/test_bidi.py b/tests/test_bidi.py index 8b45defa7a..4d1016fab1 100644 --- a/tests/test_bidi.py +++ b/tests/test_bidi.py @@ -239,13 +239,13 @@ async def _ignore_test_PageClose_browsingContextContextDestroyedEmitted(websocke "url": "about:blank"}} @pytest.mark.asyncio -async def test_navigateWaitNone_navigated(websocket): +async def test_PROTO_navigateWaitNone_navigated(websocket): contextID = await get_open_context_id(websocket) # Send command. command = { "id": 15, - "method": "browsingContext.navigate", + "method": "PROTO.browsingContext.navigate", "params": { "url": "data:text/html,

test

", "wait": "none", @@ -265,17 +265,17 @@ async def test_navigateWaitNone_navigated(websocket): @pytest.mark.asyncio # Not implemented yet. -async def _ignore_test_navigateWaitInteractive_navigated(websocket): +async def _ignore_test_PROTO_navigateWaitInteractive_navigated(websocket): ignore = True @pytest.mark.asyncio # Not implemented yet. -async def _ignore_test_navigateWaitComplete_navigated(websocket): +async def _ignore_test_PROTO_navigateWaitComplete_navigated(websocket): ignore = True @pytest.mark.asyncio # Not implemented yet. -async def _ignore_test_navigateWithShortTimeout_timeoutOccuredAndEventPageLoadEmitted(websocket): +async def _ignore_test_PROTO_navigateWithShortTimeout_timeoutOccuredAndEventPageLoadEmitted(websocket): contextID = await get_open_context_id(websocket) # Send command.