Total Complexity | 2 |
Complexity/F | 2 |
Lines of Code | 18 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | // @ts-check |
||
14 | export async function expectTableContent(expect, locator, header, rows) { |
||
15 | await expect(locator).toBeVisible(); |
||
16 | |||
17 | expect(await locator.locator('> thead > tr > th').allInnerTexts()).toEqual( |
||
18 | header |
||
19 | ); |
||
20 | expect(await locator.locator('> tbody > tr').count()).toBe(rows.length); |
||
21 | |||
22 | for (let i = 0; i < rows.length; i++) { |
||
23 | expect( |
||
24 | await locator |
||
25 | .locator('> tbody > tr') |
||
26 | .nth(i) |
||
27 | .locator('> td') |
||
28 | .allInnerTexts() |
||
29 | ).toEqual(rows[i]); |
||
30 | } |
||
31 | } |
||
32 |