playwright-cucumber-ts-steps
Version:
A collection of reusable Playwright step definitions for Cucumber in TypeScript, designed to streamline end-to-end testing across web, API, and mobile applications.
252 lines (251 loc) • 5.97 kB
TypeScript
import { DataTable } from "@cucumber/cucumber";
import { CustomWorld } from "../helpers/world";
/**
* Clicks on the previously stored element.
*
* ```gherkin
* When I click
* ```
*
* @example
* ```gherkin
* When I click
* ```
* @remarks
* Requires a previous step that stores an element.
* @category Click Steps
*/
export declare function When_I_click(this: CustomWorld, ...rest: any[]): Promise<void>;
/**
* Clicks on an element matching the given selector.
*
* ```gherkin
* When I click on element {string}
* ```
*
* @example
* ```gherkin
* When I click on element ".my-class"
* ```
* @remarks
* Stores the clicked element for later use.
* @category Click Steps
*/
export declare function When_I_click_on_element(this: CustomWorld, selector: string, ...rest: any[]): Promise<void>;
/**
* Clicks on a button with the given label.
*
* ```gherkin
* When I click on button {string}
* ```
*
* @example
* ```gherkin
* When I click on button "Submit"
* ```
* @remarks
* Stores the clicked button for later use.
* @category Click Steps
*/
export declare function When_I_click_on_button(this: CustomWorld, label: string, ...rest: any[]): Promise<void>;
/**
* Clicks on a link with the given text.
*
* ```gherkin
* When I click on link {string}
* ```
*
* @example
* ```gherkin
* When I click on link "Home"
* ```
* @remarks
* Stores the clicked link for later use.
* @category Click Steps
*/
export declare function When_I_click_on_link(this: CustomWorld, text: string, ...rest: any[]): Promise<void>;
/**
* Clicks on a label with the given text.
*
* ```gherkin
* When I click on label {string}
* ```
*
* @example
* ```gherkin
* When I click on label "Username"
* ```
* @remarks
* Stores the clicked label for later use.
* @category Click Steps
*/
export declare function When_I_click_on_label(this: CustomWorld, labelText: string, ...rest: any[]): Promise<void>;
/**
* Clicks on an element containing the given text (not exact match). Supports aliasing with @alias.
*
* ```gherkin
* When I click on text {string}
* ```
*
* @example
* ```gherkin
* When I click on text "Welcome"
* When I click on text "@username"
* ```
* @remarks
* Stores the clicked element for later use.
* @category Click Steps
*/
export declare function When_I_click_on_text(this: CustomWorld, rawText: string, ...rest: any[]): Promise<void>;
/**
* Clicks on an element containing the exact given text.
*
* ```gherkin
* When I click on exact text {string}
* ```
*
* @example
* ```gherkin
* When I click on exact text "Log out"
* ```
* @remarks
* Stores the clicked element for later use.
* @category Click Steps
*/
export declare function When_I_click_on_exact_text(this: CustomWorld, exactText: string, ...rest: any[]): Promise<void>;
/**
* Clicks all previously stored elements.
*
* ```gherkin
* When I click all
* ```
*
* @example
* ```gherkin
* When I click all
* ```
* @remarks
* Requires a previous step that stores elements.
* @category Click Steps
*/
export declare function When_I_click_all(this: CustomWorld, ...rest: any[]): Promise<void>;
/**
* Double-clicks on an element containing the given text.
*
* ```gherkin
* When I double click on text {string}
* ```
*
* @example
* ```gherkin
* When I double click on text "Edit"
* ```
* @remarks
* Uses the previously stored element if available.
* @category Click Steps
*/
export declare function When_I_double_click_on_text(this: CustomWorld, text: string, ...rest: any[]): Promise<void>;
/**
* Double-clicks at the given page coordinates.
*
* ```gherkin
* When I double click position {int} {int}
* ```
*
* @example
* ```gherkin
* When I double click position 100 200
* ```
* @category Click Steps
*/
export declare function When_I_double_click_position(this: CustomWorld, x: number, y: number, ...rest: any[]): Promise<void>;
/**
* Double-clicks on the previously stored element.
*
* ```gherkin
* When I double click
* ```
*
* @example
* ```gherkin
* When I double click
* ```
* @remarks
* Requires a previous step that stores an element.
* @category Click Steps
*/
export declare function When_I_double_click(this: CustomWorld, ...rest: any[]): Promise<void>;
/**
* Right-clicks on the previously stored element.
*
* ```gherkin
* When I right click
* ```
*
* @example
* ```gherkin
* When I right click
* ```
* @remarks
* Requires a previous step that stores an element.
* @category Click Steps
*/
export declare function When_I_right_click(this: CustomWorld, ...rest: any[]): Promise<void>;
/**
* Right-clicks on an element containing the given text.
*
* ```gherkin
* When I right click on text {string}
* ```
*
* @example
* ```gherkin
* When I right click on text "Options"
* ```
* @category Click Steps
*/
export declare function When_I_right_click_on_text(this: CustomWorld, text: string, ...rest: any[]): Promise<void>;
/**
* Right-clicks at the given page coordinates.
*
* ```gherkin
* When I right click position {int} {int}
* ```
*
* @example
* ```gherkin
* When I right click position 50 50
* ```
* @category Click Steps
*/
export declare function When_I_right_click_position(this: CustomWorld, x: number, y: number, ...rest: any[]): Promise<void>;
/**
* Clicks all stored elements (alternative signature).
*
* ```gherkin
* When I click all
* ```
*
* @example
* ```gherkin
* When I click all
* ```
* @remarks
* Requires a previous step that stores elements.
* @category Click Steps
*/
export declare function When_I_click_all_alt(this: CustomWorld, dataTable?: DataTable): Promise<void>;
/**
* Clicks on an element matching the given selector (regex step).
*
* ```gherkin
* When I click on selector {string}
* ```
*
* @example
* ```gherkin
* When I click on selector ".my-selector"
* ```
* @category Click Steps
*/
export declare function When_I_click_on_selector(this: CustomWorld, selector: string): Promise<void>;