@cerios/playwright-table 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +447 -447
- package/dist/index.d.mts +203 -48
- package/dist/index.d.ts +203 -48
- package/dist/index.js +122 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +122 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -47,15 +47,6 @@ var TableUtils = class {
|
|
|
47
47
|
colspan: parseInt(await cell.getAttribute("colspan") || "1", 10)
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
static castContent(value) {
|
|
51
|
-
const trimmedValue = value.trim();
|
|
52
|
-
if (trimmedValue === "") return "";
|
|
53
|
-
const lowerValue = trimmedValue.toLowerCase();
|
|
54
|
-
if (lowerValue === "true") return true;
|
|
55
|
-
if (lowerValue === "false") return false;
|
|
56
|
-
const num = Number(trimmedValue);
|
|
57
|
-
return isNaN(num) ? trimmedValue : num;
|
|
58
|
-
}
|
|
59
50
|
};
|
|
60
51
|
|
|
61
52
|
// src/table-body.ts
|
|
@@ -96,13 +87,12 @@ var TableBody = class {
|
|
|
96
87
|
}
|
|
97
88
|
static async processColumn(column, colIndex, columns, rowIndex, spannedCells, cellContentType = "innerText" /* InnerText */) {
|
|
98
89
|
const content = await TableUtils.getCellContent(column, cellContentType);
|
|
99
|
-
const castedContent = TableUtils.castContent(content);
|
|
100
90
|
const { rowspan, colspan } = await TableUtils.parseSpanAttributes(column);
|
|
101
91
|
for (let span = 0; span < colspan; span++) {
|
|
102
|
-
columns[colIndex + span] =
|
|
92
|
+
columns[colIndex + span] = content;
|
|
103
93
|
}
|
|
104
94
|
if (rowspan > 1) {
|
|
105
|
-
this.storeSpannedCells(rowIndex, colIndex, rowspan,
|
|
95
|
+
this.storeSpannedCells(rowIndex, colIndex, rowspan, content, spannedCells);
|
|
106
96
|
}
|
|
107
97
|
}
|
|
108
98
|
static storeSpannedCells(rowIndex, colIndex, rowspan, content, spannedCells) {
|
|
@@ -315,6 +305,34 @@ var TableWait = class {
|
|
|
315
305
|
|
|
316
306
|
// src/playwright-table.ts
|
|
317
307
|
var PlaywrightTable = class {
|
|
308
|
+
/**
|
|
309
|
+
* Creates an instance of the table handler with customizable selectors for headers and rows.
|
|
310
|
+
*
|
|
311
|
+
* @param _tableLocator - The Playwright `Locator` pointing to the root table element.
|
|
312
|
+
* @param _options - Optional configuration for customizing header and row selectors.
|
|
313
|
+
* @param _options.header - Options for header row and columns.
|
|
314
|
+
* @param _options.header.setMainHeaderRow - (Optional) Index of the main header row if multiple header rows exist.
|
|
315
|
+
* @param _options.header.rowSelector - (Optional) CSS selector for locating header rows. Defaults to `"thead>tr"`.
|
|
316
|
+
* @param _options.header.columnSelector - (Optional) CSS selector for locating header columns. Defaults to `"th"`.
|
|
317
|
+
* @param _options.row - Options for body rows and columns.
|
|
318
|
+
* @param _options.row.rowSelector - (Optional) CSS selector for locating body rows. Defaults to `"tbody>tr"`.
|
|
319
|
+
* @param _options.row.columnSelector - (Optional) CSS selector for locating body columns. Defaults to `"td"`.
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* const table = new PlaywrightTable(
|
|
323
|
+
* page.locator('table.my-table'),
|
|
324
|
+
* {
|
|
325
|
+
* header: {
|
|
326
|
+
* rowSelector: 'thead tr.header',
|
|
327
|
+
* columnSelector: 'th.header-cell'
|
|
328
|
+
* },
|
|
329
|
+
* row: {
|
|
330
|
+
* rowSelector: 'tbody tr.data-row',
|
|
331
|
+
* columnSelector: 'td.data-cell'
|
|
332
|
+
* }
|
|
333
|
+
* }
|
|
334
|
+
* );
|
|
335
|
+
*/
|
|
318
336
|
constructor(_tableLocator, _options) {
|
|
319
337
|
this._tableLocator = _tableLocator;
|
|
320
338
|
this._options = _options;
|
|
@@ -326,24 +344,63 @@ var PlaywrightTable = class {
|
|
|
326
344
|
this._bodyRowLocator = this._tableLocator.locator((_i = (_h = (_g = this._options) == null ? void 0 : _g.row) == null ? void 0 : _h.rowSelector) != null ? _i : "tbody>tr");
|
|
327
345
|
this._bodyRowColumnSelector = (_l = (_k = (_j = this._options) == null ? void 0 : _j.row) == null ? void 0 : _k.columnSelector) != null ? _l : "td";
|
|
328
346
|
}
|
|
347
|
+
/**
|
|
348
|
+
* Retrieves all header rows of the table.
|
|
349
|
+
* @param options - Optional parameters for timeout and header row options.
|
|
350
|
+
* @param options.timeout - Timeout in milliseconds for loading table data.
|
|
351
|
+
* @param options.headerRowOptions - See {@link HeaderRowOptions} for available options.
|
|
352
|
+
* @returns A promise that resolves to an array of header rows.
|
|
353
|
+
*/
|
|
329
354
|
async getHeaderRows(options) {
|
|
330
355
|
await this.load(options);
|
|
331
356
|
return this._headers;
|
|
332
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* Retrieves the main header row of the table.
|
|
360
|
+
* @param options - Optional parameters for timeout and header row options.
|
|
361
|
+
* @param options.timeout - Timeout in milliseconds for loading table data.
|
|
362
|
+
* @param options.headerRowOptions - See {@link HeaderRowOptions} for available options.
|
|
363
|
+
* @returns A promise that resolves to the main header row.
|
|
364
|
+
*/
|
|
333
365
|
async getMainHeaderRow(options) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
366
|
+
await this.load(options);
|
|
367
|
+
return this.mainHeaderRow();
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Retrieves all body rows of the table.
|
|
371
|
+
* @param options.timout - Timeout in milliseconds for loading table data.
|
|
372
|
+
* @param options.bodyRowOptions.cellContentType - The content type for the body rows.
|
|
373
|
+
* @returns A promise that resolves to an array of body rows.
|
|
374
|
+
*/
|
|
339
375
|
async getBodyRows(options) {
|
|
340
|
-
await this.load({
|
|
376
|
+
await this.load({
|
|
377
|
+
timeout: options == null ? void 0 : options.timeout,
|
|
378
|
+
bodyRowOptions: options == null ? void 0 : options.bodyRowOptions,
|
|
379
|
+
headerRowOptions: {
|
|
380
|
+
colspan: { enabled: true }
|
|
381
|
+
}
|
|
382
|
+
});
|
|
341
383
|
return this._rows;
|
|
342
384
|
}
|
|
385
|
+
/**
|
|
386
|
+
* Retrieves a specific cell locator in the body of the table.
|
|
387
|
+
* @param rowNumber - The row number (0-based index).
|
|
388
|
+
* @param headerPosition - The header position (0-based index).
|
|
389
|
+
* @returns A Playwright Locator for the specified cell.
|
|
390
|
+
*/
|
|
343
391
|
getBodyCellLocator(rowNumber, headerPosition) {
|
|
344
392
|
return this._bodyRowLocator.nth(rowNumber).locator(this._bodyRowColumnSelector).nth(headerPosition);
|
|
345
393
|
}
|
|
394
|
+
/**
|
|
395
|
+
* Retrieves a cell locator in the body of the table based on row conditions and a target header.
|
|
396
|
+
* @param conditions - A record of header names and their expected values.
|
|
397
|
+
* @param targetHeader - The target header name for the desired cell.
|
|
398
|
+
* @param options - See {@link LoadOptions} for available options.
|
|
399
|
+
* @returns A promise that resolves to a Playwright Locator for the matching cell.
|
|
400
|
+
* @throws An error if no matching row is found or if a header is not found.
|
|
401
|
+
*/
|
|
346
402
|
async getBodyCellLocatorByRowConditions(conditions, targetHeader, options) {
|
|
403
|
+
var _a;
|
|
347
404
|
await this.load(options);
|
|
348
405
|
const headers = await this.getMainHeaderRow();
|
|
349
406
|
const targetHeaderIndex = headers.indexOf(targetHeader);
|
|
@@ -358,7 +415,8 @@ var PlaywrightTable = class {
|
|
|
358
415
|
if (headerIndex === -1) {
|
|
359
416
|
throw new Error(`Header "${header}" not found.`);
|
|
360
417
|
}
|
|
361
|
-
|
|
418
|
+
const cellValue = (_a = row[headerIndex]) != null ? _a : "";
|
|
419
|
+
if (cellValue !== value) {
|
|
362
420
|
matches = false;
|
|
363
421
|
break;
|
|
364
422
|
}
|
|
@@ -369,6 +427,13 @@ var PlaywrightTable = class {
|
|
|
369
427
|
}
|
|
370
428
|
throw new Error(`No row found matching conditions: ${JSON.stringify(conditions)}`);
|
|
371
429
|
}
|
|
430
|
+
/**
|
|
431
|
+
* Retrieves all cell locators in the body of the table for a specific header name.
|
|
432
|
+
* @param header - The header name.
|
|
433
|
+
* @param options - See {@link LoadOptions} for available options.
|
|
434
|
+
* @returns A promise that resolves to an array of Playwright Locators for the cells.
|
|
435
|
+
* @throws An error if the header is not found.
|
|
436
|
+
*/
|
|
372
437
|
async getAllBodyCellLocatorsByHeaderName(header, options) {
|
|
373
438
|
await this.load(options);
|
|
374
439
|
const headers = await this.getMainHeaderRow();
|
|
@@ -383,8 +448,14 @@ var PlaywrightTable = class {
|
|
|
383
448
|
}
|
|
384
449
|
return locators;
|
|
385
450
|
}
|
|
386
|
-
|
|
387
|
-
|
|
451
|
+
/**
|
|
452
|
+
* Retrieves all cell locators in the body of the table for a specific header index.
|
|
453
|
+
* @param headerIndex - The header index (0-based).
|
|
454
|
+
* @param options - See {@link LoadOptions} for available options.
|
|
455
|
+
* @returns A promise that resolves to an array of Playwright Locators for the cells.
|
|
456
|
+
*/
|
|
457
|
+
async getAllBodyCellLocatorsByHeaderIndex(headerIndex, options) {
|
|
458
|
+
await this.load(options);
|
|
388
459
|
const locators = [];
|
|
389
460
|
for (let rowIndex = 0; rowIndex < this._rows.length; rowIndex++) {
|
|
390
461
|
const cellLocator = this.getBodyCellLocator(rowIndex, headerIndex);
|
|
@@ -392,16 +463,26 @@ var PlaywrightTable = class {
|
|
|
392
463
|
}
|
|
393
464
|
return locators;
|
|
394
465
|
}
|
|
466
|
+
/**
|
|
467
|
+
* Converts the table data into a JSON object.
|
|
468
|
+
* @param options - See {@link LoadOptions} for available options.
|
|
469
|
+
* @returns A promise that resolves to a JSON representation of the table.
|
|
470
|
+
*/
|
|
395
471
|
async getJson(options) {
|
|
396
|
-
|
|
472
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
473
|
+
await this.load({
|
|
397
474
|
timeout: options == null ? void 0 : options.timeout,
|
|
398
|
-
|
|
475
|
+
bodyRowOptions: options == null ? void 0 : options.bodyRowOptions,
|
|
399
476
|
headerRowOptions: {
|
|
400
|
-
colspan: {
|
|
401
|
-
|
|
402
|
-
|
|
477
|
+
colspan: {
|
|
478
|
+
enabled: (_c = (_b = (_a = options == null ? void 0 : options.headerRowOptions) == null ? void 0 : _a.colspan) == null ? void 0 : _b.enabled) != null ? _c : true,
|
|
479
|
+
suffix: (_f = (_e = (_d = options == null ? void 0 : options.headerRowOptions) == null ? void 0 : _d.colspan) == null ? void 0 : _e.suffix) != null ? _f : true
|
|
480
|
+
},
|
|
481
|
+
duplicateSuffix: (_h = (_g = options == null ? void 0 : options.headerRowOptions) == null ? void 0 : _g.duplicateSuffix) != null ? _h : true,
|
|
482
|
+
emptyCellReplacement: (_j = (_i = options == null ? void 0 : options.headerRowOptions) == null ? void 0 : _i.emptyCellReplacement) != null ? _j : true
|
|
403
483
|
}
|
|
404
484
|
});
|
|
485
|
+
const headers = this.mainHeaderRow();
|
|
405
486
|
return this._rows.map((row) => {
|
|
406
487
|
const rowObj = {};
|
|
407
488
|
headers.forEach((header, index) => {
|
|
@@ -410,6 +491,11 @@ var PlaywrightTable = class {
|
|
|
410
491
|
return rowObj;
|
|
411
492
|
});
|
|
412
493
|
}
|
|
494
|
+
/**
|
|
495
|
+
* Waits for the header rows to be loaded.
|
|
496
|
+
* @param options - See {@link WaitForTableRowsOptions} for available options.
|
|
497
|
+
* @returns A promise that resolves when the header rows are loaded.
|
|
498
|
+
*/
|
|
413
499
|
async waitForHeaderRows(options) {
|
|
414
500
|
await (0, import_test2.expect)(
|
|
415
501
|
async () => await TableWait.waitForRows(this._headerRowLocator, this._headerColumnSelector, "header" /* Header */, options)
|
|
@@ -417,6 +503,11 @@ var PlaywrightTable = class {
|
|
|
417
503
|
timeout: options == null ? void 0 : options.timeout
|
|
418
504
|
});
|
|
419
505
|
}
|
|
506
|
+
/**
|
|
507
|
+
* Waits for the body rows to be loaded.
|
|
508
|
+
* @param options - See {@link WaitForTableRowsOptions} for available options.
|
|
509
|
+
* @returns A promise that resolves when the body rows are loaded.
|
|
510
|
+
*/
|
|
420
511
|
async waitForBodyRows(options) {
|
|
421
512
|
await (0, import_test2.expect)(
|
|
422
513
|
async () => await TableWait.waitForRows(this._bodyRowLocator, this._bodyRowColumnSelector, "body" /* Body */, options)
|
|
@@ -434,7 +525,11 @@ var PlaywrightTable = class {
|
|
|
434
525
|
this._headerColumnSelector,
|
|
435
526
|
options == null ? void 0 : options.headerRowOptions
|
|
436
527
|
);
|
|
437
|
-
this._rows = await TableBody.getRows(this._bodyRowLocator, this._bodyRowColumnSelector);
|
|
528
|
+
this._rows = await TableBody.getRows(this._bodyRowLocator, this._bodyRowColumnSelector, options == null ? void 0 : options.bodyRowOptions);
|
|
529
|
+
}
|
|
530
|
+
mainHeaderRow() {
|
|
531
|
+
var _a, _b;
|
|
532
|
+
return ((_b = (_a = this._options) == null ? void 0 : _a.header) == null ? void 0 : _b.setMainHeaderRow) ? this._headers[this._options.header.setMainHeaderRow] : this._headers[this._headers.length - 1];
|
|
438
533
|
}
|
|
439
534
|
};
|
|
440
535
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/playwright-table.ts","../src/cell-content-type.ts","../src/table-utils.ts","../src/table-body.ts","../src/table-header.ts","../src/table-wait.ts"],"sourcesContent":["export * from \"./playwright-table\";\r\nexport * from \"./row\";\r\nexport { HeaderRowOptions } from \"./table-header\";\r\nexport { CellContentType } from \"./cell-content-type\";\r\n","import { expect, Locator } from \"@playwright/test\";\r\nimport { TableBody } from \"./table-body\";\r\nimport { BodyRow, Cell, HeaderRow } from \"./row\";\r\nimport { HeaderRowOptions, TableHeader } from \"./table-header\";\r\nimport { RowKind, TableWait } from \"./table-wait\";\r\n\r\nexport class PlaywrightTable {\r\n\tprivate _headers: HeaderRow[] = [];\r\n\tprivate _rows: BodyRow[] = [];\r\n\tprivate _bodyRowLocator: Locator;\r\n\tprivate _bodyRowColumnSelector: string;\r\n\tprivate _headerRowLocator: Locator;\r\n\tprivate _headerColumnSelector: string;\r\n\r\n\tconstructor(\r\n\t\tprivate readonly _tableLocator: Locator,\r\n\t\tprivate readonly _options?: {\r\n\t\t\theader?: {\r\n\t\t\t\tsetMainHeaderRow?: number;\r\n\t\t\t\trowSelector?: string;\r\n\t\t\t\tcolumnSelector?: string;\r\n\t\t\t};\r\n\t\t\trow?: {\r\n\t\t\t\trowSelector?: string;\r\n\t\t\t\tcolumnSelector?: string;\r\n\t\t\t};\r\n\t\t}\r\n\t) {\r\n\t\tthis._headerRowLocator = this._tableLocator.locator(this._options?.header?.rowSelector ?? \"thead>tr\");\r\n\t\tthis._headerColumnSelector = this._options?.header?.columnSelector ?? \"th\";\r\n\t\tthis._bodyRowLocator = this._tableLocator.locator(this._options?.row?.rowSelector ?? \"tbody>tr\");\r\n\t\tthis._bodyRowColumnSelector = this._options?.row?.columnSelector ?? \"td\";\r\n\t}\r\n\r\n\tasync getHeaderRows(options?: {\r\n\t\ttimeout?: number;\r\n\t\tduplicateSuffix?: boolean;\r\n\t\theaderRowOptions?: HeaderRowOptions;\r\n\t}): Promise<HeaderRow[]> {\r\n\t\tawait this.load(options);\r\n\t\treturn this._headers;\r\n\t}\r\n\r\n\tasync getMainHeaderRow(options?: {\r\n\t\ttimeout?: number;\r\n\t\tduplicateSuffix?: boolean;\r\n\t\theaderRowOptions?: HeaderRowOptions;\r\n\t}): Promise<HeaderRow> {\r\n\t\tconst headerRows = await this.getHeaderRows(options);\r\n\t\tconst headers = this._options?.header?.setMainHeaderRow\r\n\t\t\t? headerRows[this._options.header.setMainHeaderRow]\r\n\t\t\t: headerRows[this._headers.length - 1];\r\n\t\treturn headers;\r\n\t}\r\n\r\n\tasync getBodyRows(options?: { timeout?: number }): Promise<BodyRow[]> {\r\n\t\tawait this.load({ ...options, headerRowOptions: { colspan: { enabled: true } } });\r\n\t\treturn this._rows;\r\n\t}\r\n\r\n\tgetBodyCellLocator(rowNumber: number, headerPosition: number): Locator {\r\n\t\treturn this._bodyRowLocator.nth(rowNumber).locator(this._bodyRowColumnSelector).nth(headerPosition);\r\n\t}\r\n\r\n\tasync getBodyCellLocatorByRowConditions(\r\n\t\tconditions: Record<string, string>,\r\n\t\ttargetHeader: string,\r\n\t\toptions?: { timeout?: number; duplicateSuffix?: boolean; colspanEnabled?: boolean }\r\n\t): Promise<Locator> {\r\n\t\tawait this.load(options);\r\n\t\tconst headers = await this.getMainHeaderRow();\r\n\r\n\t\tconst targetHeaderIndex = headers.indexOf(targetHeader);\r\n\t\tif (targetHeaderIndex === -1) {\r\n\t\t\tthrow new Error(`Header \"${targetHeader}\" not found.`);\r\n\t\t}\r\n\r\n\t\tfor (let rowIndex = 0; rowIndex < this._rows.length; rowIndex++) {\r\n\t\t\tconst row = this._rows[rowIndex];\r\n\t\t\tlet matches = true;\r\n\r\n\t\t\tfor (const [header, value] of Object.entries(conditions)) {\r\n\t\t\t\tconst headerIndex = headers.indexOf(header);\r\n\t\t\t\tif (headerIndex === -1) {\r\n\t\t\t\t\tthrow new Error(`Header \"${header}\" not found.`);\r\n\t\t\t\t}\r\n\t\t\t\tif (row[headerIndex] !== value) {\r\n\t\t\t\t\tmatches = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (matches) {\r\n\t\t\t\treturn this.getBodyCellLocator(rowIndex, targetHeaderIndex);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthrow new Error(`No row found matching conditions: ${JSON.stringify(conditions)}`);\r\n\t}\r\n\r\n\tasync getAllBodyCellLocatorsByHeaderName(header: string, options?: { timeout?: number }): Promise<Locator[]> {\r\n\t\tawait this.load(options);\r\n\t\tconst headers = await this.getMainHeaderRow();\r\n\t\tconst headerIndex = headers.indexOf(header);\r\n\t\tif (headerIndex === -1) {\r\n\t\t\tthrow new Error(`Header \"${header}\" not found.`);\r\n\t\t}\r\n\t\tconst locators: Locator[] = [];\r\n\t\tfor (let rowIndex = 0; rowIndex < this._rows.length; rowIndex++) {\r\n\t\t\tconst cellLocator = this.getBodyCellLocator(rowIndex, headerIndex);\r\n\t\t\tlocators.push(cellLocator);\r\n\t\t}\r\n\t\treturn locators;\r\n\t}\r\n\r\n\tasync getAllBodyCellLocatorsByHeaderIndex(headerIndex: number): Promise<Locator[]> {\r\n\t\tawait this.load();\r\n\t\tconst locators: Locator[] = [];\r\n\t\tfor (let rowIndex = 0; rowIndex < this._rows.length; rowIndex++) {\r\n\t\t\tconst cellLocator = this.getBodyCellLocator(rowIndex, headerIndex);\r\n\t\t\tlocators.push(cellLocator);\r\n\t\t}\r\n\t\treturn locators;\r\n\t}\r\n\r\n\tasync getJson(options?: { timeout?: number }): Promise<any> {\r\n\t\tconst headers = await this.getMainHeaderRow({\r\n\t\t\ttimeout: options?.timeout,\r\n\t\t\tduplicateSuffix: true,\r\n\t\t\theaderRowOptions: {\r\n\t\t\t\tcolspan: { enabled: true, suffix: true },\r\n\t\t\t\tduplicateSuffix: true,\r\n\t\t\t\temptyCellReplacement: true,\r\n\t\t\t},\r\n\t\t});\r\n\t\treturn this._rows.map(row => {\r\n\t\t\tconst rowObj: Record<string, Cell> = {};\r\n\t\t\theaders.forEach((header, index) => {\r\n\t\t\t\trowObj[header] = row[index] || \"\";\r\n\t\t\t});\r\n\t\t\treturn rowObj;\r\n\t\t});\r\n\t}\r\n\r\n\tasync waitForHeaderRows(options?: {\r\n\t\ttimeout?: number;\r\n\t\trow?: {\r\n\t\t\tamount?: number;\r\n\t\t\tcell?: {\r\n\t\t\t\ttotalCount?: number;\r\n\t\t\t\tcontentCount?: number;\r\n\t\t\t};\r\n\t\t};\r\n\t}): Promise<void> {\r\n\t\tawait expect(\r\n\t\t\tasync () =>\r\n\t\t\t\tawait TableWait.waitForRows(this._headerRowLocator, this._headerColumnSelector, RowKind.Header, options)\r\n\t\t).toPass({\r\n\t\t\ttimeout: options?.timeout,\r\n\t\t});\r\n\t}\r\n\r\n\tasync waitForBodyRows(options?: {\r\n\t\ttimeout?: number;\r\n\t\trow?: {\r\n\t\t\tamount?: number;\r\n\t\t\tcell?: {\r\n\t\t\t\ttotalCount?: number;\r\n\t\t\t\tcontentCount?: number;\r\n\t\t\t};\r\n\t\t};\r\n\t}): Promise<void> {\r\n\t\tawait expect(\r\n\t\t\tasync () => await TableWait.waitForRows(this._bodyRowLocator, this._bodyRowColumnSelector, RowKind.Body, options)\r\n\t\t).toPass({\r\n\t\t\ttimeout: options?.timeout,\r\n\t\t});\r\n\t}\r\n\r\n\tprivate async load(options?: { timeout?: number; headerRowOptions?: HeaderRowOptions }): Promise<void> {\r\n\t\tawait expect(async () => {\r\n\t\t\tawait TableWait.waitForRows(this._headerRowLocator, this._headerColumnSelector, RowKind.Header);\r\n\t\t\tawait TableWait.waitForRows(this._bodyRowLocator, this._bodyRowColumnSelector, RowKind.Body);\r\n\t\t}).toPass({ timeout: options?.timeout });\r\n\r\n\t\tthis._headers = await TableHeader.getRows(\r\n\t\t\tthis._headerRowLocator,\r\n\t\t\tthis._headerColumnSelector,\r\n\t\t\toptions?.headerRowOptions\r\n\t\t);\r\n\t\tthis._rows = await TableBody.getRows(this._bodyRowLocator, this._bodyRowColumnSelector);\r\n\t}\r\n}\r\n","export enum CellContentType {\r\n\tTextContent = \"textContent\",\r\n\tInnerText = \"innerText\",\r\n}\r\n","import { Locator } from \"@playwright/test\";\r\nimport { CellContentType } from \"./cell-content-type\";\r\nimport { Cell } from \"./row\";\r\n\r\nexport abstract class TableUtils {\r\n\tstatic async getCellContent(cell: Locator, cellContentType: CellContentType): Promise<string> {\r\n\t\tconst content = cellContentType === CellContentType.InnerText ? await cell.innerText() : await cell.textContent();\r\n\t\treturn content?.trim() || \"\";\r\n\t}\r\n\r\n\tstatic async parseSpanAttributes(cell: Locator): Promise<{ rowspan: number; colspan: number }> {\r\n\t\treturn {\r\n\t\t\trowspan: parseInt((await cell.getAttribute(\"rowspan\")) || \"1\", 10),\r\n\t\t\tcolspan: parseInt((await cell.getAttribute(\"colspan\")) || \"1\", 10),\r\n\t\t};\r\n\t}\r\n\r\n\tstatic castContent(value: string): Cell {\r\n\t\tconst trimmedValue = value.trim();\r\n\r\n\t\tif (trimmedValue === \"\") return \"\";\r\n\r\n\t\tconst lowerValue = trimmedValue.toLowerCase();\r\n\r\n\t\tif (lowerValue === \"true\") return true;\r\n\t\tif (lowerValue === \"false\") return false;\r\n\r\n\t\tconst num = Number(trimmedValue);\r\n\t\treturn isNaN(num) ? trimmedValue : num;\r\n\t}\r\n}\r\n","import { Locator } from \"@playwright/test\";\r\nimport { BodyRow, Cell } from \"./row\";\r\nimport { CellContentType } from \"./cell-content-type\";\r\nimport { TableUtils } from \"./table-utils\";\r\n\r\nexport abstract class TableBody {\r\n\tstatic async getRows(\r\n\t\trowLocator: Locator,\r\n\t\tcolumnsSelector: string,\r\n\t\tbodyRowsOptions?: {\r\n\t\t\tcellContentType?: CellContentType;\r\n\t\t}\r\n\t): Promise<BodyRow[]> {\r\n\t\tconst rows: BodyRow[] = [];\r\n\t\tconst rowsCount = await rowLocator.count();\r\n\t\tconst spannedCells: Record<number, Cell[]> = {};\r\n\r\n\t\tfor (let rowIndex = 0; rowIndex < rowsCount; rowIndex++) {\r\n\t\t\tconst row = rowLocator.nth(rowIndex);\r\n\t\t\tconst columns = await this.extractColumns(\r\n\t\t\t\trow,\r\n\t\t\t\tcolumnsSelector,\r\n\t\t\t\trowIndex,\r\n\t\t\t\tspannedCells,\r\n\t\t\t\tbodyRowsOptions?.cellContentType\r\n\t\t\t);\r\n\t\t\trows.push(columns as BodyRow);\r\n\t\t}\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\tprivate static async extractColumns(\r\n\t\trow: Locator,\r\n\t\tcolumnsSelector: string,\r\n\t\trowIndex: number,\r\n\t\tspannedCells: Record<number, Cell[]>,\r\n\t\tcellContentType?: CellContentType\r\n\t): Promise<Cell[]> {\r\n\t\tconst columns: Cell[] = [];\r\n\t\tconst columnLocators = row.locator(columnsSelector);\r\n\t\tconst columnCount = await columnLocators.count();\r\n\r\n\t\tfor (let colIndex = 0; colIndex < columnCount; colIndex++) {\r\n\t\t\tawait this.processColumn(\r\n\t\t\t\tcolumnLocators.nth(colIndex),\r\n\t\t\t\tcolIndex,\r\n\t\t\t\tcolumns,\r\n\t\t\t\trowIndex,\r\n\t\t\t\tspannedCells,\r\n\t\t\t\tcellContentType\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tthis.applySpannedCells(spannedCells, rowIndex, columns);\r\n\r\n\t\treturn columns;\r\n\t}\r\n\r\n\tprivate static async processColumn(\r\n\t\tcolumn: Locator,\r\n\t\tcolIndex: number,\r\n\t\tcolumns: Cell[],\r\n\t\trowIndex: number,\r\n\t\tspannedCells: Record<number, Cell[]>,\r\n\t\tcellContentType: CellContentType = CellContentType.InnerText\r\n\t): Promise<void> {\r\n\t\tconst content = await TableUtils.getCellContent(column, cellContentType);\r\n\t\tconst castedContent = TableUtils.castContent(content);\r\n\r\n\t\tconst { rowspan, colspan } = await TableUtils.parseSpanAttributes(column);\r\n\r\n\t\tfor (let span = 0; span < colspan; span++) {\r\n\t\t\tcolumns[colIndex + span] = castedContent;\r\n\t\t}\r\n\r\n\t\tif (rowspan > 1) {\r\n\t\t\tthis.storeSpannedCells(rowIndex, colIndex, rowspan, castedContent, spannedCells);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static storeSpannedCells(\r\n\t\trowIndex: number,\r\n\t\tcolIndex: number,\r\n\t\trowspan: number,\r\n\t\tcontent: Cell,\r\n\t\tspannedCells: Record<number, Cell[]>\r\n\t): void {\r\n\t\tfor (let span = 1; span < rowspan; span++) {\r\n\t\t\tif (!spannedCells[rowIndex + span]) {\r\n\t\t\t\tspannedCells[rowIndex + span] = [];\r\n\t\t\t}\r\n\t\t\tspannedCells[rowIndex + span][colIndex] = content;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static applySpannedCells(spannedCells: Record<number, Cell[]>, rowIndex: number, columns: Cell[]): void {\r\n\t\tif (spannedCells[rowIndex]) {\r\n\t\t\tspannedCells[rowIndex].forEach((spannedContent, colIndex) => {\r\n\t\t\t\tif (spannedContent !== undefined) {\r\n\t\t\t\t\tcolumns[colIndex] = spannedContent;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n","import { Locator } from \"@playwright/test\";\r\nimport { HeaderRow } from \"./row\";\r\nimport { CellContentType } from \"./cell-content-type\";\r\nimport { TableUtils } from \"./table-utils\";\r\n\r\nexport type HeaderRowOptions = {\r\n\tcellContentType?: CellContentType;\r\n\temptyCellReplacement?: boolean;\r\n\tduplicateSuffix?: boolean;\r\n\tcolspan?: { enabled?: boolean; suffix?: boolean };\r\n};\r\n\r\nexport abstract class TableHeader {\r\n\tstatic async getRows(\r\n\t\theaderRowLocator: Locator,\r\n\t\tcolumnsSelector: string,\r\n\t\theaderRowOptions?: HeaderRowOptions\r\n\t): Promise<HeaderRow[]> {\r\n\t\tconst options = this.getDefaultOptions(headerRowOptions);\r\n\t\tconst rows = await headerRowLocator.all();\r\n\t\tconst headerRows: HeaderRow[] = [];\r\n\t\tconst rowSpans: Map<number, string> = new Map();\r\n\r\n\t\tfor (const row of rows) {\r\n\t\t\tconst headerRow = await this.processRow(row, columnsSelector, rowSpans, options);\r\n\t\t\theaderRows.push(headerRow);\r\n\t\t}\r\n\r\n\t\tthis.applyColspanOptions(headerRows, options);\r\n\t\tthis.applyDuplicateSuffix(headerRows, options);\r\n\r\n\t\treturn headerRows;\r\n\t}\r\n\r\n\tprivate static getDefaultOptions(options?: HeaderRowOptions): Required<HeaderRowOptions> {\r\n\t\treturn {\r\n\t\t\tcellContentType: options?.cellContentType ?? CellContentType.InnerText,\r\n\t\t\temptyCellReplacement: options?.emptyCellReplacement ?? false,\r\n\t\t\tduplicateSuffix: options?.duplicateSuffix ?? false,\r\n\t\t\tcolspan: {\r\n\t\t\t\tenabled: options?.colspan?.enabled ?? false,\r\n\t\t\t\tsuffix: options?.colspan?.suffix ?? false,\r\n\t\t\t},\r\n\t\t};\r\n\t}\r\n\r\n\tprivate static async processRow(\r\n\t\trow: Locator,\r\n\t\tcolumnsSelector: string,\r\n\t\trowSpans: Map<number, string>,\r\n\t\toptions: Required<HeaderRowOptions>\r\n\t): Promise<HeaderRow> {\r\n\t\tconst headerRow: HeaderRow = [];\r\n\t\tconst cells = await row.locator(columnsSelector).all();\r\n\t\tlet columnIndex = 0;\r\n\r\n\t\tfor (const cell of cells) {\r\n\t\t\tcolumnIndex = await this.processCell(cell, headerRow, rowSpans, columnIndex, options);\r\n\t\t}\r\n\r\n\t\tthis.addRemainingRowSpans(headerRow, rowSpans, columnIndex);\r\n\t\treturn headerRow;\r\n\t}\r\n\r\n\tprivate static async processCell(\r\n\t\tcell: Locator,\r\n\t\theaderRow: HeaderRow,\r\n\t\trowSpans: Map<number, string>,\r\n\t\tcolumnIndex: number,\r\n\t\toptions: Required<HeaderRowOptions>\r\n\t): Promise<number> {\r\n\t\twhile (rowSpans.has(columnIndex)) {\r\n\t\t\theaderRow.push(rowSpans.get(columnIndex)!);\r\n\t\t\trowSpans.delete(columnIndex);\r\n\t\t\tcolumnIndex++;\r\n\t\t}\r\n\r\n\t\tlet text = await TableUtils.getCellContent(cell, options.cellContentType);\r\n\t\tif (!text && options.emptyCellReplacement) {\r\n\t\t\ttext = \"{{Empty}}\";\r\n\t\t}\r\n\r\n\t\tconst { colspan, rowspan } = await TableUtils.parseSpanAttributes(cell);\r\n\r\n\t\theaderRow.push(text);\r\n\t\tthis.handleColspan(headerRow, text, colspan);\r\n\t\tthis.handleRowspan(rowSpans, text, columnIndex, colspan, rowspan);\r\n\r\n\t\treturn columnIndex + colspan;\r\n\t}\r\n\r\n\tprivate static handleColspan(headerRow: HeaderRow, text: string, colspan: number): void {\r\n\t\tfor (let i = 1; i < colspan; i++) {\r\n\t\t\theaderRow.push(`${text}__C${i}`);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static handleRowspan(\r\n\t\trowSpans: Map<number, string>,\r\n\t\ttext: string,\r\n\t\tcolumnIndex: number,\r\n\t\tcolspan: number,\r\n\t\trowspan: number\r\n\t): void {\r\n\t\tif (rowspan > 1) {\r\n\t\t\tfor (let i = 0; i < colspan; i++) {\r\n\t\t\t\trowSpans.set(columnIndex + i, text);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static addRemainingRowSpans(headerRow: HeaderRow, rowSpans: Map<number, string>, columnIndex: number): void {\r\n\t\twhile (rowSpans.has(columnIndex)) {\r\n\t\t\theaderRow.push(rowSpans.get(columnIndex)!);\r\n\t\t\trowSpans.delete(columnIndex);\r\n\t\t\tcolumnIndex++;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static applyColspanOptions(headerRows: HeaderRow[], options: Required<HeaderRowOptions>): void {\r\n\t\tif (!options.colspan.enabled) {\r\n\t\t\tthis.removeColspanCells(headerRows);\r\n\t\t}\r\n\r\n\t\tif (!options.colspan.suffix) {\r\n\t\t\tthis.removeColspanSuffix(headerRows);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static removeColspanCells(headerRows: HeaderRow[]): void {\r\n\t\tfor (const headerRow of headerRows) {\r\n\t\t\tfor (let i = 0; i < headerRow.length; i++) {\r\n\t\t\t\tif (/__C\\d/.test(headerRow[i])) {\r\n\t\t\t\t\theaderRow.splice(i, 1);\r\n\t\t\t\t\ti--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static removeColspanSuffix(headerRows: HeaderRow[]): void {\r\n\t\tfor (const headerRow of headerRows) {\r\n\t\t\tfor (let i = 0; i < headerRow.length; i++) {\r\n\t\t\t\tif (/__C\\d/.test(headerRow[i])) {\r\n\t\t\t\t\theaderRow[i] = headerRow[i].replace(/__C\\d/, \"\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static applyDuplicateSuffix(headerRows: HeaderRow[], options: Required<HeaderRowOptions>): void {\r\n\t\tif (!options.duplicateSuffix) return;\r\n\r\n\t\tfor (const headerRow of headerRows) {\r\n\t\t\tconst headerCountMap: Map<string, number> = new Map();\r\n\t\t\tfor (let i = 0; i < headerRow.length; i++) {\r\n\t\t\t\tconst header = headerRow[i];\r\n\t\t\t\tif (headerCountMap.has(header)) {\r\n\t\t\t\t\tconst count = headerCountMap.get(header)!;\r\n\t\t\t\t\theaderRow[i] = `${header}__D${count}`;\r\n\t\t\t\t\theaderCountMap.set(header, count + 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\theaderCountMap.set(header, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import { Locator, expect } from \"@playwright/test\";\r\n\r\nexport enum RowKind {\r\n\tHeader = \"header\",\r\n\tBody = \"body\",\r\n}\r\n\r\nexport abstract class TableWait {\r\n\tstatic async waitForRows(\r\n\t\trowLocator: Locator,\r\n\t\tcellSelector: string,\r\n\t\trowKind: RowKind,\r\n\t\toptions?: {\r\n\t\t\trow?: {\r\n\t\t\t\tamount?: number;\r\n\t\t\t\tcell?: {\r\n\t\t\t\t\ttotalCount?: number;\r\n\t\t\t\t\tcontentCount?: number;\r\n\t\t\t\t};\r\n\t\t\t};\r\n\t\t}\r\n\t): Promise<void> {\r\n\t\tconst validateCellsWithContent = async (): Promise<void> => {\r\n\t\t\tconst cells = await rowLocator.locator(cellSelector).all();\r\n\t\t\tconst cellsWithContent = (\r\n\t\t\t\tawait Promise.all(\r\n\t\t\t\t\tcells.map(async cell => {\r\n\t\t\t\t\t\tconst content = await cell.textContent();\r\n\t\t\t\t\t\treturn content !== null && content.trim() !== \"\" ? cell : null;\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t).filter(cell => cell !== null);\r\n\t\t\texpect(cellsWithContent.length, `No ${rowKind} cells with content found`).toBeGreaterThan(0);\r\n\t\t};\r\n\r\n\t\tconst validateRowAmount = (rows: Locator[], expectedAmount: number): void => {\r\n\t\t\texpect(rows.length, `Expected ${expectedAmount} ${rowKind} rows, but found ${rows.length}`).toBe(expectedAmount);\r\n\t\t};\r\n\r\n\t\tconst validateCellCount = async (rows: Locator[], expectedCount: number): Promise<void> => {\r\n\t\t\tconst rowsWithMatchingCells = (\r\n\t\t\t\tawait Promise.all(\r\n\t\t\t\t\trows.map(async row => {\r\n\t\t\t\t\t\tconst cellCount = await row.locator(cellSelector).count();\r\n\t\t\t\t\t\treturn cellCount === expectedCount ? row : null;\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t).filter(row => row !== null);\r\n\t\t\texpect(\r\n\t\t\t\trowsWithMatchingCells.length,\r\n\t\t\t\t`Expected amount of ${expectedCount} ${rowKind} cells for row not found`\r\n\t\t\t).toBeGreaterThan(0);\r\n\t\t};\r\n\r\n\t\tconst validateCellContentCount = async (rows: Locator[], expectedContentCount: number): Promise<void> => {\r\n\t\t\tconst rowsWithMatchingContent = (\r\n\t\t\t\tawait Promise.all(\r\n\t\t\t\t\trows.map(async row => {\r\n\t\t\t\t\t\tconst cells = await row.locator(cellSelector).all();\r\n\t\t\t\t\t\tconst cellsWithContent = (\r\n\t\t\t\t\t\t\tawait Promise.all(\r\n\t\t\t\t\t\t\t\tcells.map(async cell => {\r\n\t\t\t\t\t\t\t\t\tconst content = await cell.textContent();\r\n\t\t\t\t\t\t\t\t\treturn content !== null && content.trim() !== \"\" ? cell : null;\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t).filter(cell => cell !== null);\r\n\t\t\t\t\t\treturn cellsWithContent.length === expectedContentCount ? row : null;\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t).filter(row => row !== null);\r\n\t\t\texpect(\r\n\t\t\t\trowsWithMatchingContent.length,\r\n\t\t\t\t`Expected amount of ${expectedContentCount} ${rowKind} cells with content for row not found`\r\n\t\t\t).toBeGreaterThan(0);\r\n\t\t};\r\n\r\n\t\tconst rows = await rowLocator.all();\r\n\r\n\t\tif (options?.row) {\r\n\t\t\tif (options.row.amount) {\r\n\t\t\t\tvalidateRowAmount(rows, options.row.amount);\r\n\t\t\t} else {\r\n\t\t\t\texpect(rows.length, `No ${rowKind} rows found`).toBeGreaterThan(0);\r\n\t\t\t}\r\n\r\n\t\t\tif (options.row.cell) {\r\n\t\t\t\tif (options.row.cell.totalCount) {\r\n\t\t\t\t\tawait validateCellCount(rows, options.row.cell.totalCount);\r\n\t\t\t\t}\r\n\t\t\t\tif (options.row.cell.contentCount) {\r\n\t\t\t\t\tawait validateCellContentCount(rows, options.row.cell.contentCount);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tawait validateCellsWithContent();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tawait validateCellsWithContent();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tawait validateCellsWithContent();\r\n\t\t}\r\n\t}\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAAgC;;;ACAzB,IAAK,kBAAL,kBAAKC,qBAAL;AACN,EAAAA,iBAAA,iBAAc;AACd,EAAAA,iBAAA,eAAY;AAFD,SAAAA;AAAA,GAAA;;;ACIL,IAAe,aAAf,MAA0B;AAAA,EAChC,aAAa,eAAe,MAAe,iBAAmD;AAC7F,UAAM,UAAU,kDAAgD,MAAM,KAAK,UAAU,IAAI,MAAM,KAAK,YAAY;AAChH,YAAO,mCAAS,WAAU;AAAA,EAC3B;AAAA,EAEA,aAAa,oBAAoB,MAA8D;AAC9F,WAAO;AAAA,MACN,SAAS,SAAU,MAAM,KAAK,aAAa,SAAS,KAAM,KAAK,EAAE;AAAA,MACjE,SAAS,SAAU,MAAM,KAAK,aAAa,SAAS,KAAM,KAAK,EAAE;AAAA,IAClE;AAAA,EACD;AAAA,EAEA,OAAO,YAAY,OAAqB;AACvC,UAAM,eAAe,MAAM,KAAK;AAEhC,QAAI,iBAAiB,GAAI,QAA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,UAAU,QAAQ,KAAK,iBAAiB,KAAK,sBAAsB;AAAA,EACvF;AACD;","names":["import_test","CellContentType","rows"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/playwright-table.ts","../src/cell-content-type.ts","../src/table-utils.ts","../src/table-body.ts","../src/table-header.ts","../src/table-wait.ts"],"sourcesContent":["export * from \"./playwright-table\";\r\nexport * from \"./row\";\r\nexport { HeaderRowOptions } from \"./table-header\";\r\nexport { CellContentType } from \"./cell-content-type\";\r\n","import { expect, Locator } from \"@playwright/test\";\r\nimport { TableBody } from \"./table-body\";\r\nimport { BodyRow, Cell, HeaderRow } from \"./row\";\r\nimport { HeaderRowOptions, TableHeader } from \"./table-header\";\r\nimport { RowKind, TableWait } from \"./table-wait\";\r\nimport { CellContentType } from \"./cell-content-type\";\r\n\r\n/**\r\n * Options for loading table data, headers, and rows.\r\n *\r\n * @example\r\n * // Wait up to 5 seconds and use custom cell content type for body rows\r\n * const options: LoadOptions = {\r\n * timeout: 5000,\r\n * bodyRowOptions: { cellContentType: CellContentType.TextContent },\r\n * headerRowOptions: {\r\n * colspan: { enabled: true, suffix: true },\r\n * duplicateSuffix: true,\r\n * emptyCellReplacement: false,\r\n * },\r\n * };\r\n * await table.getBodyRows(options);\r\n */\r\nexport type LoadOptions = {\r\n\t/** Timeout in milliseconds for loading table data. */\r\n\ttimeout?: number;\r\n\t/** See {@link HeaderRowOptions} for available options. */\r\n\theaderRowOptions?: HeaderRowOptions;\r\n\t/** Options for parsing body rows. */\r\n\tbodyRowOptions?: { cellContentType?: CellContentType };\r\n};\r\n\r\n/**\r\n * Options for waiting for table rows to appear or meet certain conditions.\r\n *\r\n * @example\r\n * // Wait for at least 3 body rows, each with 3 cells containing content, within 2 seconds\r\n * const waitOptions: WaitForTableRowsOptions = {\r\n * timeout: 2000,\r\n * row: {\r\n * amount: 3,\r\n * cell: {\r\n * totalCount: 3,\r\n * contentCount: 3,\r\n * },\r\n * },\r\n * };\r\n * await table.waitForBodyRows(waitOptions);\r\n */\r\nexport type WaitForTableRowsOptions = {\r\n\t/** Timeout in milliseconds for waiting. */\r\n\ttimeout?: number;\r\n\t/** Row and cell count/content conditions. */\r\n\trow?: {\r\n\t\t/** Expected number of rows. */\r\n\t\tamount?: number;\r\n\t\tcell?: {\r\n\t\t\t/** Expected number of cells per row. */\r\n\t\t\ttotalCount?: number;\r\n\t\t\t/** Expected number of cells with content per row. */\r\n\t\t\tcontentCount?: number;\r\n\t\t};\r\n\t};\r\n};\r\n\r\n/**\r\n * Represents a table in Playwright, providing methods to interact with its headers, rows, and cells.\r\n */\r\nexport class PlaywrightTable {\r\n\tprivate _headers: HeaderRow[] = [];\r\n\tprivate _rows: BodyRow[] = [];\r\n\tprivate _bodyRowLocator: Locator;\r\n\tprivate _bodyRowColumnSelector: string;\r\n\tprivate _headerRowLocator: Locator;\r\n\tprivate _headerColumnSelector: string;\r\n\r\n\t/**\r\n\t * Creates an instance of the table handler with customizable selectors for headers and rows.\r\n\t *\r\n\t * @param _tableLocator - The Playwright `Locator` pointing to the root table element.\r\n\t * @param _options - Optional configuration for customizing header and row selectors.\r\n\t * @param _options.header - Options for header row and columns.\r\n\t * @param _options.header.setMainHeaderRow - (Optional) Index of the main header row if multiple header rows exist.\r\n\t * @param _options.header.rowSelector - (Optional) CSS selector for locating header rows. Defaults to `\"thead>tr\"`.\r\n\t * @param _options.header.columnSelector - (Optional) CSS selector for locating header columns. Defaults to `\"th\"`.\r\n\t * @param _options.row - Options for body rows and columns.\r\n\t * @param _options.row.rowSelector - (Optional) CSS selector for locating body rows. Defaults to `\"tbody>tr\"`.\r\n\t * @param _options.row.columnSelector - (Optional) CSS selector for locating body columns. Defaults to `\"td\"`.\r\n\t *\r\n\t * @example\r\n\t * const table = new PlaywrightTable(\r\n\t * page.locator('table.my-table'),\r\n\t * {\r\n\t * header: {\r\n\t * rowSelector: 'thead tr.header',\r\n\t * columnSelector: 'th.header-cell'\r\n\t * },\r\n\t * row: {\r\n\t * rowSelector: 'tbody tr.data-row',\r\n\t * columnSelector: 'td.data-cell'\r\n\t * }\r\n\t * }\r\n\t * );\r\n\t */\r\n\tconstructor(\r\n\t\tprivate readonly _tableLocator: Locator,\r\n\t\tprivate readonly _options?: {\r\n\t\t\theader?: {\r\n\t\t\t\tsetMainHeaderRow?: number;\r\n\t\t\t\trowSelector?: string;\r\n\t\t\t\tcolumnSelector?: string;\r\n\t\t\t};\r\n\t\t\trow?: {\r\n\t\t\t\trowSelector?: string;\r\n\t\t\t\tcolumnSelector?: string;\r\n\t\t\t};\r\n\t\t}\r\n\t) {\r\n\t\tthis._headerRowLocator = this._tableLocator.locator(this._options?.header?.rowSelector ?? \"thead>tr\");\r\n\t\tthis._headerColumnSelector = this._options?.header?.columnSelector ?? \"th\";\r\n\t\tthis._bodyRowLocator = this._tableLocator.locator(this._options?.row?.rowSelector ?? \"tbody>tr\");\r\n\t\tthis._bodyRowColumnSelector = this._options?.row?.columnSelector ?? \"td\";\r\n\t}\r\n\r\n\t/**\r\n\t * Retrieves all header rows of the table.\r\n\t * @param options - Optional parameters for timeout and header row options.\r\n\t * @param options.timeout - Timeout in milliseconds for loading table data.\r\n\t * @param options.headerRowOptions - See {@link HeaderRowOptions} for available options.\r\n\t * @returns A promise that resolves to an array of header rows.\r\n\t */\r\n\tasync getHeaderRows(options?: Pick<LoadOptions, \"timeout\" | \"headerRowOptions\">): Promise<HeaderRow[]> {\r\n\t\tawait this.load(options);\r\n\t\treturn this._headers;\r\n\t}\r\n\r\n\t/**\r\n\t * Retrieves the main header row of the table.\r\n\t * @param options - Optional parameters for timeout and header row options.\r\n\t * @param options.timeout - Timeout in milliseconds for loading table data.\r\n\t * @param options.headerRowOptions - See {@link HeaderRowOptions} for available options.\r\n\t * @returns A promise that resolves to the main header row.\r\n\t */\r\n\tasync getMainHeaderRow(options?: Pick<LoadOptions, \"timeout\" | \"headerRowOptions\">): Promise<HeaderRow> {\r\n\t\tawait this.load(options);\r\n\t\treturn this.mainHeaderRow();\r\n\t}\r\n\r\n\t/**\r\n\t * Retrieves all body rows of the table.\r\n\t * @param options.timout - Timeout in milliseconds for loading table data.\r\n\t * @param options.bodyRowOptions.cellContentType - The content type for the body rows.\r\n\t * @returns A promise that resolves to an array of body rows.\r\n\t */\r\n\tasync getBodyRows(options?: Pick<LoadOptions, \"timeout\" | \"bodyRowOptions\">): Promise<BodyRow[]> {\r\n\t\tawait this.load({\r\n\t\t\ttimeout: options?.timeout,\r\n\t\t\tbodyRowOptions: options?.bodyRowOptions,\r\n\t\t\theaderRowOptions: {\r\n\t\t\t\tcolspan: { enabled: true },\r\n\t\t\t},\r\n\t\t});\r\n\t\treturn this._rows;\r\n\t}\r\n\r\n\t/**\r\n\t * Retrieves a specific cell locator in the body of the table.\r\n\t * @param rowNumber - The row number (0-based index).\r\n\t * @param headerPosition - The header position (0-based index).\r\n\t * @returns A Playwright Locator for the specified cell.\r\n\t */\r\n\tgetBodyCellLocator(rowNumber: number, headerPosition: number): Locator {\r\n\t\treturn this._bodyRowLocator.nth(rowNumber).locator(this._bodyRowColumnSelector).nth(headerPosition);\r\n\t}\r\n\r\n\t/**\r\n\t * Retrieves a cell locator in the body of the table based on row conditions and a target header.\r\n\t * @param conditions - A record of header names and their expected values.\r\n\t * @param targetHeader - The target header name for the desired cell.\r\n\t * @param options - See {@link LoadOptions} for available options.\r\n\t * @returns A promise that resolves to a Playwright Locator for the matching cell.\r\n\t * @throws An error if no matching row is found or if a header is not found.\r\n\t */\r\n\tasync getBodyCellLocatorByRowConditions(\r\n\t\tconditions: Record<string, string>,\r\n\t\ttargetHeader: string,\r\n\t\toptions?: LoadOptions\r\n\t): Promise<Locator> {\r\n\t\tawait this.load(options);\r\n\t\tconst headers = await this.getMainHeaderRow();\r\n\r\n\t\tconst targetHeaderIndex = headers.indexOf(targetHeader);\r\n\t\tif (targetHeaderIndex === -1) {\r\n\t\t\tthrow new Error(`Header \"${targetHeader}\" not found.`);\r\n\t\t}\r\n\r\n\t\tfor (let rowIndex = 0; rowIndex < this._rows.length; rowIndex++) {\r\n\t\t\tconst row = this._rows[rowIndex];\r\n\t\t\tlet matches = true;\r\n\r\n\t\t\tfor (const [header, value] of Object.entries(conditions)) {\r\n\t\t\t\tconst headerIndex = headers.indexOf(header);\r\n\t\t\t\tif (headerIndex === -1) {\r\n\t\t\t\t\tthrow new Error(`Header \"${header}\" not found.`);\r\n\t\t\t\t}\r\n\t\t\t\tconst cellValue = row[headerIndex] ?? \"\";\r\n\t\t\t\tif (cellValue !== value) {\r\n\t\t\t\t\tmatches = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (matches) {\r\n\t\t\t\treturn this.getBodyCellLocator(rowIndex, targetHeaderIndex);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthrow new Error(`No row found matching conditions: ${JSON.stringify(conditions)}`);\r\n\t}\r\n\r\n\t/**\r\n\t * Retrieves all cell locators in the body of the table for a specific header name.\r\n\t * @param header - The header name.\r\n\t * @param options - See {@link LoadOptions} for available options.\r\n\t * @returns A promise that resolves to an array of Playwright Locators for the cells.\r\n\t * @throws An error if the header is not found.\r\n\t */\r\n\tasync getAllBodyCellLocatorsByHeaderName(header: string, options?: LoadOptions): Promise<Locator[]> {\r\n\t\tawait this.load(options);\r\n\t\tconst headers = await this.getMainHeaderRow();\r\n\t\tconst headerIndex = headers.indexOf(header);\r\n\t\tif (headerIndex === -1) {\r\n\t\t\tthrow new Error(`Header \"${header}\" not found.`);\r\n\t\t}\r\n\t\tconst locators: Locator[] = [];\r\n\t\tfor (let rowIndex = 0; rowIndex < this._rows.length; rowIndex++) {\r\n\t\t\tconst cellLocator = this.getBodyCellLocator(rowIndex, headerIndex);\r\n\t\t\tlocators.push(cellLocator);\r\n\t\t}\r\n\t\treturn locators;\r\n\t}\r\n\r\n\t/**\r\n\t * Retrieves all cell locators in the body of the table for a specific header index.\r\n\t * @param headerIndex - The header index (0-based).\r\n\t * @param options - See {@link LoadOptions} for available options.\r\n\t * @returns A promise that resolves to an array of Playwright Locators for the cells.\r\n\t */\r\n\tasync getAllBodyCellLocatorsByHeaderIndex(headerIndex: number, options?: LoadOptions): Promise<Locator[]> {\r\n\t\tawait this.load(options);\r\n\t\tconst locators: Locator[] = [];\r\n\t\tfor (let rowIndex = 0; rowIndex < this._rows.length; rowIndex++) {\r\n\t\t\tconst cellLocator = this.getBodyCellLocator(rowIndex, headerIndex);\r\n\t\t\tlocators.push(cellLocator);\r\n\t\t}\r\n\t\treturn locators;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts the table data into a JSON object.\r\n\t * @param options - See {@link LoadOptions} for available options.\r\n\t * @returns A promise that resolves to a JSON representation of the table.\r\n\t */\r\n\tasync getJson(options?: LoadOptions): Promise<any> {\r\n\t\tawait this.load({\r\n\t\t\ttimeout: options?.timeout,\r\n\t\t\tbodyRowOptions: options?.bodyRowOptions,\r\n\t\t\theaderRowOptions: {\r\n\t\t\t\tcolspan: {\r\n\t\t\t\t\tenabled: options?.headerRowOptions?.colspan?.enabled ?? true,\r\n\t\t\t\t\tsuffix: options?.headerRowOptions?.colspan?.suffix ?? true,\r\n\t\t\t\t},\r\n\t\t\t\tduplicateSuffix: options?.headerRowOptions?.duplicateSuffix ?? true,\r\n\t\t\t\temptyCellReplacement: options?.headerRowOptions?.emptyCellReplacement ?? true,\r\n\t\t\t},\r\n\t\t});\r\n\r\n\t\tconst headers = this.mainHeaderRow();\r\n\t\treturn this._rows.map(row => {\r\n\t\t\tconst rowObj: Record<string, Cell> = {};\r\n\t\t\theaders.forEach((header, index) => {\r\n\t\t\t\trowObj[header] = row[index] || \"\";\r\n\t\t\t});\r\n\t\t\treturn rowObj;\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Waits for the header rows to be loaded.\r\n\t * @param options - See {@link WaitForTableRowsOptions} for available options.\r\n\t * @returns A promise that resolves when the header rows are loaded.\r\n\t */\r\n\tasync waitForHeaderRows(options?: WaitForTableRowsOptions): Promise<void> {\r\n\t\tawait expect(\r\n\t\t\tasync () =>\r\n\t\t\t\tawait TableWait.waitForRows(this._headerRowLocator, this._headerColumnSelector, RowKind.Header, options)\r\n\t\t).toPass({\r\n\t\t\ttimeout: options?.timeout,\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Waits for the body rows to be loaded.\r\n\t * @param options - See {@link WaitForTableRowsOptions} for available options.\r\n\t * @returns A promise that resolves when the body rows are loaded.\r\n\t */\r\n\tasync waitForBodyRows(options?: WaitForTableRowsOptions): Promise<void> {\r\n\t\tawait expect(\r\n\t\t\tasync () => await TableWait.waitForRows(this._bodyRowLocator, this._bodyRowColumnSelector, RowKind.Body, options)\r\n\t\t).toPass({\r\n\t\t\ttimeout: options?.timeout,\r\n\t\t});\r\n\t}\r\n\r\n\tprivate async load(options?: LoadOptions): Promise<void> {\r\n\t\tawait expect(async () => {\r\n\t\t\tawait TableWait.waitForRows(this._headerRowLocator, this._headerColumnSelector, RowKind.Header);\r\n\t\t\tawait TableWait.waitForRows(this._bodyRowLocator, this._bodyRowColumnSelector, RowKind.Body);\r\n\t\t}).toPass({ timeout: options?.timeout });\r\n\r\n\t\tthis._headers = await TableHeader.getRows(\r\n\t\t\tthis._headerRowLocator,\r\n\t\t\tthis._headerColumnSelector,\r\n\t\t\toptions?.headerRowOptions\r\n\t\t);\r\n\t\tthis._rows = await TableBody.getRows(this._bodyRowLocator, this._bodyRowColumnSelector, options?.bodyRowOptions);\r\n\t}\r\n\r\n\tprivate mainHeaderRow(): HeaderRow {\r\n\t\treturn this._options?.header?.setMainHeaderRow\r\n\t\t\t? this._headers[this._options.header.setMainHeaderRow]\r\n\t\t\t: this._headers[this._headers.length - 1];\r\n\t}\r\n}\r\n","/**\r\n * Enum representing the possible types of content that can be extracted from a table cell.\r\n *\r\n * - `TextContent`: The raw text content of the cell, including hidden elements and extra whitespace.\r\n * - `InnerText`: The rendered text content of the cell, as seen by the user, with whitespace collapsed and hidden elements excluded.\r\n */\r\nexport enum CellContentType {\r\n\tTextContent = \"textContent\",\r\n\tInnerText = \"innerText\",\r\n}\r\n","import { Locator } from \"@playwright/test\";\r\nimport { CellContentType } from \"./cell-content-type\";\r\n\r\nexport abstract class TableUtils {\r\n\tstatic async getCellContent(cell: Locator, cellContentType: CellContentType): Promise<string> {\r\n\t\tconst content = cellContentType === CellContentType.InnerText ? await cell.innerText() : await cell.textContent();\r\n\t\treturn content?.trim() || \"\";\r\n\t}\r\n\r\n\tstatic async parseSpanAttributes(cell: Locator): Promise<{ rowspan: number; colspan: number }> {\r\n\t\treturn {\r\n\t\t\trowspan: parseInt((await cell.getAttribute(\"rowspan\")) || \"1\", 10),\r\n\t\t\tcolspan: parseInt((await cell.getAttribute(\"colspan\")) || \"1\", 10),\r\n\t\t};\r\n\t}\r\n}\r\n","import { Locator } from \"@playwright/test\";\r\nimport { BodyRow, Cell } from \"./row\";\r\nimport { CellContentType } from \"./cell-content-type\";\r\nimport { TableUtils } from \"./table-utils\";\r\n\r\nexport abstract class TableBody {\r\n\tstatic async getRows(\r\n\t\trowLocator: Locator,\r\n\t\tcolumnsSelector: string,\r\n\t\tbodyRowsOptions?: {\r\n\t\t\tcellContentType?: CellContentType;\r\n\t\t}\r\n\t): Promise<BodyRow[]> {\r\n\t\tconst rows: BodyRow[] = [];\r\n\t\tconst rowsCount = await rowLocator.count();\r\n\t\tconst spannedCells: Record<number, Cell[]> = {};\r\n\r\n\t\tfor (let rowIndex = 0; rowIndex < rowsCount; rowIndex++) {\r\n\t\t\tconst row = rowLocator.nth(rowIndex);\r\n\t\t\tconst columns = await this.extractColumns(\r\n\t\t\t\trow,\r\n\t\t\t\tcolumnsSelector,\r\n\t\t\t\trowIndex,\r\n\t\t\t\tspannedCells,\r\n\t\t\t\tbodyRowsOptions?.cellContentType\r\n\t\t\t);\r\n\t\t\trows.push(columns as BodyRow);\r\n\t\t}\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\tprivate static async extractColumns(\r\n\t\trow: Locator,\r\n\t\tcolumnsSelector: string,\r\n\t\trowIndex: number,\r\n\t\tspannedCells: Record<number, Cell[]>,\r\n\t\tcellContentType?: CellContentType\r\n\t): Promise<Cell[]> {\r\n\t\tconst columns: Cell[] = [];\r\n\t\tconst columnLocators = row.locator(columnsSelector);\r\n\t\tconst columnCount = await columnLocators.count();\r\n\r\n\t\tfor (let colIndex = 0; colIndex < columnCount; colIndex++) {\r\n\t\t\tawait this.processColumn(\r\n\t\t\t\tcolumnLocators.nth(colIndex),\r\n\t\t\t\tcolIndex,\r\n\t\t\t\tcolumns,\r\n\t\t\t\trowIndex,\r\n\t\t\t\tspannedCells,\r\n\t\t\t\tcellContentType\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tthis.applySpannedCells(spannedCells, rowIndex, columns);\r\n\r\n\t\treturn columns;\r\n\t}\r\n\r\n\tprivate static async processColumn(\r\n\t\tcolumn: Locator,\r\n\t\tcolIndex: number,\r\n\t\tcolumns: Cell[],\r\n\t\trowIndex: number,\r\n\t\tspannedCells: Record<number, Cell[]>,\r\n\t\tcellContentType: CellContentType = CellContentType.InnerText\r\n\t): Promise<void> {\r\n\t\tconst content = await TableUtils.getCellContent(column, cellContentType);\r\n\t\tconst { rowspan, colspan } = await TableUtils.parseSpanAttributes(column);\r\n\r\n\t\tfor (let span = 0; span < colspan; span++) {\r\n\t\t\tcolumns[colIndex + span] = content;\r\n\t\t}\r\n\r\n\t\tif (rowspan > 1) {\r\n\t\t\tthis.storeSpannedCells(rowIndex, colIndex, rowspan, content, spannedCells);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static storeSpannedCells(\r\n\t\trowIndex: number,\r\n\t\tcolIndex: number,\r\n\t\trowspan: number,\r\n\t\tcontent: Cell,\r\n\t\tspannedCells: Record<number, Cell[]>\r\n\t): void {\r\n\t\tfor (let span = 1; span < rowspan; span++) {\r\n\t\t\tif (!spannedCells[rowIndex + span]) {\r\n\t\t\t\tspannedCells[rowIndex + span] = [];\r\n\t\t\t}\r\n\t\t\tspannedCells[rowIndex + span][colIndex] = content;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static applySpannedCells(spannedCells: Record<number, Cell[]>, rowIndex: number, columns: Cell[]): void {\r\n\t\tif (spannedCells[rowIndex]) {\r\n\t\t\tspannedCells[rowIndex].forEach((spannedContent, colIndex) => {\r\n\t\t\t\tif (spannedContent !== undefined) {\r\n\t\t\t\t\tcolumns[colIndex] = spannedContent;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n","import { Locator } from \"@playwright/test\";\r\nimport { HeaderRow } from \"./row\";\r\nimport { CellContentType } from \"./cell-content-type\";\r\nimport { TableUtils } from \"./table-utils\";\r\n\r\n/**\r\n * Options for configuring a table header row.\r\n *\r\n * @property cellContentType - The type of content allowed in the header cell.\r\n * @property emptyCellReplacement - If true, replaces empty header cells with a default value.\r\n * @property duplicateSuffix - If true, appends a suffix to duplicate header values.\r\n * @property colspan - Configuration for column spanning in the header row.\r\n * @property colspan.enabled - If true, enables column spanning.\r\n * @property colspan.suffix - If true, appends a suffix to spanned columns.\r\n */\r\nexport type HeaderRowOptions = {\r\n\tcellContentType?: CellContentType;\r\n\temptyCellReplacement?: boolean;\r\n\tduplicateSuffix?: boolean;\r\n\tcolspan?: { enabled?: boolean; suffix?: boolean };\r\n};\r\n\r\nexport abstract class TableHeader {\r\n\tstatic async getRows(\r\n\t\theaderRowLocator: Locator,\r\n\t\tcolumnsSelector: string,\r\n\t\theaderRowOptions?: HeaderRowOptions\r\n\t): Promise<HeaderRow[]> {\r\n\t\tconst options = this.getDefaultOptions(headerRowOptions);\r\n\t\tconst rows = await headerRowLocator.all();\r\n\t\tconst headerRows: HeaderRow[] = [];\r\n\t\tconst rowSpans: Map<number, string> = new Map();\r\n\r\n\t\tfor (const row of rows) {\r\n\t\t\tconst headerRow = await this.processRow(row, columnsSelector, rowSpans, options);\r\n\t\t\theaderRows.push(headerRow);\r\n\t\t}\r\n\r\n\t\tthis.applyColspanOptions(headerRows, options);\r\n\t\tthis.applyDuplicateSuffix(headerRows, options);\r\n\r\n\t\treturn headerRows;\r\n\t}\r\n\r\n\tprivate static getDefaultOptions(options?: HeaderRowOptions): Required<HeaderRowOptions> {\r\n\t\treturn {\r\n\t\t\tcellContentType: options?.cellContentType ?? CellContentType.InnerText,\r\n\t\t\temptyCellReplacement: options?.emptyCellReplacement ?? false,\r\n\t\t\tduplicateSuffix: options?.duplicateSuffix ?? false,\r\n\t\t\tcolspan: {\r\n\t\t\t\tenabled: options?.colspan?.enabled ?? false,\r\n\t\t\t\tsuffix: options?.colspan?.suffix ?? false,\r\n\t\t\t},\r\n\t\t};\r\n\t}\r\n\r\n\tprivate static async processRow(\r\n\t\trow: Locator,\r\n\t\tcolumnsSelector: string,\r\n\t\trowSpans: Map<number, string>,\r\n\t\toptions: Required<HeaderRowOptions>\r\n\t): Promise<HeaderRow> {\r\n\t\tconst headerRow: HeaderRow = [];\r\n\t\tconst cells = await row.locator(columnsSelector).all();\r\n\t\tlet columnIndex = 0;\r\n\r\n\t\tfor (const cell of cells) {\r\n\t\t\tcolumnIndex = await this.processCell(cell, headerRow, rowSpans, columnIndex, options);\r\n\t\t}\r\n\r\n\t\tthis.addRemainingRowSpans(headerRow, rowSpans, columnIndex);\r\n\t\treturn headerRow;\r\n\t}\r\n\r\n\tprivate static async processCell(\r\n\t\tcell: Locator,\r\n\t\theaderRow: HeaderRow,\r\n\t\trowSpans: Map<number, string>,\r\n\t\tcolumnIndex: number,\r\n\t\toptions: Required<HeaderRowOptions>\r\n\t): Promise<number> {\r\n\t\twhile (rowSpans.has(columnIndex)) {\r\n\t\t\theaderRow.push(rowSpans.get(columnIndex)!);\r\n\t\t\trowSpans.delete(columnIndex);\r\n\t\t\tcolumnIndex++;\r\n\t\t}\r\n\r\n\t\tlet text = await TableUtils.getCellContent(cell, options.cellContentType);\r\n\t\tif (!text && options.emptyCellReplacement) {\r\n\t\t\ttext = \"{{Empty}}\";\r\n\t\t}\r\n\r\n\t\tconst { colspan, rowspan } = await TableUtils.parseSpanAttributes(cell);\r\n\r\n\t\theaderRow.push(text);\r\n\t\tthis.handleColspan(headerRow, text, colspan);\r\n\t\tthis.handleRowspan(rowSpans, text, columnIndex, colspan, rowspan);\r\n\r\n\t\treturn columnIndex + colspan;\r\n\t}\r\n\r\n\tprivate static handleColspan(headerRow: HeaderRow, text: string, colspan: number): void {\r\n\t\tfor (let i = 1; i < colspan; i++) {\r\n\t\t\theaderRow.push(`${text}__C${i}`);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static handleRowspan(\r\n\t\trowSpans: Map<number, string>,\r\n\t\ttext: string,\r\n\t\tcolumnIndex: number,\r\n\t\tcolspan: number,\r\n\t\trowspan: number\r\n\t): void {\r\n\t\tif (rowspan > 1) {\r\n\t\t\tfor (let i = 0; i < colspan; i++) {\r\n\t\t\t\trowSpans.set(columnIndex + i, text);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static addRemainingRowSpans(headerRow: HeaderRow, rowSpans: Map<number, string>, columnIndex: number): void {\r\n\t\twhile (rowSpans.has(columnIndex)) {\r\n\t\t\theaderRow.push(rowSpans.get(columnIndex)!);\r\n\t\t\trowSpans.delete(columnIndex);\r\n\t\t\tcolumnIndex++;\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static applyColspanOptions(headerRows: HeaderRow[], options: Required<HeaderRowOptions>): void {\r\n\t\tif (!options.colspan.enabled) {\r\n\t\t\tthis.removeColspanCells(headerRows);\r\n\t\t}\r\n\r\n\t\tif (!options.colspan.suffix) {\r\n\t\t\tthis.removeColspanSuffix(headerRows);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static removeColspanCells(headerRows: HeaderRow[]): void {\r\n\t\tfor (const headerRow of headerRows) {\r\n\t\t\tfor (let i = 0; i < headerRow.length; i++) {\r\n\t\t\t\tif (/__C\\d/.test(headerRow[i])) {\r\n\t\t\t\t\theaderRow.splice(i, 1);\r\n\t\t\t\t\ti--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static removeColspanSuffix(headerRows: HeaderRow[]): void {\r\n\t\tfor (const headerRow of headerRows) {\r\n\t\t\tfor (let i = 0; i < headerRow.length; i++) {\r\n\t\t\t\tif (/__C\\d/.test(headerRow[i])) {\r\n\t\t\t\t\theaderRow[i] = headerRow[i].replace(/__C\\d/, \"\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprivate static applyDuplicateSuffix(headerRows: HeaderRow[], options: Required<HeaderRowOptions>): void {\r\n\t\tif (!options.duplicateSuffix) return;\r\n\r\n\t\tfor (const headerRow of headerRows) {\r\n\t\t\tconst headerCountMap: Map<string, number> = new Map();\r\n\t\t\tfor (let i = 0; i < headerRow.length; i++) {\r\n\t\t\t\tconst header = headerRow[i];\r\n\t\t\t\tif (headerCountMap.has(header)) {\r\n\t\t\t\t\tconst count = headerCountMap.get(header)!;\r\n\t\t\t\t\theaderRow[i] = `${header}__D${count}`;\r\n\t\t\t\t\theaderCountMap.set(header, count + 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\theaderCountMap.set(header, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import { Locator, expect } from \"@playwright/test\";\r\n\r\nexport enum RowKind {\r\n\tHeader = \"header\",\r\n\tBody = \"body\",\r\n}\r\n\r\nexport abstract class TableWait {\r\n\tstatic async waitForRows(\r\n\t\trowLocator: Locator,\r\n\t\tcellSelector: string,\r\n\t\trowKind: RowKind,\r\n\t\toptions?: {\r\n\t\t\trow?: {\r\n\t\t\t\tamount?: number;\r\n\t\t\t\tcell?: {\r\n\t\t\t\t\ttotalCount?: number;\r\n\t\t\t\t\tcontentCount?: number;\r\n\t\t\t\t};\r\n\t\t\t};\r\n\t\t}\r\n\t): Promise<void> {\r\n\t\tconst validateCellsWithContent = async (): Promise<void> => {\r\n\t\t\tconst cells = await rowLocator.locator(cellSelector).all();\r\n\t\t\tconst cellsWithContent = (\r\n\t\t\t\tawait Promise.all(\r\n\t\t\t\t\tcells.map(async cell => {\r\n\t\t\t\t\t\tconst content = await cell.textContent();\r\n\t\t\t\t\t\treturn content !== null && content.trim() !== \"\" ? cell : null;\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t).filter(cell => cell !== null);\r\n\t\t\texpect(cellsWithContent.length, `No ${rowKind} cells with content found`).toBeGreaterThan(0);\r\n\t\t};\r\n\r\n\t\tconst validateRowAmount = (rows: Locator[], expectedAmount: number): void => {\r\n\t\t\texpect(rows.length, `Expected ${expectedAmount} ${rowKind} rows, but found ${rows.length}`).toBe(expectedAmount);\r\n\t\t};\r\n\r\n\t\tconst validateCellCount = async (rows: Locator[], expectedCount: number): Promise<void> => {\r\n\t\t\tconst rowsWithMatchingCells = (\r\n\t\t\t\tawait Promise.all(\r\n\t\t\t\t\trows.map(async row => {\r\n\t\t\t\t\t\tconst cellCount = await row.locator(cellSelector).count();\r\n\t\t\t\t\t\treturn cellCount === expectedCount ? row : null;\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t).filter(row => row !== null);\r\n\t\t\texpect(\r\n\t\t\t\trowsWithMatchingCells.length,\r\n\t\t\t\t`Expected amount of ${expectedCount} ${rowKind} cells for row not found`\r\n\t\t\t).toBeGreaterThan(0);\r\n\t\t};\r\n\r\n\t\tconst validateCellContentCount = async (rows: Locator[], expectedContentCount: number): Promise<void> => {\r\n\t\t\tconst rowsWithMatchingContent = (\r\n\t\t\t\tawait Promise.all(\r\n\t\t\t\t\trows.map(async row => {\r\n\t\t\t\t\t\tconst cells = await row.locator(cellSelector).all();\r\n\t\t\t\t\t\tconst cellsWithContent = (\r\n\t\t\t\t\t\t\tawait Promise.all(\r\n\t\t\t\t\t\t\t\tcells.map(async cell => {\r\n\t\t\t\t\t\t\t\t\tconst content = await cell.textContent();\r\n\t\t\t\t\t\t\t\t\treturn content !== null && content.trim() !== \"\" ? cell : null;\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t).filter(cell => cell !== null);\r\n\t\t\t\t\t\treturn cellsWithContent.length === expectedContentCount ? row : null;\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t).filter(row => row !== null);\r\n\t\t\texpect(\r\n\t\t\t\trowsWithMatchingContent.length,\r\n\t\t\t\t`Expected amount of ${expectedContentCount} ${rowKind} cells with content for row not found`\r\n\t\t\t).toBeGreaterThan(0);\r\n\t\t};\r\n\r\n\t\tconst rows = await rowLocator.all();\r\n\r\n\t\tif (options?.row) {\r\n\t\t\tif (options.row.amount) {\r\n\t\t\t\tvalidateRowAmount(rows, options.row.amount);\r\n\t\t\t} else {\r\n\t\t\t\texpect(rows.length, `No ${rowKind} rows found`).toBeGreaterThan(0);\r\n\t\t\t}\r\n\r\n\t\t\tif (options.row.cell) {\r\n\t\t\t\tif (options.row.cell.totalCount) {\r\n\t\t\t\t\tawait validateCellCount(rows, options.row.cell.totalCount);\r\n\t\t\t\t}\r\n\t\t\t\tif (options.row.cell.contentCount) {\r\n\t\t\t\t\tawait validateCellContentCount(rows, options.row.cell.contentCount);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tawait validateCellsWithContent();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tawait validateCellsWithContent();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tawait validateCellsWithContent();\r\n\t\t}\r\n\t}\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAAgC;;;ACMzB,IAAK,kBAAL,kBAAKC,qBAAL;AACN,EAAAA,iBAAA,iBAAc;AACd,EAAAA,iBAAA,eAAY;AAFD,SAAAA;AAAA,GAAA;;;ACHL,IAAe,aAAf,MAA0B;AAAA,EAChC,aAAa,eAAe,MAAe,iBAAmD;AAC7F,UAAM,UAAU,kDAAgD,MAAM,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