@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/dist/index.mjs CHANGED
@@ -20,15 +20,6 @@ var TableUtils = class {
20
20
  colspan: parseInt(await cell.getAttribute("colspan") || "1", 10)
21
21
  };
22
22
  }
23
- static castContent(value) {
24
- const trimmedValue = value.trim();
25
- if (trimmedValue === "") return "";
26
- const lowerValue = trimmedValue.toLowerCase();
27
- if (lowerValue === "true") return true;
28
- if (lowerValue === "false") return false;
29
- const num = Number(trimmedValue);
30
- return isNaN(num) ? trimmedValue : num;
31
- }
32
23
  };
33
24
 
34
25
  // src/table-body.ts
@@ -69,13 +60,12 @@ var TableBody = class {
69
60
  }
70
61
  static async processColumn(column, colIndex, columns, rowIndex, spannedCells, cellContentType = "innerText" /* InnerText */) {
71
62
  const content = await TableUtils.getCellContent(column, cellContentType);
72
- const castedContent = TableUtils.castContent(content);
73
63
  const { rowspan, colspan } = await TableUtils.parseSpanAttributes(column);
74
64
  for (let span = 0; span < colspan; span++) {
75
- columns[colIndex + span] = castedContent;
65
+ columns[colIndex + span] = content;
76
66
  }
77
67
  if (rowspan > 1) {
78
- this.storeSpannedCells(rowIndex, colIndex, rowspan, castedContent, spannedCells);
68
+ this.storeSpannedCells(rowIndex, colIndex, rowspan, content, spannedCells);
79
69
  }
80
70
  }
81
71
  static storeSpannedCells(rowIndex, colIndex, rowspan, content, spannedCells) {
@@ -288,6 +278,34 @@ var TableWait = class {
288
278
 
289
279
  // src/playwright-table.ts
290
280
  var PlaywrightTable = class {
281
+ /**
282
+ * Creates an instance of the table handler with customizable selectors for headers and rows.
283
+ *
284
+ * @param _tableLocator - The Playwright `Locator` pointing to the root table element.
285
+ * @param _options - Optional configuration for customizing header and row selectors.
286
+ * @param _options.header - Options for header row and columns.
287
+ * @param _options.header.setMainHeaderRow - (Optional) Index of the main header row if multiple header rows exist.
288
+ * @param _options.header.rowSelector - (Optional) CSS selector for locating header rows. Defaults to `"thead>tr"`.
289
+ * @param _options.header.columnSelector - (Optional) CSS selector for locating header columns. Defaults to `"th"`.
290
+ * @param _options.row - Options for body rows and columns.
291
+ * @param _options.row.rowSelector - (Optional) CSS selector for locating body rows. Defaults to `"tbody>tr"`.
292
+ * @param _options.row.columnSelector - (Optional) CSS selector for locating body columns. Defaults to `"td"`.
293
+ *
294
+ * @example
295
+ * const table = new PlaywrightTable(
296
+ * page.locator('table.my-table'),
297
+ * {
298
+ * header: {
299
+ * rowSelector: 'thead tr.header',
300
+ * columnSelector: 'th.header-cell'
301
+ * },
302
+ * row: {
303
+ * rowSelector: 'tbody tr.data-row',
304
+ * columnSelector: 'td.data-cell'
305
+ * }
306
+ * }
307
+ * );
308
+ */
291
309
  constructor(_tableLocator, _options) {
292
310
  this._tableLocator = _tableLocator;
293
311
  this._options = _options;
@@ -299,24 +317,63 @@ var PlaywrightTable = class {
299
317
  this._bodyRowLocator = this._tableLocator.locator((_i = (_h = (_g = this._options) == null ? void 0 : _g.row) == null ? void 0 : _h.rowSelector) != null ? _i : "tbody>tr");
300
318
  this._bodyRowColumnSelector = (_l = (_k = (_j = this._options) == null ? void 0 : _j.row) == null ? void 0 : _k.columnSelector) != null ? _l : "td";
301
319
  }
320
+ /**
321
+ * Retrieves all header rows of the table.
322
+ * @param options - Optional parameters for timeout and header row options.
323
+ * @param options.timeout - Timeout in milliseconds for loading table data.
324
+ * @param options.headerRowOptions - See {@link HeaderRowOptions} for available options.
325
+ * @returns A promise that resolves to an array of header rows.
326
+ */
302
327
  async getHeaderRows(options) {
303
328
  await this.load(options);
304
329
  return this._headers;
305
330
  }
331
+ /**
332
+ * Retrieves the main header row of the table.
333
+ * @param options - Optional parameters for timeout and header row options.
334
+ * @param options.timeout - Timeout in milliseconds for loading table data.
335
+ * @param options.headerRowOptions - See {@link HeaderRowOptions} for available options.
336
+ * @returns A promise that resolves to the main header row.
337
+ */
306
338
  async getMainHeaderRow(options) {
307
- var _a, _b;
308
- const headerRows = await this.getHeaderRows(options);
309
- const headers = ((_b = (_a = this._options) == null ? void 0 : _a.header) == null ? void 0 : _b.setMainHeaderRow) ? headerRows[this._options.header.setMainHeaderRow] : headerRows[this._headers.length - 1];
310
- return headers;
311
- }
339
+ await this.load(options);
340
+ return this.mainHeaderRow();
341
+ }
342
+ /**
343
+ * Retrieves all body rows of the table.
344
+ * @param options.timout - Timeout in milliseconds for loading table data.
345
+ * @param options.bodyRowOptions.cellContentType - The content type for the body rows.
346
+ * @returns A promise that resolves to an array of body rows.
347
+ */
312
348
  async getBodyRows(options) {
313
- await this.load({ ...options, headerRowOptions: { colspan: { enabled: true } } });
349
+ await this.load({
350
+ timeout: options == null ? void 0 : options.timeout,
351
+ bodyRowOptions: options == null ? void 0 : options.bodyRowOptions,
352
+ headerRowOptions: {
353
+ colspan: { enabled: true }
354
+ }
355
+ });
314
356
  return this._rows;
315
357
  }
358
+ /**
359
+ * Retrieves a specific cell locator in the body of the table.
360
+ * @param rowNumber - The row number (0-based index).
361
+ * @param headerPosition - The header position (0-based index).
362
+ * @returns A Playwright Locator for the specified cell.
363
+ */
316
364
  getBodyCellLocator(rowNumber, headerPosition) {
317
365
  return this._bodyRowLocator.nth(rowNumber).locator(this._bodyRowColumnSelector).nth(headerPosition);
318
366
  }
367
+ /**
368
+ * Retrieves a cell locator in the body of the table based on row conditions and a target header.
369
+ * @param conditions - A record of header names and their expected values.
370
+ * @param targetHeader - The target header name for the desired cell.
371
+ * @param options - See {@link LoadOptions} for available options.
372
+ * @returns A promise that resolves to a Playwright Locator for the matching cell.
373
+ * @throws An error if no matching row is found or if a header is not found.
374
+ */
319
375
  async getBodyCellLocatorByRowConditions(conditions, targetHeader, options) {
376
+ var _a;
320
377
  await this.load(options);
321
378
  const headers = await this.getMainHeaderRow();
322
379
  const targetHeaderIndex = headers.indexOf(targetHeader);
@@ -331,7 +388,8 @@ var PlaywrightTable = class {
331
388
  if (headerIndex === -1) {
332
389
  throw new Error(`Header "${header}" not found.`);
333
390
  }
334
- if (row[headerIndex] !== value) {
391
+ const cellValue = (_a = row[headerIndex]) != null ? _a : "";
392
+ if (cellValue !== value) {
335
393
  matches = false;
336
394
  break;
337
395
  }
@@ -342,6 +400,13 @@ var PlaywrightTable = class {
342
400
  }
343
401
  throw new Error(`No row found matching conditions: ${JSON.stringify(conditions)}`);
344
402
  }
403
+ /**
404
+ * Retrieves all cell locators in the body of the table for a specific header name.
405
+ * @param header - The header name.
406
+ * @param options - See {@link LoadOptions} for available options.
407
+ * @returns A promise that resolves to an array of Playwright Locators for the cells.
408
+ * @throws An error if the header is not found.
409
+ */
345
410
  async getAllBodyCellLocatorsByHeaderName(header, options) {
346
411
  await this.load(options);
347
412
  const headers = await this.getMainHeaderRow();
@@ -356,8 +421,14 @@ var PlaywrightTable = class {
356
421
  }
357
422
  return locators;
358
423
  }
359
- async getAllBodyCellLocatorsByHeaderIndex(headerIndex) {
360
- await this.load();
424
+ /**
425
+ * Retrieves all cell locators in the body of the table for a specific header index.
426
+ * @param headerIndex - The header index (0-based).
427
+ * @param options - See {@link LoadOptions} for available options.
428
+ * @returns A promise that resolves to an array of Playwright Locators for the cells.
429
+ */
430
+ async getAllBodyCellLocatorsByHeaderIndex(headerIndex, options) {
431
+ await this.load(options);
361
432
  const locators = [];
362
433
  for (let rowIndex = 0; rowIndex < this._rows.length; rowIndex++) {
363
434
  const cellLocator = this.getBodyCellLocator(rowIndex, headerIndex);
@@ -365,16 +436,26 @@ var PlaywrightTable = class {
365
436
  }
366
437
  return locators;
367
438
  }
439
+ /**
440
+ * Converts the table data into a JSON object.
441
+ * @param options - See {@link LoadOptions} for available options.
442
+ * @returns A promise that resolves to a JSON representation of the table.
443
+ */
368
444
  async getJson(options) {
369
- const headers = await this.getMainHeaderRow({
445
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
446
+ await this.load({
370
447
  timeout: options == null ? void 0 : options.timeout,
371
- duplicateSuffix: true,
448
+ bodyRowOptions: options == null ? void 0 : options.bodyRowOptions,
372
449
  headerRowOptions: {
373
- colspan: { enabled: true, suffix: true },
374
- duplicateSuffix: true,
375
- emptyCellReplacement: true
450
+ colspan: {
451
+ enabled: (_c = (_b = (_a = options == null ? void 0 : options.headerRowOptions) == null ? void 0 : _a.colspan) == null ? void 0 : _b.enabled) != null ? _c : true,
452
+ suffix: (_f = (_e = (_d = options == null ? void 0 : options.headerRowOptions) == null ? void 0 : _d.colspan) == null ? void 0 : _e.suffix) != null ? _f : true
453
+ },
454
+ duplicateSuffix: (_h = (_g = options == null ? void 0 : options.headerRowOptions) == null ? void 0 : _g.duplicateSuffix) != null ? _h : true,
455
+ emptyCellReplacement: (_j = (_i = options == null ? void 0 : options.headerRowOptions) == null ? void 0 : _i.emptyCellReplacement) != null ? _j : true
376
456
  }
377
457
  });
458
+ const headers = this.mainHeaderRow();
378
459
  return this._rows.map((row) => {
379
460
  const rowObj = {};
380
461
  headers.forEach((header, index) => {
@@ -383,6 +464,11 @@ var PlaywrightTable = class {
383
464
  return rowObj;
384
465
  });
385
466
  }
467
+ /**
468
+ * Waits for the header rows to be loaded.
469
+ * @param options - See {@link WaitForTableRowsOptions} for available options.
470
+ * @returns A promise that resolves when the header rows are loaded.
471
+ */
386
472
  async waitForHeaderRows(options) {
387
473
  await expect2(
388
474
  async () => await TableWait.waitForRows(this._headerRowLocator, this._headerColumnSelector, "header" /* Header */, options)
@@ -390,6 +476,11 @@ var PlaywrightTable = class {
390
476
  timeout: options == null ? void 0 : options.timeout
391
477
  });
392
478
  }
479
+ /**
480
+ * Waits for the body rows to be loaded.
481
+ * @param options - See {@link WaitForTableRowsOptions} for available options.
482
+ * @returns A promise that resolves when the body rows are loaded.
483
+ */
393
484
  async waitForBodyRows(options) {
394
485
  await expect2(
395
486
  async () => await TableWait.waitForRows(this._bodyRowLocator, this._bodyRowColumnSelector, "body" /* Body */, options)
@@ -407,7 +498,11 @@ var PlaywrightTable = class {
407
498
  this._headerColumnSelector,
408
499
  options == null ? void 0 : options.headerRowOptions
409
500
  );
410
- this._rows = await TableBody.getRows(this._bodyRowLocator, this._bodyRowColumnSelector);
501
+ this._rows = await TableBody.getRows(this._bodyRowLocator, this._bodyRowColumnSelector, options == null ? void 0 : options.bodyRowOptions);
502
+ }
503
+ mainHeaderRow() {
504
+ var _a, _b;
505
+ 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];
411
506
  }
412
507
  };
413
508
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../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":["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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SASN;AACjB,UAAMC;AAAA,MACL,YACC,MAAM,UAAU,YAAY,KAAK,mBAAmB,KAAK,8CAAuC,OAAO;AAAA,IACzG,EAAE,OAAO;AAAA,MACR,SAAS,mCAAS;AAAA,IACnB,CAAC;AAAA,EACF;AAAA,EAEA,MAAM,gBAAgB,SASJ;AACjB,UAAMA;AAAA,MACL,YAAY,MAAM,UAAU,YAAY,KAAK,iBAAiB,KAAK,2CAAsC,OAAO;AAAA,IACjH,EAAE,OAAO;AAAA,MACR,SAAS,mCAAS;AAAA,IACnB,CAAC;AAAA,EACF;AAAA,EAEA,MAAc,KAAK,SAAoF;AACtG,UAAMA,QAAO,YAAY;AACxB,YAAM,UAAU,YAAY,KAAK,mBAAmB,KAAK,4CAAqC;AAC9F,YAAM,UAAU,YAAY,KAAK,iBAAiB,KAAK,yCAAoC;AAAA,IAC5F,CAAC,EAAE,OAAO,EAAE,SAAS,mCAAS,QAAQ,CAAC;AAEvC,SAAK,WAAW,MAAM,YAAY;AAAA,MACjC,KAAK;AAAA,MACL,KAAK;AAAA,MACL,mCAAS;AAAA,IACV;AACA,SAAK,QAAQ,MAAM,UAAU,QAAQ,KAAK,iBAAiB,KAAK,sBAAsB;AAAA,EACvF;AACD;","names":["expect","CellContentType","rows","expect"]}
1
+ {"version":3,"sources":["../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":["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,SAAS,UAAAA,eAAuB;;;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,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;AACD;;;ACVO,IAAe,YAAf,MAAyB;AAAA,EAC/B,aAAa,QACZ,YACA,iBACA,iBAGqB;AACrB,UAAM,OAAkB,CAAC;AACzB,UAAM,YAAY,MAAM,WAAW,MAAM;AACzC,UAAM,eAAuC,CAAC;AAE9C,aAAS,WAAW,GAAG,WAAW,WAAW,YAAY;AACxD,YAAM,MAAM,WAAW,IAAI,QAAQ;AACnC,YAAM,UAAU,MAAM,KAAK;AAAA,QAC1B;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,mDAAiB;AAAA,MAClB;AACA,WAAK,KAAK,OAAkB;AAAA,IAC7B;AAEA,WAAO;AAAA,EACR;AAAA,EAEA,a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C,SAAK,WAAW,MAAM,YAAY;AAAA,MACjC,KAAK;AAAA,MACL,KAAK;AAAA,MACL,mCAAS;AAAA,IACV;AACA,SAAK,QAAQ,MAAM,UAAU,QAAQ,KAAK,iBAAiB,KAAK,wBAAwB,mCAAS,cAAc;AAAA,EAChH;AAAA,EAEQ,gBAA2B;AAxUpC;AAyUE,aAAO,gBAAK,aAAL,mBAAe,WAAf,mBAAuB,oBAC3B,KAAK,SAAS,KAAK,SAAS,OAAO,gBAAgB,IACnD,KAAK,SAAS,KAAK,SAAS,SAAS,CAAC;AAAA,EAC1C;AACD;","names":["expect","CellContentType","rows","expect"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerios/playwright-table",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "author": "Ronald Veth - Cerios",
5
5
  "description": "Easy Html Tables handler for Playwright",
6
6
  "license": "MIT",
@@ -26,7 +26,8 @@
26
26
  "serve": "serve tests/demo-html -p 3000",
27
27
  "check-exports": "attw --pack .",
28
28
  "changeset": "npx changeset",
29
- "local-release": "changeset version && changeset publish",
29
+ "changeset:version": "changeset version && npm i",
30
+ "changeset:publish": "changeset publish",
30
31
  "compile": "tsc --noEmit",
31
32
  "update-all-packages": "npx npm-check-updates -u && npm i"
32
33
  },
@@ -35,15 +36,15 @@
35
36
  "@changesets/cli": "^2.29.4",
36
37
  "@playwright/test": "^1.52.0",
37
38
  "husky": "^9.1.7",
38
- "lint-staged": "^16.0.0",
39
+ "lint-staged": "^16.1.0",
39
40
  "prettier": "^3.5.3",
40
41
  "serve": "^14.2.4",
41
42
  "ts-node": "^10.9.2",
42
- "tsup": "^8.4.0",
43
+ "tsup": "^8.5.0",
43
44
  "typescript": "^5.8.3"
44
45
  },
45
46
  "peerDependencies": {
46
- "@playwright/test": "^1.51.1"
47
+ "@playwright/test": "^1.40.0"
47
48
  },
48
49
  "main": "./dist/index.js",
49
50
  "module": "./dist/index.mjs",