UNPKG

moizkhan-data-driven-test

Version:

A comprehensive data-driven test automation framework for Playwright with universal field detection, intelligent error validation, and bundled source code protection

81 lines (66 loc) 2.18 kB
declare module 'moizkhan-data-driven-test' { export class BaseTestPage { constructor(page: any, testData: any, pageName?: string); /** * Main method: Run field-by-field validation (invalid → valid for each field) */ runInvalidThenValidForEachField(): Promise<void>; /** * Run only positive tests (valid data) without navigation */ runPositiveTestsOnly(): Promise<void>; /** * Run enhanced validation test with custom test data */ runValidationTest(relevantTestData: any): Promise<void>; /** * Fill specific fields only (partial form filling) */ fillSpecificFields(fieldNames: string[]): Promise<void>; /** * Validate specific field error states */ validateFieldError(fieldName: string, invalidValue: string, expectedError: string): Promise<void>; /** * Run custom validation with specific configuration */ runCustomValidation(customConfig: any): Promise<void>; /** * Get page-specific test statistics */ getTestStatistics(): { pageName: string; totalFields: number; validationFields: number; dropdownFields: number; inputFields: number; }; } export class DataDrivenTestPage { constructor(page: any, testData: any); /** * Fill a specific field with given value */ fillField(field: any, value: string): Promise<void>; /** * Run positive tests for all fields */ runPositiveTests(): Promise<void>; /** * Run validation tests for all fields */ runValidationTests(): Promise<void>; /** * Find field by label name */ findFieldByLabel(labelName: string): Promise<{ fieldElement: any; errorContainer: any }>; /** * Check for validation errors */ checkForValidationErrors(field: any, expectError: boolean, expectedError?: string): Promise<void>; /** * Click next button with given selector */ clickNextButton(buttonSelector: string): Promise<void>; } }