mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
fix member edit modal ui regression from field component migration
This commit is contained in:
16
e2e/utils/table.ts
Normal file
16
e2e/utils/table.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { Locator } from '@playwright/test';
|
||||
|
||||
/**
|
||||
* Extract the first cell's text content from each row in a table.
|
||||
* Useful for reading the ordered names/labels from a sorted table.
|
||||
*/
|
||||
export async function getTableRowNames(table: Locator): Promise<string[]> {
|
||||
const rows = table.getByRole('row');
|
||||
const count = await rows.count();
|
||||
const names: string[] = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
const text = await rows.nth(i).locator('div').first().textContent();
|
||||
if (text) names.push(text.trim());
|
||||
}
|
||||
return names;
|
||||
}
|
||||
Reference in New Issue
Block a user