import { newE2EPage } from '@stencil/core/testing'; import type { E2EElement, E2EPage } from '@stencil/core/testing'; import { NewSpecPageOptions } from '../stencil-public-runtime'; type NewE2EPageOptions = Parameters[0]; interface PasteInit extends EventInit { pastedValue: string; } type EventInitType = EventInit | KeyboardEventInit | MouseEventInit | FocusEventInit | CustomEventInit | PasteInit | ClipboardEventInit; export declare function dispatchEvent(page: E2EPage, selectors: string | string[], eventType: string, eventInit?: EventInitType): Promise; export declare function setTestStrings(page: E2EPage, strings: Record): Promise; export declare function promiseMap(arr: T[], fn: (...args: any[]) => any): Promise; export declare function waitForCursorStability(inputElement: E2EElement): Promise; /** * Waits for a specified amount of time. * * Please use this function sparingly, as it can slow down tests. */ export declare function waitForTimeout(timeout: number): Promise; export declare function offsetTimezone(date: string): string; export declare function setup(pageOptions?: NewE2EPageOptions): Promise; /** * Converts an object to a string of HTML attributes. * * @param obj - The object to convert, where keys are attribute names and values are attribute values. * @returns A string representing the HTML attributes. * * @example * const attributes = objectToHTMLAttributes({ id: 'my-element', class: 'my-class', 'data-value': '123' }); * console.log(attributes); // Output: "id='my-element' class='my-class' data-value='123'" */ export declare function objectToHTMLAttributes(obj: any): string; /** * Sets up a new Spec Page with localization capabilities for testing. * * @param pageOptions - Configuration options for the new Spec Page. * @param testStrings - Optional dictionary of test strings for localization. * @returns A promise that resolves to the configured Spec Page. * * This function initializes a new Spec Page and sets up the `TectonElements` * object for localization testing. It also sets the provided test strings for * localization and reloads the page to ensure the new `TectonElements` object * is available. * * @note This method doesn't work with `NewSpecPageOptions.template` * property. If you need to use that, please use `newSpecPage` directly. */ export declare function setupSpecPageWithLoc(pageOptions: NewSpecPageOptions, testStrings?: Record): Promise; export declare function setWindowHeight(height: number): void; export declare function makeDomRect(customAttributes: any): any; export declare const base64Image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII="; export declare function getActiveElementTestId(page: E2EPage): Promise; export declare const getFocusedOptionValue: (page: E2EPage) => Promise; export declare const getFocusedTagName: (page: E2EPage) => Promise; export declare function getFocusedAttribute(page: E2EPage, attribute: string): Promise; export declare const testDeprecatedAriaLabel: (element: E2EElement, label?: string) => Promise; /** This function ensures all shadowDOM-enabled components check for SCSS compilation issues. */ export declare const getListOfStyleCompilationIssues: (page: E2EPage, selector: string) => Promise; export declare const getNestedElementProperty: (page: E2EPage, selectors: string | string[], prop: string) => Promise; export declare const getNestedElementAttribute: (page: E2EPage, selectors: string | string[], attribute: string) => Promise; export declare const getNestedElementStyle: (page: E2EPage, selectors: string | string[], attribute: string) => Promise; export declare const getNestedAssignedElementLength: (page: E2EPage, selectors: string | string[]) => Promise; /** * Evaluates accessibility violations on the provided E2EPage using axe-core. * * @param page The E2EPage instance to evaluate. * @param ignoredRules A record of accessibility rules to ignore, with rule IDs as keys and arrays of message * substrings as values. A violation is ignored when its message contains any one of the provided substrings. * @param args Additional arguments, such as 'webpage' or 'verbose'. * @returns A processed object of accessibility violations, or false if none are found. * * @example * const violations = await evaluateA11y(page, { * 'color-contrast': ['Element has insufficient color contrast'], * 'aria-required-children': ['Required ARIA child role not present', 'aria-owns'], * }); */ export declare const evaluateA11y: (page: E2EPage, ignoredRules?: Record, ...args: string[]) => Promise; /** * This function mocks the fetch API to return a resolved promise with the given icon markup. * You can optionally provide a element, but it is not required. * * This is meant to be used to prevent errors on Unit/Spec tests with because we are unable to provide a valid * URL for the fetch call in that context. * * @note This function should be called before the component is rendered. * @note Be sure to call `jest.restoreAllMocks()` after the test to restore the original fetch function. */ export declare const mockIconFetch: (iconMarkup?: string) => jest.SpyInstance, [input: string | URL | Request, init?: RequestInit], any>; export {};