@uuv/playwright
Version:
A solution to facilitate the writing and execution of E2E tests understandable by any human being using cucumber(BDD) and playwright
86 lines (85 loc) • 3.93 kB
TypeScript
/**
* Software Name : UUV
*
* SPDX-License-Identifier: MIT
*
* This software is distributed under the MIT License,
* see the "LICENSE" file for more details
*
* Authors: NJAKO MOLOM Louis Fredice & SERVICAL Stanley
* Software description: Make test writing fast, understandable by any human
* understanding English or French.
*/
import { World } from "../../preprocessor/run/world";
import { Cookie } from "@playwright/test";
import { Locator } from "playwright";
export declare enum COOKIE_NAME {
TIMEOUT = "uuv.timeout",
SELECTED_ELEMENT = "uuv.withinFocusedElement",
MOCK_URL = "uuv.mockUrl"
}
export declare enum COOKIE_VALUE {
NOT_EXIST = "notExist"
}
export declare enum FILTER_TYPE {
SELECTOR = "bySelector",
ROLE = "byRole",
TEXT = "byText",
ARIA_LABEL = "byAriaLabel",
TEST_ID = "byTestId",
SELECTOR_PARENT = "bySelectorParent"
}
export type CustomCookieValue = {
name: string;
};
export declare class CustomCookie implements Cookie {
name: string;
value: string;
domain: string;
expires: number;
httpOnly: boolean;
path: string;
sameSite: "Strict" | "Lax" | "None";
secure: boolean;
isValid(): boolean;
}
export declare class MockCookie implements CustomCookieValue {
name: string;
url: string;
verb: string;
isConsumed: boolean;
constructor(name: string, url: string, verb: string);
}
export declare class SelectedElementCookie implements CustomCookieValue {
name: string;
value: string;
constructor(name: string, value: string);
}
export declare class TimeoutCookie implements CustomCookieValue {
name: string;
value: number;
constructor(name: string, value: number);
}
export type FilterType = {
name: FILTER_TYPE;
value: any;
};
export declare function getPageOrElement(world: World): Promise<any>;
export declare function addCookie(world: World, cookieName: COOKIE_NAME, newCookie: CustomCookieValue): Promise<void>;
export declare function getCookie(world: World, cookieName: COOKIE_NAME): Promise<CustomCookie>;
export declare function deleteCookieByName(world: World, cookieName: COOKIE_NAME): Promise<void>;
export declare function findWithRoleAndName(world: World, role: string, name: string, otherRoleOptions?: {}): Promise<any>;
export declare function withinRoleAndName(world: World, role: string, name: string): Promise<void>;
export declare function notFoundWithRoleAndName(world: World, role: string, name: string): Promise<void>;
export declare function findWithRoleAndNameAndContent(world: World, expectedRole: string, name: string, expectedTextContent?: string | undefined, otherRoleOptions?: {}): Promise<any>;
export declare function findWithRoleAndNameFocused(world: World, expectedRole: string, name: string): Promise<any>;
export declare function findWithRoleAndNameAndChecked(world: World, expectedRole: string, name: string): Promise<any>;
export declare function findWithRoleAndNameAndUnchecked(world: World, expectedRole: string, name: string): Promise<any>;
export declare function findWithRoleAndNameAndContentDisabled(world: World, expectedRole: string, name: string, expectedTextContent: string): Promise<void>;
export declare function findWithRoleAndNameDisabled(world: World, expectedRole: string, name: string): Promise<void>;
export declare function findWithRoleAndNameAndContentEnabled(world: World, expectedRole: string, name: string, expectedTextContent: string): Promise<void>;
export declare function findWithRoleAndNameEnabled(world: World, expectedRole: string, name: string): Promise<void>;
export declare function showAttributesInLocator(element: any): Promise<void>;
export declare function checkTextContentLocator(locator: Locator, expectedTextContent: string): Promise<void>;
export declare function click(world: World, role: any, name: string): Promise<void>;
export declare function getTimeout(world: World): Promise<number>;