UNPKG

@agnos-ui/page-objects

Version:

Page objects to be used when testing AgnosUI-based applications with Playwright.

81 lines (80 loc) 2.56 kB
import type { Locator } from '@playwright/test'; import { BasePO } from '@agnos-ui/base-po'; /** Pagination navigation buttons hrefs */ export interface HrefsNavigation { first?: string; previous?: string; next?: string; last?: string; } /** Pagination page object */ export interface PaginationPOState { rootClasses: string[]; disabled: string | null; pages: string[]; hrefs: string[]; hrefsNavigation?: HrefsNavigation; isFirstDisabled?: boolean; isPreviousDisabled?: boolean; isNextDisabled?: boolean; isLastDisabled?: boolean; } export declare const paginationSelectors: { rootComponent: string; activePage: string; previousPage: string; nextPage: string; firstPage: string; lastPage: string; pages: string; ellipses: string; }; export declare class PaginationPO extends BasePO { selectors: { rootComponent: string; activePage: string; previousPage: string; nextPage: string; firstPage: string; lastPage: string; pages: string; ellipses: string; }; getComponentSelector(): string; /** * Gets the locator of the button is the current page in the pagination component. */ get locatorActivePage(): Locator; /** * Gets the locator of the button that once clicked moves to the previous page in the pagination component. */ get locatorPreviousButton(): Locator; /** * Gets the locator of the button that once clicked moves to the next page in the pagination component. */ get locatorNextButton(): Locator; /** * Gets the locator of the button that once clicked moves to the first page in the pagination component. */ get locatorFirstButton(): Locator; /** * Gets the locator of the button that once clicked moves to the last page in the pagination component. */ get locatorLastButton(): Locator; /** * Gets the locators of the pages */ get locatorPages(): Locator; /** * Gets the locator of a page button in the pagination component given his position. * @param pageNumber - The number of the page in the pagination object. */ locatorNthPage(pageNumber: number): Locator; /** * Gets the locator of a page button in the pagination component given a string. * @param pageString - The string of the page in the pagination object. */ locatorPage(pageString: string): Locator; get locatorEllipses(): Locator; state(): Promise<PaginationPOState>; }