Skip to content

Commit

Permalink
no evaluate
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Cousins <[email protected]>
  • Loading branch information
maximpertsov and mcous authored Dec 4, 2023
1 parent e244f72 commit 68158df
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions rpc/examples/echo/tests/echo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ PW.test("receives responses", async ({ page }) => {
["bidi-direct", ["o", "n", "e"]],
];

for (const [testid, expected] of table) {
const actual = await page
.getByTestId(testid)
.evaluate((elem) =>
Array.from(elem.querySelectorAll("div")).map((div) => div.innerText),
);
PW.expect(actual).toStrictEqual(expected);
for (const [testID, expected] of table) {
const messages = page.getByTestId(testID).locator('div');
const contents = await messages.allTextContents();

expect(contents).toStrictEqual(expected);
}
});

0 comments on commit 68158df

Please sign in to comment.