Skip to content

Commit 120233a

Browse files
committed
add Demo Dashboard to website (WIP)
add mail config AllowUnknownSenders
1 parent 28ac452 commit 120233a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

webui/e2e/helpers/table.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Locator } from "@playwright/test";
2+
3+
export async function getCellByColumnName(table: Locator, columnName: string, row?: Locator | undefined): Promise<Locator> {
4+
const headerIndex = await table.getByRole('columnheader', { name: columnName, exact: true})
5+
.evaluate(header => {
6+
const headers = Array.from(header.closest('tr').querySelectorAll('th'));
7+
// Return 1-based index for nth-child CSS selector
8+
return headers.indexOf(header as HTMLTableCellElement) + 1;
9+
});
10+
11+
if (!row) {
12+
row = table.locator('tbody tr')
13+
}
14+
15+
return row.locator(`td:nth-child(${headerIndex})`);
16+
}

0 commit comments

Comments
 (0)