We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91d4ea7 commit 6dac51eCopy full SHA for 6dac51e
test/puppeteer.js
@@ -73,9 +73,9 @@ async function test(port) {
73
for (const {url, js, screenshot} of testPages) {
74
waitingPromiseInfo = makePromiseInfo();
75
console.log(`===== [ ${url} ] =====`);
76
- if (js) {
77
- await page.evaluateOnNewDocument(js);
78
- }
+ const id = js
+ ? await page.evaluateOnNewDocument(js)
+ : undefined;
79
await page.goto(url);
80
await page.waitForNetworkIdle();
81
if (js) {
@@ -93,6 +93,9 @@ async function test(port) {
93
const path = `${dir}/${name}.png`;
94
await page.screenshot({path});
95
}
96
+ if (id) {
97
+ await page.removeScriptToEvaluateOnNewDocument(id.identifier);
98
+ }
99
100
101
await browser.close();
0 commit comments