Skip to content

Commit 4d16e8c

Browse files
committed
Added logs
1 parent bc1196c commit 4d16e8c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/App.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ export default class App {
107107

108108
async function generateTempFile(event: IEvent) {
109109

110+
try {
111+
console.log(`Event: ${JSON.stringify(event, undefined, 2)}`);
112+
} catch {
113+
114+
}
115+
110116
let ext = ".jpg";
111117
if (event.html) {
112118
ext = ".html";

src/commands/Command.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,10 @@ export default abstract class Command {
206206
}
207207

208208
async waitForPageToLoad({ timeout, page, stopTest }: IEvent) {
209-
console.log(`Waiting for pageReady`);
209+
console.log(`Waiting for pageReady till ${timeout}ms`);
210210
let start = Date.now();
211211
let end = start + timeout;
212+
let isPageReady = false;
212213
for (let index = start; index < end; index += 1000) {
213214
await sleep(1000);
214215
if (await page.evaluate(stopTest)) {
@@ -218,8 +219,11 @@ export default abstract class Command {
218219
}
219220
}
220221

222+
timeout = 3000;
223+
224+
console.log(`Waiting for idle network in ${timeout}ms`)
221225
await page.waitForNetworkIdle({
222-
timeout: 3000
226+
timeout
223227
});
224228
}
225229

0 commit comments

Comments
 (0)