playwright.controller.OutputDataFrame

playwright.controller.OutputDataFrame(self, page, id)

Controller for shiny.express.ui.output_data_frame.

Attributes

Name Description
expect Expectation method equivalent to playwright.expect(self.loc).
id The browser DOM id of the UI element.
loc Playwright Locator for the data frame.
loc_body Playwright Locator for the body of the data frame table.
loc_container Playwright Locator for the data frame container.
loc_head Playwright Locator for the head of the data frame table.
page Playwright Page of the Shiny app.

Methods

Name Description
cell_locator Returns the locator for a specific cell in the data frame.
expect_cell Expects the cell in the data frame to have the specified text.
expect_cell_class Expects the class of the cell
expect_cell_title Expects the validation message of the cell in the data frame, which will be in the title attribute of the element.
expect_class_state Expects the state of the class in the data frame.
expect_column_labels Expects the column labels in the data frame.
expect_ncol Expects the number of columns in the data frame.
expect_nrow Expects the number of rows in the data frame.
expect_selected_num_rows Expects the number of selected rows in the data frame.
expect_selected_rows Expects the specified rows to be selected.
select_rows Selects the rows in the data frame.
set_cell Saves the value of the cell in the data frame.
set_filter Set or reset filters for columns in a table or grid component. This method allows setting string filters, numeric range filters, or clearing all filters.
set_sort Set or modify the sorting of columns in a table or grid component. This method allows setting single or multiple column sorts, or resetting the sort order.

cell_locator

playwright.controller.OutputDataFrame.cell_locator(row, col)

Returns the locator for a specific cell in the data frame.

Parameters

row: int

The row number of the cell.

col: int

The column number of the cell.

expect_cell

playwright.controller.OutputDataFrame.expect_cell(value, *, row, col, timeout=None)

Expects the cell in the data frame to have the specified text.

Parameters

value: PatternOrStr

The expected text in the cell.

row: int

The row number of the cell.

col: int

The column number of the cell.

timeout: Timeout = None

The maximum time to wait for the expectation to pass. Defaults to None.

expect_cell_class

playwright.controller.OutputDataFrame.expect_cell_class(value, *, row, col, timeout=None)

Expects the class of the cell

Parameters

value: str

The expected class of the cell.

row: int

The row number of the cell.

col: int

The column number of the cell.

timeout: Timeout = None

The maximum time to wait for the expectation to pass. Defaults to None.

expect_cell_title

playwright.controller.OutputDataFrame.expect_cell_title(value, *, row, col, timeout=None)

Expects the validation message of the cell in the data frame, which will be in the title attribute of the element.

Parameters

value: str

The expected validation message of the cell.

row: int

The row number of the cell.

col: int

The column number of the cell.

timeout: Timeout = None

The maximum time to wait for the expectation to pass. Defaults to None.

expect_class_state

playwright.controller.OutputDataFrame.expect_class_state(value, *, row, col, timeout=None)

Expects the state of the class in the data frame.

Parameters

value: str

The expected state of the class.

row: int

The row number of the cell.

col: int

The column number of the cell.

timeout: Timeout = None

The maximum time to wait for the expectation to pass. Defaults to None.

expect_column_labels

playwright.controller.OutputDataFrame.expect_column_labels(value, *, timeout=None)

Expects the column labels in the data frame.

Parameters

value: ListPatternOrStr | None

The expected column labels.

Note: None if the column labels are expected to not exist.

timeout: Timeout = None

The maximum time to wait for the expectation to pass. Defaults to None.

expect_ncol

playwright.controller.OutputDataFrame.expect_ncol(value, *, timeout=None)

Expects the number of columns in the data frame.

Parameters

value: int

The expected number of columns.

timeout: Timeout = None

The maximum time to wait for the expectation to pass. Defaults to None.

expect_nrow

playwright.controller.OutputDataFrame.expect_nrow(value, *, timeout=None)

Expects the number of rows in the data frame.

Parameters

value: int

The expected number of rows.

timeout: Timeout = None

The maximum time to wait for the expectation to pass. Defaults to None.

expect_selected_num_rows

playwright.controller.OutputDataFrame.expect_selected_num_rows(value, *, timeout=None)

Expects the number of selected rows in the data frame.

Parameters

value: int

The expected number of selected rows.

timeout: Timeout = None

The maximum time to wait for the expectation to pass. Defaults to None.

expect_selected_rows

playwright.controller.OutputDataFrame.expect_selected_rows(rows, *, timeout=None)

Expects the specified rows to be selected.

Parameters

rows: list[int]

The row numbers.

timeout: Timeout = None

The maximum time to wait for the expectation to pass. Defaults to None.

select_rows

playwright.controller.OutputDataFrame.select_rows(value, *, timeout=None)

Selects the rows in the data frame.

Parameters

value: list[int]

The list of row numbers to select.

timeout: Timeout = None

The maximum time to wait for the action to complete. Defaults to None.

set_cell

playwright.controller.OutputDataFrame.set_cell(text, *, row, col, finish_key=None, timeout=None)

Saves the value of the cell in the data frame.

Parameters

text: str

The key to save the value of the cell.

row: int

The row number of the cell.

col: int

The column number of the cell.

finish_key: Literal[‘Enter’, ‘Shift+Enter’, ‘Tab’, ‘Shift+Tab’, ‘Escape’] | None = None

The key to save the value of the cell. If None (the default), no key will be pressed and instead the page body will be clicked.

timeout: Timeout = None

The maximum time to wait for the action to complete. Defaults to None.

set_filter

playwright.controller.OutputDataFrame.set_filter(filter, *, timeout=None)

Set or reset filters for columns in a table or grid component. This method allows setting string filters, numeric range filters, or clearing all filters.

Parameters

filter: ColumnFilter | list[ColumnFilter] | None

The filter to apply. Can be one of the following: * None: Resets all filters. * ColumnFilterStr: A dictionary specifying a string filter with ‘col’ and ‘value’ keys. * ColumnFilterNumber: A dictionary specifying a numeric range filter with ‘col’ and ‘value’ keys.

timeout: Timeout = None

The maximum time to wait for the action to complete. Defaults to None.

set_sort

playwright.controller.OutputDataFrame.set_sort(sort, *, timeout=None)

Set or modify the sorting of columns in a table or grid component. This method allows setting single or multiple column sorts, or resetting the sort order.

Parameters

sort: int | ColumnSort | list[int | ColumnSort] | None

The sorting configuration to apply. Can be one of the following: * int: Index of the column to sort by (ascending order by default). * ColumnSort: A dictionary specifying a single column sort with ‘col’ and ‘desc’ keys. * list[int | ColumnSort]: A list of ints or dictionaries for multi-column sorting. * None: No sorting applied (not implemented in the current code).

If a desc values is provided within your ColumnSort shaped dictionary, then the direction will be set to that value. If no desc value is provided, the column will be sorted in the default sorting order.

timeout: Timeout = None

The maximum time to wait for the action to complete. Defaults to None.