Billing Functions#

This section documents billing functions used in the automation testing suite.

selectInvoiceOption#

Deprecated since version 1.0: Use createInvoice or direct dropdown interactions instead.

selectInvoiceOption(page, dropdownLabel, optionName)#

To select an Invoice Type or Item Type universally

Arguments:
Returns:

Promise

selectLineItemType#

Deprecated since version 1.0: Use addLineItem instead.

selectLineItemType(page, selector, option)#

Select line item type in billing form.

Arguments:
Returns:

Promise

FilloutLineItemDescription#

Deprecated since version 1.0: Use addLineItem instead.

FilloutLineItemDescription(page, selector, description)#

Fill out line item description in billing form.

Arguments:
Returns:

Promise

InputLineItemAmount#

Deprecated since version 1.0: Use addLineItem instead.

InputLineItemAmount(page, selector, amount)#

Input line item amount in billing form.

Arguments:
Returns:

Promise

createInvoice#

createInvoice(page, options, billingType, entityName, invoiceDetails, internalNote, invoiceDate, invoiceType, noteToBiller, lineItems, shouldSave, verifySuccess)#

Main orchestrator function for creating an invoice. Throws InvoiceCreationError on failure.

Arguments:
Returns:

Promise

addLineItem#

addLineItem(page, lineItem, amount, description, itemType, isFirstItem)#

Adds a single line item to the invoice.

Arguments:
  • page (Page) – Playwright Page

  • lineItem (LineItem) – Line item details

  • amount (string)

  • description (string)

  • isFirstItem (boolean) – If true, don’t click the add button (first item row is already there)

Returns:

Promise

deleteLineItem#

deleteLineItem(page, index)#

Deletes a line item from the invoice.

Arguments:
  • page (Page) – Playwright Page

  • index (number) – Optional index of item to delete (0-based). If not provided, deletes last item.

Returns:

Promise

fillInvoiceDetails#

fillInvoiceDetails(page, details, internalNote, invoiceDate, invoiceType, noteToBiller)#

Fills the invoice details (date, type, notes).

Arguments:
Returns:

Promise

openAddInvoiceDialog#

openAddInvoiceDialog(page)#

Opens the Add Invoice dialog from the Invoices page. Assumes you are already on the Billing -> Invoices page.

Arguments:
Returns:

Promise

selectBillingEntity#

selectBillingEntity(page, billingType, entityName)#

Selects the billing type (Sponsor Organizations or CIT Corporations) and specific entity.

Arguments:
  • page (Page) – Playwright Page

  • billingType – ‘Sponsor Organizations’ or ‘CIT Corporations’

  • entityName (string) – Optional specific entity name (if not provided, uses first available)

Returns:

Promise

verifyInvoiceCreated#

verifyInvoiceCreated(page, timeout)#

Verifies invoice was created successfully. Checks for dialog closure and success indicators.

Arguments:
  • page (Page) – Playwright Page

  • timeout (number) – Optional timeout in ms (default 5000)

Returns:

Promise – true if invoice was created successfully