mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
test(e2e): open the oracle's headless layout stream with a paired connection (#27601)
* test(e2e): open the oracle's headless layout stream with a paired connection The remote subscription now takes a paired connection rather than a pairing offer; build one from the offer the way the CLI does. * test(e2e): build the paired mobile client's connection from its offer Same stale call as the oracle stream after the subscription and request functions took a paired connection.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { MOBILE_RUNTIME_CLIENT_CAPABILITIES } from '../../../mobile/src/transport/mobile-runtime-client-capabilities'
|
||||
import { pairedRuntimeConnectionFromOffer } from '../../../src/shared/paired-runtime-connection'
|
||||
import { decodePairingOffer } from '../../../src/shared/pairing'
|
||||
import {
|
||||
sendRemoteRuntimeRequest,
|
||||
@@ -41,6 +42,7 @@ export function pairMobileClient(offer: RuntimeDesktopPairingOffer): PairedMobil
|
||||
if (pairing.scope !== 'mobile') {
|
||||
throw new Error(`Expected a mobile-scoped pairing offer, got scope ${String(pairing.scope)}`)
|
||||
}
|
||||
const connection = pairedRuntimeConnectionFromOffer(pairing)
|
||||
const open = new Set<RemoteRuntimeSubscription>()
|
||||
const request = <T>(
|
||||
method: string,
|
||||
@@ -48,7 +50,7 @@ export function pairMobileClient(offer: RuntimeDesktopPairingOffer): PairedMobil
|
||||
timeoutMs = DEFAULT_TIMEOUT_MS
|
||||
): Promise<RuntimeRpcResponse<T>> =>
|
||||
sendRemoteRuntimeRequest<T>(
|
||||
pairing,
|
||||
connection,
|
||||
method,
|
||||
params,
|
||||
timeoutMs,
|
||||
@@ -67,7 +69,7 @@ export function pairMobileClient(offer: RuntimeDesktopPairingOffer): PairedMobil
|
||||
},
|
||||
subscribe: async (method, params, callbacks, timeoutMs = DEFAULT_TIMEOUT_MS) => {
|
||||
const subscription = await subscribeRemoteRuntimeRequest(
|
||||
pairing,
|
||||
connection,
|
||||
method,
|
||||
params,
|
||||
timeoutMs,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
import type { Page } from '@stablyai/playwright-test'
|
||||
import { pairedRuntimeConnectionFromOffer } from '../../../src/shared/paired-runtime-connection'
|
||||
import { decodePairingOffer } from '../../../src/shared/pairing'
|
||||
import { subscribeRemoteRuntimeRequest } from '../../../src/shared/remote-runtime-client'
|
||||
import type { RuntimeRpcResponse } from '../../../src/shared/runtime-rpc-envelope'
|
||||
@@ -51,7 +52,7 @@ export async function subscribeHeadlessLayout(
|
||||
): Promise<{ close: () => void }> {
|
||||
feed.reopening()
|
||||
const subscription = await subscribeRemoteRuntimeRequest<unknown>(
|
||||
decodePairingOffer(pairingUrl),
|
||||
pairedRuntimeConnectionFromOffer(decodePairingOffer(pairingUrl)),
|
||||
'layout.subscribe',
|
||||
{},
|
||||
30_000,
|
||||
|
||||
Reference in New Issue
Block a user