@o3r/testing
Version:
The module provides testing (e2e, unit test) utilities to help you build your own E2E pipeline integrating visual testing.
50 lines • 1.65 kB
TypeScript
import type { Locator, Page } from '@playwright/test';
import { ElementProfile } from '../element';
export { ElementProfile } from '../element';
/**
* Playwright type for source element
* @param element is the DOM element
* @param page is the tab in the browser where the test is run
*/
export type PlaywrightSourceElement = {
element: Locator;
page: Page;
};
/**
* Remove text formatting (endline etc.) and return the content.
* @param innerText
*/
export declare function getPlainText(innerText: string): string | undefined;
/**
* Implementation dedicated to Playwright.
*/
export declare class O3rElement implements ElementProfile {
/** Playwright sourceElement */
sourceElement: PlaywrightSourceElement;
constructor(sourceElement: PlaywrightSourceElement | O3rElement);
/** @inheritdoc */
getText(): Promise<string>;
/** @inheritdoc */
getPlainText(): Promise<string | undefined>;
/** @inheritdoc */
getInnerHTML(): Promise<string | undefined>;
/** @inheritdoc */
mouseOver(): Promise<void>;
/** @inheritdoc */
getValue(): Promise<string | undefined>;
/** @inheritdoc */
setValue(input: string): Promise<void>;
/** @inheritdoc */
clearValue(): Promise<void>;
/** @inheritdoc */
click(): Promise<void>;
/** @inheritdoc */
isVisible(): Promise<boolean>;
/** @inheritdoc */
getAttribute(attributeName: string): Promise<string | undefined>;
}
/**
* Constructor of a O3rElement
*/
export type O3rElementConstructor<T extends ElementProfile> = new (sourceElement: PlaywrightSourceElement | O3rElement) => T;
//# sourceMappingURL=element.d.ts.map