Common Functions#

This section documents common utility functions used in the automation testing suite.

checkCheckboxInRow#

checkCheckboxInRow(page, rowName, check)#
Arguments:
Returns:

Promise

checkInvoiceRow#

checkInvoiceRow(page, rowText, action)#

checkInvoiceRow Specifically designed for checking/unchecking the checkboxes in invoice rows based on the exact pattern used in codegen.

Arguments:
  • page (Page) – The Playwright Page object

  • rowText (string) – The text content of the row containing the checkbox

  • action – ‘check’ or ‘uncheck’

Returns:

Promise

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#

getAllCellsFromTable(page)#
Arguments:
Returns:

Promise

safeFill2#

safeFill2(page, identifier, value, context, tabFallbackCount, useExactMatch, stepTimeout)#
Arguments:
Returns:

Promise

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.

Arguments:
  • page (Page) – The Playwright Page object.

  • identifier (string) – The label or text identifier for the checkbox.

Returns:

Promise

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.

Arguments:
  • page (Page) – Playwright page

  • searchTerm (string) – Search term to enter

  • placeholder (string) – Optional placeholder text (partial match supported)

Returns:

Promise

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.

Arguments:
Returns:

Promise