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

Name Type Description Default
row int The row number of the cell. required
col int The column number of the cell. required

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

Name Type Description Default
value PatternOrStr The expected text in the cell. required
row int The row number of the cell. required
col int The column number of the cell. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_cell_class

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

Expects the class of the cell

Parameters

Name Type Description Default
value str The expected class of the cell. required
row int The row number of the cell. required
col int The column number of the cell. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. 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

Name Type Description Default
value str The expected validation message of the cell. required
row int The row number of the cell. required
col int The column number of the cell. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. 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

Name Type Description Default
value str The expected state of the class. required
row int The row number of the cell. required
col int The column number of the cell. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_column_labels

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

Expects the column labels in the data frame.

Parameters

Name Type Description Default
value ListPatternOrStr | None The expected column labels. Note: None if the column labels are expected to not exist. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_ncol

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

Expects the number of columns in the data frame.

Parameters

Name Type Description Default
value int The expected number of columns. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_nrow

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

Expects the number of rows in the data frame.

Parameters

Name Type Description Default
value int The expected number of rows. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. 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

Name Type Description Default
value int The expected number of selected rows. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

expect_selected_rows

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

Expects the specified rows to be selected.

Parameters

Name Type Description Default
rows list[int] The row numbers. required
timeout Timeout The maximum time to wait for the expectation to pass. Defaults to None. None

select_rows

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

Selects the rows in the data frame.

Parameters

Name Type Description Default
value list[int] The list of row numbers to select. required
timeout Timeout The maximum time to wait for the action to complete. Defaults to None. 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

Name Type Description Default
text str The key to save the value of the cell. required
row int The row number of the cell. required
col int The column number of the cell. required
finish_key Literal[‘Enter’, ‘Shift+Enter’, ‘Tab’, ‘Shift+Tab’, ‘Escape’] | 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. None
timeout Timeout The maximum time to wait for the action to complete. Defaults to None. 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

Name Type Description Default
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. required
timeout Timeout The maximum time to wait for the action to complete. Defaults to None. 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

Name Type Description Default
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. required
timeout Timeout The maximum time to wait for the action to complete. Defaults to None. None