chore: this time, I promise. I fixed it. Sorted out all the scoping stuff for the hacky stuff that evaluate does with .toString
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -142,10 +142,12 @@ export async function waitForPageWithText(
|
||||
waitUntil: 'networkidle0',
|
||||
});
|
||||
|
||||
const match = await page.evaluate(() =>
|
||||
Array.from(document.querySelectorAll('*')).some(
|
||||
el => el.textContent === text,
|
||||
),
|
||||
const match = await page.evaluate(
|
||||
textContent =>
|
||||
Array.from(document.querySelectorAll('*')).some(
|
||||
el => el.textContent === textContent,
|
||||
),
|
||||
text,
|
||||
);
|
||||
|
||||
if (!match) {
|
||||
@@ -154,6 +156,7 @@ export async function waitForPageWithText(
|
||||
|
||||
break;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
assertError(error);
|
||||
|
||||
findAttempts++;
|
||||
|
||||
Reference in New Issue
Block a user