Skip to content

Commit 037d873

Browse files
committed
update default timeout
1 parent 459cda5 commit 037d873

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/lib/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ export default {
135135
// Default scrollTime
136136
DEFAULT_SCROLL_TIME: 8,
137137

138+
// Default page load time
139+
DEFAULT_PAGE_LOAD_TIMEOUT: 180000,
140+
138141
// Magic Numbers
139142
MAGIC_NUMBERS: [
140143
{ ext: 'jpg', magic: Buffer.from([0xFF, 0xD8, 0xFF]) },

src/lib/screenshot.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async function captureScreenshotsForConfig(
1414
browserName: string,
1515
renderViewports: Array<Record<string,any>>
1616
): Promise<void> {
17-
let pageOptions = { waitUntil: process.env.SMARTUI_PAGE_WAIT_UNTIL_EVENT || 'domcontentloaded', timeout: ctx.config.waitForPageRender || 60000 };
17+
let pageOptions = { waitUntil: process.env.SMARTUI_PAGE_WAIT_UNTIL_EVENT || 'domcontentloaded', timeout: ctx.config.waitForPageRender || constants.DEFAULT_PAGE_LOAD_TIMEOUT };
1818
let ssId = name.toLowerCase().replace(/\s/g, '_');
1919
let context: BrowserContext;
2020
let contextOptions: Record<string, any> = {};
@@ -103,6 +103,10 @@ async function captureScreenshotsSync(
103103
export async function captureScreenshots(ctx: Context): Promise<Record<string,any>> {
104104
// Clean up directory to store screenshots
105105
utils.delDir('screenshots');
106+
console.log(`ctx.options.parallel ${ctx.options.parallel} `);
107+
108+
// Check Parallel Option and divide web static config accordingly
109+
console.log(`Capturing screenshots for ${ctx.webStaticConfig.length} URLs`);
106110

107111
let browsers: Record<string,Browser> = {};
108112
let capturedScreenshots: number = 0;

0 commit comments

Comments
 (0)