Consistently use string arguments for page.waitForFunction
calls
We use string arguments in all other places, so these two places are a bit inconsistent in that sense. Moreover, it's just one argument now, which makes it a bit easier to read and see what it does because we don't have to pass the always-empty options argument anymore. Finally, doing it like this ensures it works in all Puppeteer versions given https://github.com/puppeteer/puppeteer/issues/7836.
This commit is contained in:
parent
e638a84afe
commit
1bc6b846b6
@ -696,14 +696,9 @@ describe("Interaction", () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await page.click(`[data-annotation-id='${id}R']`);
|
await page.click(`[data-annotation-id='${id}R']`);
|
||||||
|
const selector = ref.replace("\\", "\\\\");
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(
|
||||||
(_ref, _current, _propName) =>
|
`getComputedStyle(document.querySelector("${selector}"))["${propName}"] !== "${current}"`
|
||||||
getComputedStyle(document.querySelector(_ref))[_propName] !==
|
|
||||||
_current,
|
|
||||||
{},
|
|
||||||
ref,
|
|
||||||
current,
|
|
||||||
propName
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const color = await page.$eval(
|
const color = await page.$eval(
|
||||||
@ -755,11 +750,7 @@ describe("Interaction", () => {
|
|||||||
await page.keyboard.press("Tab");
|
await page.keyboard.press("Tab");
|
||||||
|
|
||||||
await page.waitForFunction(
|
await page.waitForFunction(
|
||||||
_prev =>
|
`getComputedStyle(document.querySelector("#\\\\31 71R")).value !== "${prev}"`
|
||||||
getComputedStyle(document.querySelector("#\\31 71R")).value !==
|
|
||||||
_prev,
|
|
||||||
{},
|
|
||||||
prev
|
|
||||||
);
|
);
|
||||||
|
|
||||||
sum += val;
|
sum += val;
|
||||||
|
Loading…
Reference in New Issue
Block a user