@coinbase/onchaintestkit
Version:
End-to-end testing toolkit for blockchain applications, powered by Playwright
34 lines (33 loc) • 1.5 kB
TypeScript
import type { BrowserContext, Page } from "@playwright/test";
import { ActionOptions, BaseActionType, BaseWallet } from "../BaseWallet";
import { MetaMaskConfig } from "../types";
import { HomePage, NotificationPage, OnboardingPage } from "./pages";
export declare enum MetaMaskSpecificActionType {
LOCK = "lock",
UNLOCK = "unlock",
ADD_TOKEN = "addToken",
ADD_ACCOUNT = "addAccount",
RENAME_ACCOUNT = "renameAccount",
REMOVE_ACCOUNT = "removeAccount",
SWITCH_ACCOUNT = "switchAccount",
ADD_NETWORK = "addNetwork",
APPROVE_ADD_NETWORK = "approveAddNetwork"
}
type MetaMaskActionType = BaseActionType | MetaMaskSpecificActionType;
export declare class MetaMask extends BaseWallet {
readonly onboardingPage: OnboardingPage;
readonly homePage: HomePage;
readonly notificationPage: NotificationPage;
private readonly context;
private readonly extensionId?;
readonly config: MetaMaskConfig;
constructor(walletConfig: MetaMaskConfig, context: BrowserContext, page: Page, extensionId?: string);
static initialize(currentContext: BrowserContext, contextPath: string, walletConfig: MetaMaskConfig): Promise<{
metamaskPage: Page;
metamaskContext: BrowserContext;
}>;
static createContext(contextPath: string, slowMo?: number): Promise<BrowserContext>;
handleAction(action: MetaMaskActionType, options?: ActionOptions): Promise<void>;
identifyNotificationType(): Promise<string>;
}
export * from "./fixtures";