import { WebmateAPISession } from "../webmate-api-session"; import { BrowserSessionId, BrowserSessionStateId } from "../types"; import { BrowserSessionStateExtractionConfig } from "./browser-session-state-extraction-config"; import { Observable } from "rxjs"; import { BrowserSessionRef } from "./browser-session-ref"; import { BrowserSessionInfo } from "./browser-session-info"; /** * Facade to webmate's BrowserSession subsystem. */ export declare class BrowserSessionClient { private session; private apiClient; private currentSpanIdsStack; /** * Creates a BrowserSessionClient based on a WebmateApiSession. * * @param session The WebmateApiSession the BrowserSessionClient is supposed to be based on */ constructor(session: WebmateAPISession); /** * Return the webmate BrowserSessionId for a given Selenium session running in webmate. * * @param opaqueSeleniumSessionIdString Selenium SessionId that can be obtained by calling WebDriver.getSessionId().toString(). * @return BrowserSessionRef that can be used to interact with the BrowserSession */ getBrowserSessionForSeleniumSession(opaqueSeleniumSessionIdString: string): BrowserSessionRef; /** * Create a new State for the given BrowserSession. * * @param browserSessionId BrowserSession, in which the state should be extracted. * @param matchingId Label for state (should be unique for BrowserSession, otherwise some tests could get confused). * @param browserSessionStateExtractionConfig configuration controlling the state extraction process. See {@link BrowserSessionStateExtractionConfig}. * @throws WebmateApiClientException if an error occurs while requesting state extraction or if the timeout is exceeded. */ createState(matchingId: string, browserSessionId?: BrowserSessionId, browserSessionStateExtractionConfig?: BrowserSessionStateExtractionConfig): Observable; startAction(actionName: string): Observable; finishAction(successMessage?: string): Observable; finishActionAsFailure(errorMessage: string): Observable; /** * Terminate the given BrowserSession. * * @param browserSessionId The Id for the BrowserSession that is supposed to be terminated * @return true if the Browsersession was successfully terminated */ terminateBrowsersession(browserSessionId: BrowserSessionId): Observable; /** * Retrieves the browser session info for a given browser session. * * @param id The id of the browser session whose browser session info should be retrieved. * @return The browser session info for the given browser session. */ getBrowserSessionInfo(id: BrowserSessionId): Observable; }