ui-omakase-framework
Version:
A comprehensive E2E testing framework library with pre-built Cucumber step definitions and utilities for web automation testing
76 lines (75 loc) • 2.18 kB
TypeScript
/**
* Setup utilities for the E2E framework
* These functions can be called by consumers to register components with their Cucumber instance
*/
import { Browser, BrowserContext, Page } from 'playwright';
import type { GlobalConfig, GlobalVariables } from './env/global';
export interface ScenarioWorld {
screen: {
browser?: Browser;
context?: BrowserContext;
page: Page;
};
globalConfig: GlobalConfig;
globalVariables: GlobalVariables;
}
/**
* Creates a custom world class that consumers can use
*/
export declare function createCustomWorld(WorldConstructor: any, globalConfig?: Partial<GlobalConfig>): {
new (options: any): {
[x: string]: any;
screen: {
browser?: Browser;
context?: BrowserContext;
page: Page;
};
globalConfig: GlobalConfig;
globalVariables: GlobalVariables;
init(): Promise<void>;
};
[x: string]: any;
};
/**
* Simple utility functions that can be used inline
*/
export declare const setupUtils: {
/**
* Get viewport configuration from environment
*/
getViewPort(): {
width: number;
height: number;
};
/**
* Environment utilities
*/
env: (key: string) => string | undefined;
envNumber: (key: string) => number | undefined;
/**
* Browser setup utility
*/
setupBrowser(browserType?: string, headless?: boolean): Promise<Browser>;
};
/**
* Function to set up the world constructor with the consumer's Cucumber instance
*/
export declare function setupWorld(cucumber: any, globalConfig?: Partial<GlobalConfig>): {
new (options: any): {
[x: string]: any;
screen: {
browser?: Browser;
context?: BrowserContext;
page: Page;
};
globalConfig: GlobalConfig;
globalVariables: GlobalVariables;
init(): Promise<void>;
};
[x: string]: any;
};
/**
* Function to register all step definitions with the consumer's Cucumber instance
* This approach avoids Cucumber instance conflicts
*/
export declare function registerStepDefinitions(cucumber: any): any[];