/** * Copyright (c) Microsoft Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import * as playwright from 'playwright'; import { PageSnapshot } from './pageSnapshot.js'; import type { Context } from './context.js'; export declare class Tab { readonly context: Context; readonly page: playwright.Page; private _consoleMessages; private _requests; private _snapshot; private _onPageClose; private _cdpRelay; constructor(context: Context, page: playwright.Page, onPageClose: (tab: Tab) => void); private _clearCollectedArtifacts; private _onClose; title(): Promise; /** * Get the current URL of the page, with CDP relay fallback */ getUrl(): string; waitForLoadState(state: 'load', options?: { timeout?: number; }): Promise; navigate(url: string): Promise; hasSnapshot(): boolean; snapshotOrDie(): PageSnapshot; consoleMessages(): ConsoleMessage[]; requests(): Map; captureSnapshot(): Promise; } export type ConsoleMessage = { type: ReturnType | undefined; text: string; toString(): string; };