Skip to main content

Tables

DrevOps\BehatSteps\Steps\Web\TableTrait - Source, Steps

Interact with HTML table elements and assert their content.

public function tableFindRowByText(string $row_text): ?NodeElement

Find a table row containing the given text

public function tableFindRowByValues(NodeElement $table, array $values, string $selector): ?NodeElement

Find the first body row whose cells hold the given values

public function tableGet(string $selector): NodeElement

Return the table element matching a CSS selector

public function tableGetBodyRowSelector(): string

Get the CSS selector for table body rows

public function tableGetColumnIndex(NodeElement $table, string $column, string $selector): int

Get the index of a column by its header text

public function tableGetColumnValues(NodeElement $table, int $column_index): array

Get the texts of a column's cells in the body rows of a table

public function tableGetHeaderSelector(): string

Get the CSS selector for table header cells

public function tableGetHeaders(NodeElement $table): array

Get the header texts from a table element

public function tableGetRowByText(string $row_text): NodeElement

Return the first row on the page containing the text

public function tableGetRows(NodeElement $table): array

Get the body rows from a table element