Common Functions#
This section documents common utility functions used in the automation testing suite.
checkCheckboxInRow#
checkInvoiceRow#
- checkInvoiceRow(page, rowText, action)#
checkInvoiceRow Specifically designed for checking/unchecking the checkboxes in invoice rows based on the exact pattern used in codegen.
clickTableItem#
Deprecated since version 1.0: Use selectActionFromRow or direct locator interactions instead.
- clickTableItem(page, options)#
Clicks on a table cell or link containing specific text patterns Generic function for clicking items in data tables
- Arguments:
page (Page) – Playwright page instance
options – Configuration options
- Returns:
Promise – Promise<string> - The text content of the clicked element
getAllCellsFromTable#
safeFill2#
safeUncheck#
- safeUncheck(page, identifier)#
safeUncheck Attempts to uncheck (i.e. set to false) an element identified by its label. It first tries to use getByLabel with an exact match; if that fails, it falls back to getByText.
searchForUser#
- searchForUser(page, searchTerm, placeholder)#
Searches for a user/entity using the search input field. Enhanced with multiple strategies for finding and interacting with the search field.
toggleIfExists#
- toggleIfExists(page, label, shouldCheck)#
Attempts to check/uncheck a checkbox if one exists for the given label. If no labeled checkbox exists, attempts to click a matching text node. Avoids indefinite waiting by using a short timeout for interactions.